* [PATCH 6.18 000/703] 6.18.67-rc1 review
@ 2026-12-04 9:58 Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 001/703] drm/gem-dma: Support dedicated DMA device for allocation and mapping Greg Kroah-Hartman
` (137 more replies)
0 siblings, 138 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 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.18.67 release.
There are 703 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:59 +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.18.67-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.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 6.18.67-rc1
Paulo Alcantara <pc@manguebit.org>
smb: client: don't spend read retries on reads cut short by a reconnect
Paulo Alcantara <pc@manguebit.org>
smb: client: don't give up writeback on the first replayable error
Paulo Alcantara <pc@manguebit.org>
smb: client: don't retry failed writes forever regardless of mount options
Paulo Alcantara <pc@manguebit.org>
smb: client: let umount -f abort retried reads and writes
Christopher Lusk <clusk@northecho.dev>
smb: client: set replay flag on the read send-error retry path
Marc Herrero <marcht@proton.me>
ASoC: qcom: audioreach: use a 32-bit container for S24_LE PCM
Marek Szyprowski <m.szyprowski@samsung.com>
dma-pool: release CMA pages on atomic_pool_expand() error path
Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
dma-pool: fix page leak in atomic_pool_expand() cleanup
Marek Szyprowski <m.szyprowski@samsung.com>
dma: swiotlb: Round restricted DMA pool size down to IO_TLB_SEGSIZE
Yao Yiqi <yaoyiqi3@huawei.com>
fbcon: Avoid cancel_delayed_work_sync() in atomic context
Leon Ming <leonming@meta.com>
fuse: set dentry epoch before making the dentry visible
Hanson Wang <hanson.wang@ugreen.com>
drm/i915/dsb: Realign GOSUB only for QW slots 6 and 7
Jouni Högander <jouni.hogander@intel.com>
drm/i915/psr: Clear CFF state on flip flush
Imre Deak <imre.deak@intel.com>
drm/i915/ptl+: Fix TypeC detection for eDP on port B
Imre Deak <imre.deak@intel.com>
drm/i915/tc: Add separate intel_tc_phy_port_to_tc() for TC DDI/PHY ports
Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
drm/sched: Ensure stopped entity cannot be re-added to the run-queue
Fei Yu <fei.yu@intel.com>
drm/syncobj: Limit the number of handles and use kvmalloc for user-sized arrays
Thomas Hellström <thomas.hellstrom@linux.intel.com>
drm/xe/dma-buf: Validate BOs on export to charge the exporter
Thomas Hellström <thomas.hellstrom@linux.intel.com>
drm/xe: Don't abort the shrinker walk on -EBUSY
Shuicheng Lin <shuicheng.lin@intel.com>
drm/xe/shrinker: Take a runtime PM ref before shrinking non-system memory
Tejas Upadhyay <tejas.upadhyay@intel.com>
drm/xe/xe3p_lpg: flush shrinker bo cachelines manually
Paul Menzel <pmenzel@molgen.mpg.de>
drm/amd/display: Don't warn about vendor infoframe for non-infoframe sinks
Davey Hughes <davidralphhughes@gmail.com>
drm/amd/display: Keep FreeSync flip timing across plane resets
Maíra Canal <mcanal@igalia.com>
drm/vc4: Look up the async page flip fence before committing the flip
Maíra Canal <mcanal@igalia.com>
drm/vc4: Rebuild the V3D interrupt mask on every power transition
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: validate backup buffer size in command buffer processing
Chen, Junjia <junjia.chen@intel.com>
drm/xe: Unwrap sync fences before adding them as job dependencies
Guenter Roeck <linux@roeck-us.net>
hwmon: (nct6775) Fix target temp and tolerance for NCT6106/6116/6126
Liam R. Howlett (Google) <liam@infradead.org>
maple_tree: update internal warning and bug_on code
Aleksandr Loktionov <aleksandr.loktionov@intel.com>
i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam
Filip Balluch <fballuch@redhat.com>
i40e: fix freeing of TX rings on RX allocation failure
Günther Noack <gnoack3000@gmail.com>
landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER
Axel Mierczuk <axel.mierczuk@1password.com>
ipvs: skip cport 0 connections in ip_vs_conn_out_get()
Zi Yan <ziy@nvidia.com>
mm/huge_memory: prevent losing PG_waiters in __split_folio_to_order()
Kuniyuki Iwashima <kuniyu@google.com>
mm/kasan: detect double-free involving kfree_rcu_sheaf()
Mike Rapoport (Microsoft) <rppt@kernel.org>
mm/vma: undo userfaultfd unmap preparation when unmapping fails
Amit Machhiwal <amachhiw@linux.ibm.com>
ring-buffer: Do not check si_mem_available() before deferred init completes
Marek Szyprowski <m.szyprowski@samsung.com>
riscv: mm: reserve the DTB before scanning reserved memory
Muchun Song <muchun.song@linux.dev>
riscv/mm: fix hotplug page-table destructor handling
Jisheng Zhang <jszhang@kernel.org>
riscv: convert pgtable_l4|l5_enabled to inline function
Mike Rapoport (Microsoft) <rppt@kernel.org>
userfaultfd: clear uffd state in child PTEs if uffd is released during fork
Umang Pokhriyal <umangpokhriyall@gmail.com>
userfaultfd: validate the whole range before changing write protection
Christian Schmidbauer <opensource@grische.xyz>
net: stmmac: dwmac1000: stop hardware from dropping checksum-error packets
Guixin Liu <kanie@linux.alibaba.com>
nvmet: use GFP_KERNEL for PR allocations
Stanley Jhu <stanleyjhu@google.com>
scsi: ufs: sysfs: Propagate runtime PM resume errors
Can Guo <can.guo@oss.qualcomm.com>
scsi: ufs: core: Introduce function ufshcd_query_attr_qword()
ozgun kultekin <ozgunkultekin@gmail.com>
smb: client: do not let the server grow a write subrequest
Shyam Prasad N <sprasad@microsoft.com>
cifs: make retry logic in read/write path consistent with other paths
Siddharth Chintamaneni <sidchintamaneni@gmail.com>
smb: client: fix busy dentry and inode on unmount from late oplock break
Siddharth Chintamaneni <sidchintamaneni@gmail.com>
smb: client: fix busy dentry on unmount from persistent handle reopen
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()
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpiolib: clear debounce period before the "requested" flag
Cooper Morgan <ext-github@cwooper.dev>
drm/amd/display: Saturate refresh rates in v1/v2 FreeSync infopackets
Luca Ceresoli <luca.ceresoli@bootlin.com>
drm/display: bridge-connector: attach the encoder to the created connector
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
Miguel Ojeda <ojeda@kernel.org>
x86/rust: use `-Zindirect-branch-cs-prefix` for RETPOLINE builds
Gyeyoung Baek <gye976@gmail.com>
accel/rocket: Fix drm_mm UAF on close vs in-flight job
Guangshuo Li <lgs201920130244@gmail.com>
accel/rocket: put IOMMU domain on BO creation failure
Hugo Sales <hugo@hsal.es>
drm/amd/display: Add the AUX backlight minimum once on the custom curve
Carlos Bilbao <carlos.bilbao@kernel.org>
scsi: target: iscsi: reject invalid size Extended CDB AHS
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()
Abhiraj Dutta <abhirajdutta7@gmail.com>
ALSA: hda/realtek: Fix duplicate LEDs on HP Spectre x360 16-f2xxx
Abhiraj Dutta <abhirajdutta7@gmail.com>
ALSA: hda/realtek: Add quirk for HP Spectre x360 2-in-1 Laptop 16-f2xxx
Parmjot Singh <parmjotsinghrobot@gmail.com>
ALSA: hda/realtek: Enable mute LEDs on HP Envy x360 15-ew0xxx
Oleg Antonyan <oleg.b.antonyan@gmail.com>
ALSA: hda/realtek: Fix headset mic on ASUS Zenbook S 13 UX5304MA
Akhil Arul <akhilarul324@gmail.com>
ALSA: hda/tas2781-spi: Set tas_hda->dev in probe
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
Michael S. Tsirkin <mst@redhat.com>
vhost: reject used ring batches larger than the ring
Michael S. Tsirkin <mst@redhat.com>
Revert "vhost: split out-of-order used ring batches at every wrap"
Aamir Ahmed <elb12345@hotmail.co.uk>
vhost: Run TIF_NOTIFY_RESUME work in the vhost_task loop
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
Zhan Xusheng <zhanxusheng1024@gmail.com>
vdso/math64: Use OPTIMIZER_HIDE_VAR() in __iter_div_u64_rem()
Chris Mason <mason@kernel.org>
futex: Fix private hash use-after-free on resize
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
Samuel Holland <samuel@sholland.org>
Revert "drm/rockchip: dw_hdmi_qp: remove now-redundant call to drm_connector_attach_encoder()"
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: Fix false success return in process_system_preds()
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
Suyuan Wang <stevewong@hust.edu.cn>
smb: client: fail SMB2 responses with a bad signature
Fredric Cover <fredric.cover.lkernel@gmail.com>
smb: client: convert path_consumed to mount charset units
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: zero the entire Get Log Page transfer buffer
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: roll back queue bindings on connection failure
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-fcloop: free the LS request when delivery fails
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
Yingjie Wang <1075151112@qq.com>
nvme: avoid wrapping admin_timeout and io_timeout
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
Arun Iyengar <aiyengar1990@gmail.com>
net: stmmac: drop the rest of the frame when napi_build_skb() fails
Chris J Arges <carges@cloudflare.com>
net: prevent receive header offset overflow during decapsulation
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
Hengyu Liang <hengyul@cs.unc.edu>
xfs: fix f_bfree underflow in statfs()
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
Richard Weinberger <richard@nod.at>
x86/Kconfig: Enable ROX also when STRICT_KERNEL_RWX is present
WeitaoWang-oc <WeitaoWang-oc@zhaoxin.com>
x86/apic/msi: Fix MSI interrupt affinity configuration
Antonio Borneo <antonio.borneo@foss.st.com>
watchdog: stm32_iwdg: set driver data before requesting interrupt
Antonio Borneo <antonio.borneo@foss.st.com>
watchdog: stm32_iwdg: serialize accesses to EWCR register
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
Michael S. Tsirkin <mst@redhat.com>
vhost: split out-of-order used ring batches at every wrap
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
SJ Park <sj@kernel.org>
selftests/damon/sysfs_memcg_path_leak: define ksft_skip
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()
Peder Bergan <peder.bergan@gmail.com>
rust: str: tie Formatter to its backing buffer
Marwan Mohamed Zein <marawanzein222@gmail.com>
rust: iov: fix return lifetime of `copy_from_iter_raw()`
Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
riscv: unaligned: fix __setup handlers
Guobin Zhang <guobin.zhang@intel.com>
riscv: signal: protect regs->status RMW from concurrent preemption
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
Abhijit Gangurde <abhijit.gangurde@amd.com>
RDMA/ionic: Use a linear QID space when udma_shift is zero
Nathan Chancellor <nathan@kernel.org>
rcu/nocb: Avoid unsequenced accesses to jiffies in show_rcu_nocb_state()
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
Muchun Song <muchun.song@linux.dev>
mm: fix missing page-table destructor in pagetable_free()
David Hildenbrand (Arm) <david@kernel.org>
mm/userfaultfd: fix PTE table overruns in UFFDIO_MOVE
David Hildenbrand (Arm) <david@kernel.org>
mm/rmap: fix PTE table overruns during batched unmap
Ridong Chen <chenridong@xiaomi.com>
mm/migrate: move NR_KERNEL_FILE_PAGES on cross-node migration
Ridong Chen <chenridong@xiaomi.com>
mm/migrate: move NR_FILE_THPS on cross-node migration
Andrew Morton <akpm@linux-foundation.org>
mm/mempolicy: use one node set for interleave weights
David Hildenbrand (Arm) <david@kernel.org>
mm/memfd: handle GUP pins more reliably when write-sealing
David Hildenbrand (Arm) <david@kernel.org>
mm/khugepaged: don't map folios that are not uptodate in MADV_COLLAPSE
Kuniyuki Iwashima <kuniyu@google.com>
mm/kasan/kunit: add double-free tests involving kfree_rcu_sheaf()
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
Mani Tofigh <mt4022@columbia.edu>
mm, swap: stop cluster list scans once swapoff clears SWP_WRITEOK
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()
Eric Dumazet <edumazet@kernel.org>
ipv6: gro: limit the number of extension headers
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
Alice Ryhl <aliceryhl@google.com>
kbuild: rust: disable function merging unconditionally
Henry Martin <bsdhenrymartin@gmail.com>
ip6mr: prevent info-leak in ip6mr_cache_report()
David Hildenbrand (Arm) <david@kernel.org>
iommufd: fix cleanup when adding memfd folio pins fails
Juan Parrado <jparrado.1817@gmail.com>
Input: xpad.c - add support for Hyperkin Xenon, Hori Taiko Controller DX, and 8BitDo M30
Juan Parrado <jparrado.1817@gmail.com>
Input: xpad - add support to Hori Real Arcade Pro 4
Sergei Kuznetsov <kernel@phnx47.net>
Input: xpad - add GameSir G7 Pro support
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()
Guenter Roeck <linux@roeck-us.net>
hwmon: Use per-device lockdep keys
Xuanqiang Luo <luoxuanqiang@kylinos.cn>
iavf: fix QoS capabilities memory leak
Xuanqiang Luo <luoxuanqiang@kylinos.cn>
iavf: fix ASQ command buffer leak on init failure
Xuanqiang Luo <luoxuanqiang@kylinos.cn>
iavf: add missing PTP adjustment callbacks
Sung Byeongchan <tjdqudcks0424@naver.com>
ieee802154: require CAP_NET_ADMIN for SIOCSIFADDR
Joas Antonio dos Santos <joasantonio108@gmail.com>
hugetlbfs: move hugetlbfs_free_inode tracepoint to ->destroy_inode()
Amaan Cheval <amaan.cheval@gmail.com>
gve: refuse XDP on queue formats without XDP support
Amaan Cheval <amaan.cheval@gmail.com>
gve: fix RX page refcount overflow from INT_MAX pagecnt_bias
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpiolib: don't overwrite the entire flags field in gpiod_get_direction()
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpiolib: keep the line state workqueue alive until device release
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
David Thompson <davthompson@nvidia.com>
gpio: mlxbf2: Disable interrupts around the chip lock in direction ops
Alexandre Becholey <alex@becholey.ch>
gpio: ljca: Validate the pin index of interrupt events
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpio: cdev: don't overwrite the whole flags field when configuring lines
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()
Hungyu Lin <dennylin0707@gmail.com>
fuse: clear the old EOF tail before writeback-cache writes
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
Breno Leitao <leitao@debian.org>
fgraph: Do not mark index 0 in every shadow stack frame
Vineet Gupta <vineet.gupta@linux.dev>
fgraph: Allocate shadow stacks inline with GFP_NOWAIT
Sang-Heon Jeon <ekffu200098@gmail.com>
fault-inject: fix boot failure with fault injection boot parameters
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
Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
cpufreq: Skip inactive policies in cpufreq_driver_target()
Sumit Gupta <sumitg@nvidia.com>
cpufreq: CPPC: Set CPPC Enable register in cpu_init()
Mickaël Salaün <mic@digikod.net>
capabilities: Check PR_SET_SECUREBITS with ns_capable()
Jiri Olsa <jolsa@kernel.org>
bpf: Restrict uprobe ctx writes to the registers ptrace can set
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
Justinien Bouron <jbouron@amazon.com>
ata: libata-core: Add max sector quirk to INTEL SSDSCKKB240G8
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
Nicholas E. Andrade <sdnick484@gmail.com>
ASoC: amd: acp: fix PDM ring buffer address on ACP7.x resume
Ben Cressey <ben@cressey.dev>
arm64: kexec: use a typed entry to fix kCFI oops
Ryan Roberts <ryan.roberts@arm.com>
arm64: cpufeature: Remove Neoverse-V3/AE from the BBML3 allow list
Muchun Song <muchun.song@linux.dev>
arm64/mm: fix destructor for unconstructed hotplug page tables
Vineet Gupta <vgupta@kernel.org>
ARC: io: work around GCC PR127718 in __raw_write{w,l}()
Christian Loehle <christian.loehle@arm.com>
ACPI: CPPC: Reject EPP registers narrower than 8 bits
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 the framebuffer selected for cursor updates
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: validate GB-only cursor command limits
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: reserve cursor MOBs before unpinning them
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
Zack Rusin <zack.rusin@broadcom.com>
drm/vmwgfx: keep cursor mappings and pins with each plane state
Tomas M <tomas@slax.org>
drm/vmwgfx: include legacy hotspots in GB-only cursor images
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: Complete async page flips from an ordered workqueue
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: Drop BO usecnt before releasing the old FB
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
Wentao Liang <vulab@iscas.ac.cn>
drm/vc4: Fix firmware reference leak in vc4_hvs_bind()
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
Erhan Bilgili <erhan.bilgili@gmail.com>
drm/amdgpu: Fix UserQ slot availability checks
Andrei Krautsou <an9949an@gmail.com>
drm/amdgpu: enable MGCG/FGCG/PERF_CLK for GC 11.0.2
Lijo Lazar <lijo.lazar@amd.com>
drm/amdgpu: Allow cancelling a requested NPS mode
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
Igor Paunovic <royalnet026@gmail.com>
accel/rocket: number the cores by devicetree position, not bind order
Sanjay Yadav <sanjay.kumar.yadav@intel.com>
drm/xe/query: Use ordered clock reads for engine cycles cpu_delta
Zongyao Bai <zongyao.bai@intel.com>
drm/xe/guc: Treat CT-disabled TLB invalidation as cancelled
Thomas Zimmermann <tzimmermann@suse.de>
drm/vblank: timer: Do not block within critical section
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
Joe Finzel <joe@sudmix.de>
drm/nouveau/gsp: only handle GSP interrupts routed to the host
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/ptl+: Add TypeC HPD pin selection for port B
Imre Deak <imre.deak@intel.com>
drm/i915/pps: Reset PPS state after TypeC port init on resume
Imre Deak <imre.deak@intel.com>
drm/i915/pps: Hold a TypeC link reference for PPS VDD
Imre Deak <imre.deak@intel.com>
drm/i915/dp_aux: Take the TypeC port lock after the PPS lock
Jouni Högander <jouni.hogander@intel.com>
drm/i915/display: Flush the fbdev frontbuffer
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
Sechang Lim <rhkrqnwk98@gmail.com>
bpf: Reject kernel threads in bpf_task_work_schedule()
Marco Giunta <marco_giunta@outlook.it>
ASoC: aw88399: fix register used to disable I2S TX
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
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
Florian Fainelli <florian.fainelli@broadcom.com>
net: dsa: tag_brcm: fix link-local detection with a prepended tag
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
Jiayuan Chen <jiayuan.chen@linux.dev>
tcp: fix negative sk_forward_alloc after MSG_ZEROCOPY append
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: Require CAP_PERFMON to read pinned maps with special fields
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: Limit reads of variables of the kernel
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: Refuse mmap() of a part of an arena
Alexei Starovoitov <ast@kernel.org>
bpf: Check the attach type when a cgroup link gets another program
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: Do not trust the neighbour of tp_btf/neigh_create
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()
Jan Schär <jan@jschaer.ch>
gpiolib: fix inverted trace values in gpiod_get_array_value()
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
Alexei Starovoitov <ast@kernel.org>
bpf: net_sched: Defer bpf_kfree_skb() to irq_work with irqs off
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
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: clear stale state when creating an ARL entry
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
Jakub Kicinski <kuba@kernel.org>
eth: bnxt_en: restore Tx coalescing after re-allocating the completion ring
Jakub Kicinski <kuba@kernel.org>
eth: bnxt_en: restore Rx coalescing after re-allocating the completion ring
Saurabh Sengar <ssengar@linux.microsoft.com>
workqueue: Skip redundant unbound updates during CPU bringup
Marco Giunta <marco_giunta@outlook.it>
ASoC: aw88166: fix backup restoring the RE value instead of saving it
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
Rodrigo Vivi <rodrigo.vivi@intel.com>
drm/xe/hwmon: Unregister hwmon before the device is unplugged
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: intel_pstate: Use dedicated lock in set_power_ctl_ee_state()
Ard Biesheuvel <ardb@kernel.org>
efi/tpm: Allocate the event log from EFI loader data again
Ard Biesheuvel <ardb@kernel.org>
x86/efi: Disregard the INITRD and MEMATTR config tables after kexec
Karl Mehltretter <kmehltretter@gmail.com>
cgroup/rstat: disable preemption in css_rstat_updated()
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: fix incorrect task accounting on error during io_uring read
Caleb Sander Mateos <csander@purestorage.com>
io_uring/uring_cmd: avoid double indirect call in task work dispatch
Filipe Manana <fdmanana@suse.com>
btrfs: fix blocking allocation for nowait encoded reads of inline extents
Filipe Manana <fdmanana@suse.com>
btrfs: abort transaction on failure to update inode after hole punching
Filipe Manana <fdmanana@suse.com>
btrfs: fix double release of space when cloning compressed inline extent
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: zstd: fix UAF due to race between putting workspace and reclaim
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
Cheng Yongkang <teel4res@gmail.com>
btrfs: remove devid kobject when deleting a missing device
Hugo Sales <hugo@hsal.es>
cpufreq: intel_pstate: Refresh cpuinfo.max_freq when a CPU goes online
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: intel_pstate: Use mutex guard for driver locking
Stefan Ghetu <stefan.ghetu@nxp.com>
ASoC: fsl_asrc_m2m: allow only one task at a time per stream
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
Stefan Ghetu <stefan.ghetu@nxp.com>
ASoC: fsl_asrc_m2m: fix out-of-bounds write when draining the output FIFO
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
Yifan Feng <evanfengff@gmail.com>
tracing/fprobe: Do not let KASAN check the $stackN read
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
Dimitri Daskalakis <daskald@meta.com>
eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats()
Dimitri Daskalakis <daskald@meta.com>
eth: fbnic: skip disabled Tx rings when setting the queue NAPI
Yevgeny Kliteynik <kliteyn@nvidia.com>
net/mlx5: DR, Fix out-of-bounds write when sync to HW fails
Yevgeny Kliteynik <kliteyn@nvidia.com>
net/mlx5: HWS, Handle NULL in vport destination action creation
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
Jingxuan Xie <jingxuanxie@deeproute.ai>
af_packet: avoid waiting for TPACKET_V3 copies at retirement
chris@kode54.net <chris@kode54.net>
ALSA: usb-audio: Ignore trailing whitespace in quirk_flags
Takashi Iwai <tiwai@suse.de>
ALSA: pcm: Fix potential ABBA deadlock at snd_pcm_action_nonatomic()
Kiran K <kiran.k@intel.com>
Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init()
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
Mathias Krause <minipli@grsecurity.net>
HID: Intel-thc-hid: Fix REGMAP dependency
Tim Zimmermann <tim@linux4.de>
hid: intel-thc-hid: Select SGL_ALLOC
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
Thaison Phan <thaisonphan@google.com>
tcp: accecn: initialize AccECN fields in syncookie path
Thaison Phan <thaisonphan@google.com>
tcp: initialize ir_rmt_addr and ir_loc_addr in cookie_v6_check()
Tariq Toukan <tariqt@nvidia.com>
net/mlx5e: SHAMPO: Do not merge packets with different kTLS RX state
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
Alexander Duyck <alexanderduyck@fb.com>
fbnic: Wait for in-flight PTP timestamps before treating Tx as idle
Tianyi Gao <tianyi@cloudflare.com>
xsk: reject TX checksum requests that overflow skb->csum_start
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: hci_debugfs: Fix racy toggling of debugfs controlled flags
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_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
Miri Korenblit <miriam.rachel.korenblit@intel.com>
wifi: iwlwifi: mvm: correctly check the API version
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()
Rob Clark <robin.clark@oss.qualcomm.com>
drm/msm/gem: Clear nr_ops in lookup_ops() failure path
Rob Clark <robin.clark@oss.qualcomm.com>
drm/msm/gem: Decrement loop idx if handle lookup fails
Rob Clark <robin.clark@oss.qualcomm.com>
drm/msm/gem: Disallow nr_bos for VM_BIND contexts
Thomas Hellström <thomas.hellstrom@linux.intel.com>
drm/msm: Remove abuse of drm_exec internals
Rob Clark <robin.clark@oss.qualcomm.com>
drm/msm/gem: Fix VM_BIND range check
Hung-Chun Tseng <alan.tseng.cs@gmail.com>
reset: spacemit: Fix the RCPU2 PWM reset registers
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: Free mailbox state on mapping failure
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>
irqchip/gic-v3: Select HAVE_ARM_SMCCC_DISCOVERY only on arm64
Julian Braha <julianbraha@gmail.com>
firmware: smccc: Provide stubs for HAVE_ARM_SMCCC_DISCOVERY=n
David Cemin <dcemin@nvidia.com>
firmware: arm_ffa: Compare notify_id when looking up notifier callbacks
Geert Uytterhoeven <geert+renesas@glider.be>
firmware: arm_scmi: Update ARM_SCMI_HAVE_TRANSPORT rationale
Mario Limonciello <mario.limonciello@amd.com>
tpm: Call cmd_ready/go_idle for each command transmission
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
Jocelyn Falempe <jfalempe@redhat.com>
drm/ast: Handle framebuffer from dma-buf
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
Pan Chuang <panchuang@vivo.com>
iio: proximity: Remove redundant dev_err()/dev_err_probe()
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
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
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
Giuseppe Scrivano <giuseppe@scrivano.org>
ovl: follow lower to lowerdata redirects from any lower layer
Amir Goldstein <amir73il@gmail.com>
ovl: do not check the deferred lowerdata redirect on index lookup
Amir Goldstein <amir73il@gmail.com>
ovl: 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()
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
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
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()
Vishwaroop A <va@nvidia.com>
spi: tegra210-quad: Unmap DMA buffers on transfer timeout
Vishwaroop A <va@nvidia.com>
spi: tegra210-quad: Check hardware status on timeout
Vishwaroop A <va@nvidia.com>
spi: tegra210-quad: Refactor error handling into helper functions
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()
Brendan Jackman <jackmanb@google.com>
mm: rejig pageblock mask definitions
Josef Bacik <josef@toxicpanda.com>
mm: page_isolation: do not take slab pages for free
David Hildenbrand (Arm) <david@kernel.org>
mm/memory_hotplug: fix possible race in scan_movable_pages()
Kefeng Wang <wangkefeng.wang@huawei.com>
mm: page_isolation: introduce page_is_unmovable()
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
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
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: Fix updates of cached resolved frequency and index
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: Drop runtime PM handling from WDTDCR init
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
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
cpufreq: Force passing target frequency to driver during resume
Viresh Kumar <viresh.kumar@linaro.org>
cpufreq: Avoid redundant target() calls for unchanged limits
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
Cheng Yongkang <teel4res@gmail.com>
btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT
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
Masami Hiramatsu (Google) <mhiramat@kernel.org>
kprobes: Switch ftrace ops when adding probe with post_handler
Arnav Kapoor <kapoorarnav43@gmail.com>
iio: proximity: sx9360: fix sampling frequency write and available range
Kuba Piecuch <jpiecuch@google.com>
sched_ext: Read exit_kind before flushing in scx_flush_disable_work()
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
Longxuan Yu <ylong030@ucr.edu>
8021q: delete cleared egress QoS mappings
Longxuan Yu <ylong030@ucr.edu>
8021q: use RCU for egress QoS mappings
Alice Ryhl <aliceryhl@google.com>
rust_binder: push BR_TRANSACTION_COMPLETE before BR_FAILED_REPLY
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
Gregory Price (Meta) <gourry@gourry.net>
mm/mmzone: read each zoneref slot once when filtering by nodemask
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()
Jan Kara <jack@suse.cz>
ext4: fix transaction overflow during writeback
Jan Kara <jack@suse.cz>
ext4: teach ext4_meta_trans_blocks() about number of allocated extents
Eric Dumazet <edumazet@google.com>
net: flush skb_defer_nodes in dev_cpu_dead()
Jamal Hadi Salim <jhs@mojatatu.com>
net/sched: codel: bound the dropping loop per dequeue call
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
sctp: validate cookie AUTH state before use
Alexei Starovoitov <ast@kernel.org>
net: reject a negative TCP header offset in qdisc_pkt_len_segs_init()
Eric Dumazet <edumazet@kernel.org>
net: harden qdisc_pkt_len_segs_init() against malicious GSO packets
Cosmin Ratiu <cratiu@nvidia.com>
xfrm: Don't clobber inner headers when already set
Eric Dumazet <edumazet@google.com>
net: pull headers in qdisc_pkt_len_segs_init()
Eric Dumazet <edumazet@google.com>
net: init shinfo->gso_segs from qdisc_pkt_len_init()
Eric Dumazet <edumazet@google.com>
netlink: do not free nlk->groups while lockless readers can use it
Sabrina Dubroca <sd@queasysnail.net>
mpls: add seqcount to protect the platform_label{,s} pair
Chen-Yu Tsai <wenst@chromium.org>
drm/gem-dma: Support dedicated DMA device for allocation and mapping
-------------
Diffstat:
Documentation/arch/arm64/silicon-errata.rst | 4 +
Documentation/filesystems/overlayfs.rst | 24 +-
Documentation/trace/boottime-trace.rst | 8 +-
Makefile | 8 +-
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/cpufeature.c | 2 -
arch/arm64/kernel/machine_kexec.c | 7 +-
arch/arm64/kernel/probes/uprobes.c | 6 +
arch/arm64/kernel/relocate_kernel.S | 11 +-
arch/arm64/kernel/suspend.c | 23 +-
arch/arm64/kernel/vmlinux.lds.S | 5 +-
arch/arm64/mm/mmu.c | 3 +-
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/include/asm/pgalloc.h | 14 +-
arch/riscv/include/asm/pgtable-32.h | 4 +-
arch/riscv/include/asm/pgtable-64.h | 50 +--
arch/riscv/include/asm/pgtable.h | 4 +-
arch/riscv/include/asm/switch_to.h | 30 +-
arch/riscv/include/asm/vector.h | 2 +
arch/riscv/include/asm/vmalloc.h | 5 +-
arch/riscv/kernel/cpu.c | 4 +-
arch/riscv/kernel/efi.c | 2 +-
arch/riscv/kernel/entry.S | 6 +-
arch/riscv/kernel/kernel_mode_fpu.c | 4 +-
arch/riscv/kernel/probes/uprobes.c | 6 +
arch/riscv/kernel/signal.c | 2 +
arch/riscv/kernel/unaligned_access_speed.c | 4 +-
arch/riscv/mm/init.c | 105 +++---
arch/riscv/mm/kasan_init.c | 20 +-
arch/riscv/mm/pgtable.c | 4 +-
arch/riscv/mm/ptdump.c | 4 +-
arch/s390/appldata/appldata_base.c | 12 +-
arch/s390/kernel/cert_store.c | 108 ++++---
arch/x86/Kconfig | 2 +-
arch/x86/Makefile | 1 +
arch/x86/kernel/apic/msi.c | 2 +-
arch/x86/kernel/cpu/mce/core.c | 18 +-
arch/x86/kernel/uprobes.c | 15 +
arch/x86/platform/efi/efi.c | 34 ++
arch/x86/platform/efi/quirks.c | 4 -
block/blk-iocost.c | 3 +-
block/ioctl.c | 19 +-
drivers/accel/rocket/rocket_core.h | 4 +
drivers/accel/rocket/rocket_drv.c | 96 +++---
drivers/accel/rocket/rocket_drv.h | 13 +-
drivers/accel/rocket/rocket_gem.c | 33 +-
drivers/accel/rocket/rocket_gem.h | 4 +-
drivers/accel/rocket/rocket_job.c | 6 +-
drivers/accel/rocket/rocket_job.h | 2 +-
drivers/acpi/cppc_acpi.c | 9 +
drivers/acpi/device_pm.c | 23 +-
drivers/acpi/glue.c | 8 +-
drivers/android/binder/error.rs | 1 -
drivers/android/binder/thread.rs | 44 ++-
drivers/ata/libata-core.c | 3 +
drivers/ata/libata-scsi.c | 2 +-
drivers/block/ublk_drv.c | 22 +-
drivers/bluetooth/btintel_pcie.c | 11 +-
drivers/bluetooth/btusb.c | 10 +-
drivers/bluetooth/hci_qca.c | 1 +
drivers/char/tpm/tpm-chip.c | 24 --
drivers/char/tpm/tpm-interface.c | 22 ++
drivers/comedi/drivers/comedi_bond.c | 24 +-
drivers/cpufreq/cppc_cpufreq.c | 14 +-
drivers/cpufreq/cpufreq.c | 81 +++--
drivers/cpufreq/intel_pstate.c | 151 +++++----
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_ffa/driver.c | 11 +-
drivers/firmware/arm_scmi/notify.c | 4 +-
drivers/firmware/arm_scmi/transports/Kconfig | 2 +-
drivers/firmware/arm_scmi/transports/mailbox.c | 7 +-
.../firmware/arm_scmi/vendors/imx/imx-sm-misc.c | 16 +-
drivers/firmware/efi/libstub/tpm.c | 2 +-
drivers/gpio/gpio-davinci.c | 4 +-
drivers/gpio/gpio-ljca.c | 11 +-
drivers/gpio/gpio-mlxbf2.c | 29 +-
drivers/gpio/gpio-mvebu.c | 24 +-
drivers/gpio/gpio-virtio.c | 13 +-
drivers/gpio/gpiolib-cdev.c | 95 +++---
drivers/gpio/gpiolib.c | 64 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 13 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 52 ++-
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 4 +
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 33 +-
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 7 +-
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 13 +
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/amdgpu_dm/amdgpu_dm.c | 34 +-
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/display/drm_bridge_connector.c | 11 +-
drivers/gpu/drm/drm_gem_dma_helper.c | 21 +-
drivers/gpu/drm/drm_syncobj.c | 45 ++-
drivers/gpu/drm/drm_vblank.c | 34 +-
drivers/gpu/drm/gud/gud_drv.c | 13 +-
drivers/gpu/drm/i915/display/intel_ddi.c | 10 +-
drivers/gpu/drm/i915/display/intel_display.c | 32 +-
drivers/gpu/drm/i915/display/intel_display.h | 1 +
drivers/gpu/drm/i915/display/intel_dp_aux.c | 39 ++-
drivers/gpu/drm/i915/display/intel_dsb.c | 16 +-
drivers/gpu/drm/i915/display/intel_fbdev.c | 13 +-
drivers/gpu/drm/i915/display/intel_pps.c | 14 +
drivers/gpu/drm/i915/display/intel_psr.c | 34 +-
drivers/gpu/drm/i915/display/intel_tc.c | 9 +-
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/msm/msm_gem.h | 1 +
drivers/gpu/drm/msm/msm_gem_submit.c | 9 +-
drivers/gpu/drm/msm/msm_gem_vma.c | 11 +-
.../gpu/drm/nouveau/include/nvkm/engine/falcon.h | 1 +
drivers/gpu/drm/nouveau/nouveau_display.c | 11 +-
drivers/gpu/drm/nouveau/nouveau_sched.c | 6 +-
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga100.c | 1 +
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c | 1 +
.../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c | 4 +-
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/tu102.c | 1 +
drivers/gpu/drm/radeon/radeon_atombios.c | 22 +-
drivers/gpu/drm/radeon/radeon_atpx_handler.c | 13 +-
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 2 +-
drivers/gpu/drm/scheduler/sched_entity.c | 17 +-
drivers/gpu/drm/vc4/vc4_bo.c | 43 ++-
drivers/gpu/drm/vc4/vc4_crtc.c | 136 ++++----
drivers/gpu/drm/vc4/vc4_drv.h | 21 +-
drivers/gpu/drm/vc4/vc4_gem.c | 20 +-
drivers/gpu/drm/vc4/vc4_hvs.c | 18 +-
drivers/gpu/drm/vc4/vc4_irq.c | 37 ++-
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/vmwgfx/vmwgfx_bo.c | 3 +
drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.c | 166 +++++++---
drivers/gpu/drm/vmwgfx/vmwgfx_cursor_plane.h | 4 +
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 208 ++++++++++++
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 11 +-
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 55 ++--
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 +-
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 21 +-
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 1 +
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_streamoutput.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 28 +-
drivers/gpu/drm/vmwgfx/vmwgfx_validation.h | 13 +-
drivers/gpu/drm/xe/xe_bo.c | 7 +-
drivers/gpu/drm/xe/xe_device.c | 32 +-
drivers/gpu/drm/xe/xe_device.h | 1 +
drivers/gpu/drm/xe/xe_dma_buf.c | 30 +-
drivers/gpu/drm/xe/xe_guc_tlb_inval.c | 14 +-
drivers/gpu/drm/xe/xe_hwmon.c | 22 +-
drivers/gpu/drm/xe/xe_hwmon.h | 2 +
drivers/gpu/drm/xe/xe_query.c | 6 +-
drivers/gpu/drm/xe/xe_shrinker.c | 81 +++--
drivers/gpu/drm/xe/xe_sync.c | 33 +-
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/hid/intel-thc-hid/Kconfig | 2 +
drivers/hwmon/ads7871.c | 4 +-
drivers/hwmon/dell-smm-hwmon.c | 9 +
drivers/hwmon/hwmon.c | 7 +-
drivers/hwmon/nct6775-core.c | 22 +-
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/humidity/hid-sensor-humidity.c | 14 +-
drivers/iio/proximity/as3935.c | 4 +-
drivers/iio/proximity/d3323aa.c | 2 +-
drivers/iio/proximity/hx9023s.c | 16 +-
drivers/iio/proximity/irsd200.c | 2 +-
drivers/iio/proximity/mb1232.c | 4 +-
drivers/iio/proximity/srf04.c | 4 +-
drivers/iio/proximity/sx9360.c | 29 +-
drivers/iio/proximity/sx_common.c | 2 +-
drivers/iio/proximity/vcnl3020.c | 6 +-
drivers/iio/proximity/vl53l0x-i2c.c | 4 +-
drivers/iio/temperature/hid-sensor-temperature.c | 14 +-
drivers/infiniband/hw/ionic/ionic_lif_cfg.c | 2 +-
drivers/infiniband/hw/ionic/ionic_res.h | 23 +-
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 | 5 +
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/iommu/iommufd/pages.c | 15 +-
drivers/irqchip/Kconfig | 2 +-
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.c | 2 +-
drivers/md/dm.h | 18 +-
drivers/memory/tegra/tegra186.c | 1 +
drivers/memory/tegra/tegra210-emc-core.c | 16 +-
drivers/net/dsa/b53/b53_common.c | 209 +++++++++---
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/bnxt/bnxt.c | 47 +++
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 19 +-
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 | 7 +-
drivers/net/ethernet/google/gve/gve_adminq.c | 4 +-
.../net/ethernet/google/gve/gve_buffer_mgmt_dqo.c | 4 +-
drivers/net/ethernet/google/gve/gve_main.c | 49 ++-
drivers/net/ethernet/google/gve/gve_rx.c | 8 +-
drivers/net/ethernet/google/gve/gve_utils.c | 12 +-
drivers/net/ethernet/google/gve/gve_utils.h | 2 +-
drivers/net/ethernet/intel/e1000/e1000_main.c | 3 +-
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 9 +-
drivers/net/ethernet/intel/iavf/iavf_adminq.c | 1 +
drivers/net/ethernet/intel/iavf/iavf_main.c | 1 +
drivers/net/ethernet/intel/iavf/iavf_ptp.c | 12 +
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 +-
.../mellanox/mlx5/core/en_accel/en_accel.h | 5 +-
.../mellanox/mlx5/core/en_accel/ktls_txrx.h | 21 ++
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 3 +-
.../mellanox/mlx5/core/steering/hws/fs_hws.c | 2 +
.../mellanox/mlx5/core/steering/sws/dr_icm_pool.c | 32 +-
drivers/net/ethernet/meta/fbnic/fbnic_csr.h | 3 +-
drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c | 3 +
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 89 ++++--
drivers/net/ethernet/microchip/encx24j600.c | 3 +-
drivers/net/ethernet/qualcomm/qca_spi.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 3 +-
.../net/ethernet/stmicro/stmmac/dwmac1000_dma.c | 8 +
.../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 | 18 +-
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/intel/iwlwifi/mvm/ops.c | 12 +-
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 | 11 +-
drivers/nvme/host/ioctl.c | 7 +-
drivers/nvme/host/multipath.c | 7 +
drivers/nvme/host/nvme.h | 13 +-
drivers/nvme/host/sysfs.c | 3 +
drivers/nvme/host/tcp.c | 172 ++++++++--
drivers/nvme/target/admin-cmd.c | 51 ++-
drivers/nvme/target/fabrics-cmd.c | 3 +
drivers/nvme/target/fc.c | 13 +-
drivers/nvme/target/fcloop.c | 2 +
drivers/nvme/target/io-cmd-file.c | 47 ++-
drivers/nvme/target/loop.c | 1 +
drivers/nvme/target/pr.c | 10 +-
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/reset/reset-spacemit.c | 18 +-
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 | 164 +++++++---
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/ufs/core/ufs-sysfs.c | 97 ++++--
drivers/ufs/core/ufs_bsg.c | 4 +-
drivers/ufs/core/ufshcd-priv.h | 8 +-
drivers/ufs/core/ufshcd.c | 133 ++++----
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_acpi.c | 34 ++
drivers/vhost/net.c | 2 +-
drivers/vhost/vhost.c | 12 +
drivers/video/console/vgacon.c | 2 +
drivers/video/fbdev/aty/radeon_base.c | 3 +
drivers/video/fbdev/core/fbcon.c | 41 ++-
drivers/video/fbdev/core/fbcon.h | 1 +
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/w1/slaves/w1_therm.c | 8 +
drivers/watchdog/npcm_wdt.c | 19 +-
drivers/watchdog/rzg2l_wdt.c | 4 +-
drivers/watchdog/rzv2h_wdt.c | 12 +-
drivers/watchdog/stm32_iwdg.c | 29 +-
fs/btrfs/btrfs_inode.h | 6 +
fs/btrfs/delayed-inode.c | 3 +-
fs/btrfs/direct-io.c | 22 +-
fs/btrfs/fiemap.c | 2 +
fs/btrfs/file.c | 7 +-
fs/btrfs/inode.c | 4 +-
fs/btrfs/ioctl.c | 15 +-
fs/btrfs/reflink.c | 60 +++-
fs/btrfs/send.c | 98 +++++-
fs/btrfs/volumes.c | 9 +-
fs/btrfs/zstd.c | 8 +-
fs/crypto/keysetup.c | 14 +-
fs/direct-io.c | 15 +-
fs/ext4/ext4.h | 2 +-
fs/ext4/extents.c | 2 +-
fs/ext4/inline.c | 6 +
fs/ext4/inode.c | 36 +--
fs/ext4/move_extent.c | 1 +
fs/ext4/xattr.c | 12 +
fs/fuse/dev.c | 4 +-
fs/fuse/dev_uring.c | 7 +-
fs/fuse/dir.c | 12 +-
fs/fuse/file.c | 5 +
fs/fuse/readdir.c | 27 +-
fs/fuse/virtio_fs.c | 9 +-
fs/fuse/xattr.c | 2 +-
fs/hugetlbfs/inode.c | 2 +-
fs/jbd2/journal.c | 3 +
fs/nfs/flexfilelayout/flexfilelayout.c | 12 +
fs/nfs/flexfilelayout/flexfilelayout.h | 1 +
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/dir.c | 12 +-
fs/overlayfs/namei.c | 352 ++++++++++++---------
fs/overlayfs/overlayfs.h | 15 +-
fs/overlayfs/params.c | 45 ++-
fs/overlayfs/params.h | 2 +
fs/overlayfs/super.c | 17 +-
fs/smb/client/cifs_fs_sb.h | 2 +
fs/smb/client/cifsacl.c | 6 +-
fs/smb/client/cifsfs.c | 20 +-
fs/smb/client/cifsglob.h | 6 +
fs/smb/client/cifsproto.h | 2 +
fs/smb/client/dfs.c | 77 ++++-
fs/smb/client/file.c | 139 +++++++-
fs/smb/client/misc.c | 6 +-
fs/smb/client/netmisc.c | 3 +-
fs/smb/client/readdir.c | 3 +-
fs/smb/client/smb2ops.c | 9 +-
fs/smb/client/smb2pdu.c | 123 ++++++-
fs/smb/client/smb2proto.h | 9 +
fs/smb/client/smb2transport.c | 7 +-
fs/smb/client/trace.h | 1 +
fs/smb/client/transport.c | 5 +
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/userfaultfd.c | 19 ++
fs/xfs/xfs_bmap_util.c | 11 +-
fs/xfs/xfs_rtalloc.c | 6 +-
fs/xfs/xfs_super.c | 2 +-
fs/zonefs/file.c | 9 +-
include/asm-generic/tlb.h | 4 +-
include/linux/arm-smccc.h | 7 +
include/linux/bpf.h | 31 +-
include/linux/cpufreq.h | 3 +
include/linux/efi.h | 3 +
include/linux/filter.h | 14 +-
include/linux/firmware/imx/sm.h | 6 +
include/linux/ftrace.h | 2 +-
include/linux/if_vlan.h | 25 +-
include/linux/iio/common/inv_sensors_timestamp.h | 43 +--
include/linux/io_uring/cmd.h | 22 +-
include/linux/io_uring_types.h | 1 -
include/linux/kasan.h | 15 +-
include/linux/key.h | 4 +-
include/linux/maple_tree.h | 48 +--
include/linux/mm.h | 128 ++++++--
include/linux/net.h | 2 +-
include/linux/nsc_gpio.h | 2 +-
include/linux/page-isolation.h | 2 +
include/linux/pageblock-flags.h | 6 +-
include/linux/perf_event.h | 1 +
include/linux/pgtable.h | 24 ++
include/linux/skbuff.h | 2 +
include/linux/tcp.h | 6 +-
include/linux/uprobes.h | 5 +
include/linux/userfaultfd_k.h | 5 +
include/net/ax25.h | 1 +
include/net/bluetooth/hci_core.h | 9 +-
include/net/bluetooth/l2cap.h | 1 +
include/net/codel.h | 5 +
include/net/codel_impl.h | 16 +-
include/net/dropreason-core.h | 9 +
include/net/inet_hashtables.h | 2 +
include/net/ip_vs.h | 2 +-
include/net/net_namespace.h | 1 +
include/net/netns/mpls.h | 2 +
include/net/netrom.h | 1 +
include/net/request_sock.h | 12 +-
include/net/rose.h | 1 +
include/net/sctp/auth.h | 3 +
include/scsi/scsi_proto.h | 3 +
include/trace/events/hugetlbfs.h | 2 +-
include/vdso/math64.h | 13 +-
io_uring/uring_cmd.c | 18 +-
kernel/bpf/arena.c | 13 +-
kernel/bpf/btf.c | 30 +-
kernel/bpf/cgroup.c | 25 +-
kernel/bpf/core.c | 12 +-
kernel/bpf/helpers.c | 52 ++-
kernel/bpf/inode.c | 10 +-
kernel/bpf/syscall.c | 33 +-
kernel/bpf/verifier.c | 39 ++-
kernel/cgroup/cpuset.c | 21 +-
kernel/cgroup/rstat.c | 1 +
kernel/dma/coherent.c | 11 +-
kernel/dma/pool.c | 11 +-
kernel/dma/swiotlb.c | 35 +-
kernel/events/core.c | 44 ++-
kernel/events/uprobes.c | 9 +
kernel/futex/core.c | 10 +-
kernel/kprobes.c | 55 +++-
kernel/rcu/tree_nocb.h | 6 +-
kernel/sched/core.c | 8 +-
kernel/sched/core_sched.c | 3 +-
kernel/sched/ext.c | 146 +++++----
kernel/sched/sched.h | 28 +-
kernel/trace/bpf_trace.c | 14 +-
kernel/trace/fgraph.c | 45 +--
kernel/trace/ring_buffer.c | 11 +-
kernel/trace/trace.c | 8 +-
kernel/trace/trace.h | 2 +
kernel/trace/trace_events_filter.c | 98 ++++--
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 | 59 +++-
kernel/trace/trace_recursion_record.c | 17 +-
kernel/vhost_task.c | 9 +
kernel/workqueue.c | 9 +
lib/fault-inject.c | 8 +-
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 | 35 +-
mm/gup.c | 32 +-
mm/huge_memory.c | 64 +++-
mm/hugetlb.c | 13 +-
mm/hugetlb_vmemmap.c | 36 +--
mm/internal.h | 25 +-
mm/kasan/common.c | 13 +-
mm/kasan/generic.c | 17 +-
mm/kasan/kasan.h | 34 +-
mm/kasan/kasan_test_c.c | 139 ++++++++
mm/khugepaged.c | 6 +
mm/memfd.c | 7 +
mm/memory.c | 46 ++-
mm/memory_hotplug.c | 18 +-
mm/mempolicy.c | 13 +-
mm/migrate.c | 21 ++
mm/mmu_gather.c | 10 +-
mm/mmzone.c | 10 +-
mm/page_alloc.c | 215 ++++++++++---
mm/page_isolation.c | 194 ++++++------
mm/rmap.c | 2 +-
mm/shmem.c | 7 +-
mm/slub.c | 13 +-
mm/swap.c | 26 ++
mm/swapfile.c | 5 +
mm/userfaultfd.c | 49 ++-
mm/vma.c | 28 +-
net/8021q/vlan_dev.c | 45 +--
net/8021q/vlan_netlink.c | 10 +-
net/8021q/vlanproc.c | 12 +-
net/ax25/af_ax25.c | 9 +
net/ax25/ax25_std_timer.c | 11 +-
net/ax25/ax25_subr.c | 27 ++
net/bluetooth/hci_conn.c | 105 ++++--
net/bluetooth/hci_core.c | 83 ++++-
net/bluetooth/hci_debugfs.c | 32 +-
net/bluetooth/hci_event.c | 9 +-
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 | 58 +++-
net/bridge/br_input.c | 18 +-
net/core/dev.c | 188 ++++++++---
net/core/dev.h | 2 +
net/core/filter.c | 23 +-
net/core/skbuff.c | 45 ++-
net/core/skmsg.c | 4 +-
net/core/sock.c | 4 +-
net/core/sock_reuseport.c | 16 +-
net/dsa/tag_brcm.c | 7 +-
net/ieee802154/socket.c | 4 +
net/ipv4/af_inet.c | 5 +-
net/ipv4/inet_connection_sock.c | 29 +-
net/ipv4/ip_fragment.c | 2 +
net/ipv4/ip_input.c | 6 +
net/ipv4/syncookies.c | 7 +
net/ipv4/tcp.c | 2 +
net/ipv4/tcp_input.c | 2 +-
net/ipv6/af_inet6.c | 8 +-
net/ipv6/calipso.c | 5 +-
net/ipv6/ip6_fib.c | 14 +-
net/ipv6/ip6_input.c | 4 +
net/ipv6/ip6_offload.c | 8 +
net/ipv6/ip6mr.c | 2 +-
net/ipv6/ipv6_sockglue.c | 95 ------
net/ipv6/mcast.c | 10 +-
net/ipv6/mcast_snoop.c | 3 +-
net/ipv6/route.c | 51 +--
net/ipv6/syncookies.c | 6 +
net/ipv6/udp.c | 7 +-
net/mac802154/llsec.c | 2 +
net/mpls/af_mpls.c | 37 ++-
net/mptcp/protocol.c | 3 +-
net/netfilter/ipvs/ip_vs_conn.c | 6 +-
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/netlink/af_netlink.c | 42 ++-
net/netlink/diag.c | 18 +-
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/packet/af_packet.c | 40 ++-
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/sched/bpf_qdisc.c | 27 ++
net/sctp/auth.c | 75 +++++
net/sctp/ipv6.c | 5 +-
net/sctp/sm_make_chunk.c | 3 +
net/sctp/socket.c | 12 +-
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/xdp/xsk.c | 3 +-
net/xfrm/xfrm_interface_core.c | 8 +
net/xfrm/xfrm_output.c | 20 +-
rust/Makefile | 2 +-
rust/kernel/iov.rs | 2 +-
rust/kernel/str.rs | 4 +-
security/commoncap.c | 45 +--
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/landlock/errata/abi-4.h | 21 ++
security/landlock/ruleset.h | 13 +-
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/hda/codecs/realtek/alc269.c | 7 +-
sound/hda/codecs/side-codecs/tas2781_hda_spi.c | 1 +
sound/hda/controllers/intel.c | 5 +-
sound/soc/amd/acp/acp-legacy-common.c | 5 +-
sound/soc/codecs/aw88166.c | 2 +-
sound/soc/codecs/aw88399-lib.c | 2 +-
sound/soc/codecs/wm8962.c | 2 +-
sound/soc/fsl/fsl_asrc.c | 22 ++
sound/soc/fsl/fsl_asrc_m2m.c | 30 +-
sound/soc/fsl/fsl_easrc.c | 10 +
sound/soc/qcom/qdsp6/audioreach.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 +-
sound/usb/quirks.c | 2 +-
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/radix-tree/maple.c | 13 +-
tools/testing/selftests/cgroup/test_cpuset_prs.sh | 7 +
.../selftests/damon/sysfs_memcg_path_leak.sh | 3 +
.../selftests/drivers/s390x/uvdevice/Makefile | 19 +-
tools/testing/selftests/landlock/fs_test.c | 54 ++++
tools/testing/shared/maple-shared.h | 33 ++
tools/testing/vma/vma_internal.h | 4 +
682 files changed, 10277 insertions(+), 4044 deletions(-)
^ permalink raw reply [flat|nested] 139+ messages in thread
* [PATCH 6.18 001/703] drm/gem-dma: Support dedicated DMA device for allocation and mapping
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 002/703] mpls: add seqcount to protect the platform_label{,s} pair Greg Kroah-Hartman
` (136 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Zimmermann,
AngeloGioacchino Del Regno, Chen-Yu Tsai, Maíra Canal,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <wenst@chromium.org>
[ Upstream commit a9da24732aaa80d631bffc8a1390836d4b896690 ]
Support for a dedicated DMA device for prime imports was added in commit
143ec8d3f939 ("drm/prime: Support dedicated DMA device for dma-buf imports").
This allowed the DRM driver to provide a dedicated DMA device when its
own underlying device was not capable of DMA, for example when it is a
USB device (the original target) or a virtual device. The latter case is
common on embedded SoCs, on which the display pipeline is composed of
various fixed function blocks, and the DRM device is simply a made-up
device, an address space managing the routing between the blocks, or
whichever block the implementor thought made sense at the time. The
point is that the chosen device is often not the actual device doing
the DMA. Various drivers have used workarounds or reimplemented the
GEM DMA helpers to get the DMA addresses and IOMMUs to work correctly.
Add support for the dedicated DMA device to the GEM DMA helpers.
No existing driver currently uses the GEM DMA helpers and calls
drm_dev_set_dma_dev() to set a dedicated DMA device, so no existing
users should be affected.
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260311094929.3393338-3-wenst@chromium.org
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_gem_dma_helper.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c
index 4f0320df858f8..55246a59e8bb8 100644
--- a/drivers/gpu/drm/drm_gem_dma_helper.c
+++ b/drivers/gpu/drm/drm_gem_dma_helper.c
@@ -144,12 +144,13 @@ struct drm_gem_dma_object *drm_gem_dma_create(struct drm_device *drm,
return dma_obj;
if (dma_obj->map_noncoherent) {
- dma_obj->vaddr = dma_alloc_noncoherent(drm->dev, size,
+ dma_obj->vaddr = dma_alloc_noncoherent(drm_dev_dma_dev(drm),
+ size,
&dma_obj->dma_addr,
DMA_TO_DEVICE,
GFP_KERNEL | __GFP_NOWARN);
} else {
- dma_obj->vaddr = dma_alloc_wc(drm->dev, size,
+ dma_obj->vaddr = dma_alloc_wc(drm_dev_dma_dev(drm), size,
&dma_obj->dma_addr,
GFP_KERNEL | __GFP_NOWARN);
}
@@ -234,12 +235,14 @@ void drm_gem_dma_free(struct drm_gem_dma_object *dma_obj)
drm_prime_gem_destroy(gem_obj, dma_obj->sgt);
} else if (dma_obj->vaddr) {
if (dma_obj->map_noncoherent)
- dma_free_noncoherent(gem_obj->dev->dev, dma_obj->base.size,
+ dma_free_noncoherent(drm_dev_dma_dev(gem_obj->dev),
+ dma_obj->base.size,
dma_obj->vaddr, dma_obj->dma_addr,
DMA_TO_DEVICE);
else
- dma_free_wc(gem_obj->dev->dev, dma_obj->base.size,
- dma_obj->vaddr, dma_obj->dma_addr);
+ dma_free_wc(drm_dev_dma_dev(gem_obj->dev),
+ dma_obj->base.size, dma_obj->vaddr,
+ dma_obj->dma_addr);
}
drm_gem_object_release(gem_obj);
@@ -428,7 +431,7 @@ struct sg_table *drm_gem_dma_get_sg_table(struct drm_gem_dma_object *dma_obj)
if (!sgt)
return ERR_PTR(-ENOMEM);
- ret = dma_get_sgtable(obj->dev->dev, sgt, dma_obj->vaddr,
+ ret = dma_get_sgtable(drm_dev_dma_dev(obj->dev), sgt, dma_obj->vaddr,
dma_obj->dma_addr, obj->size);
if (ret < 0)
goto out;
@@ -535,12 +538,12 @@ int drm_gem_dma_mmap(struct drm_gem_dma_object *dma_obj, struct vm_area_struct *
if (dma_obj->map_noncoherent) {
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
- ret = dma_mmap_pages(dma_obj->base.dev->dev,
+ ret = dma_mmap_pages(drm_dev_dma_dev(dma_obj->base.dev),
vma, vma->vm_end - vma->vm_start,
virt_to_page(dma_obj->vaddr));
} else {
- ret = dma_mmap_wc(dma_obj->base.dev->dev, vma, dma_obj->vaddr,
- dma_obj->dma_addr,
+ ret = dma_mmap_wc(drm_dev_dma_dev(dma_obj->base.dev), vma,
+ dma_obj->vaddr, dma_obj->dma_addr,
vma->vm_end - vma->vm_start);
}
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 002/703] mpls: add seqcount to protect the platform_label{,s} pair
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 001/703] drm/gem-dma: Support dedicated DMA device for allocation and mapping Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 003/703] netlink: do not free nlk->groups while lockless readers can use it Greg Kroah-Hartman
` (135 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Tan, Yifan Wu, Juefei Pu,
Xin Liu, Sabrina Dubroca, Jakub Kicinski, Artem Dinaburg,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sabrina Dubroca <sd@queasysnail.net>
[ Upstream commit 629ec78ef8608d955ce217880cdc3e1873af3a15 ]
The RCU-protected codepaths (mpls_forward, mpls_dump_routes) can have
an inconsistent view of platform_labels vs platform_label in case of a
concurrent resize (resize_platform_label_table, under
platform_mutex). This can lead to OOB accesses.
This patch adds a seqcount, so that we get a consistent snapshot.
Note that mpls_label_ok is also susceptible to this, so the check
against RTA_DST in rtm_to_route_config, done outside platform_mutex,
is not sufficient. This value gets passed to mpls_label_ok once more
in both mpls_route_add and mpls_route_del, so there is no issue, but
that additional check must not be removed.
Reported-by: Yuan Tan <tanyuan98@outlook.com>
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Fixes: 7720c01f3f590 ("mpls: Add a sysctl to control the size of the mpls label table")
Fixes: dde1b38e873c ("mpls: Convert mpls_dump_routes() to RCU.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/cd8fca15e3eb7e212b094064cd83652e20fd9d31.1774284088.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Backport to 6.18.y: 6.18.y has neither the per-netns platform_mutex
(upstream e833eb25161a) nor the RCU conversion of mpls_dump_routes()
(upstream dde1b38e873c); resize_platform_label_table() is serialized
by RTNL. Use a plain seqcount_t instead of seqcount_mutex_t and
disable preemption explicitly around the write section, since
local_bh_disable() does not do so on PREEMPT_RT. Keep
rcu_dereference_rtnl() in the helper because mpls_getroute() reaches
it under RTNL without rcu_read_lock(). mpls_dump_routes() still runs
under RTNL, so it is left unchanged. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netns/mpls.h | 2 ++
net/mpls/af_mpls.c | 37 ++++++++++++++++++++++++++++++-------
2 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/include/net/netns/mpls.h b/include/net/netns/mpls.h
index 19ad2574b267c..9b83b7f43d83b 100644
--- a/include/net/netns/mpls.h
+++ b/include/net/netns/mpls.h
@@ -7,6 +7,7 @@
#define __NETNS_MPLS_H__
#include <linux/types.h>
+#include <linux/seqlock.h>
struct mpls_route;
struct ctl_table_header;
@@ -16,6 +17,7 @@ struct netns_mpls {
int default_ttl;
size_t platform_labels;
struct mpls_route __rcu * __rcu *platform_label;
+ seqcount_t platform_label_seq;
struct ctl_table_header *ctl;
};
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 608c43a4602d6..9ed136931c4f1 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -75,16 +75,31 @@ static void rtmsg_lfib(int event, u32 label, struct mpls_route *rt,
struct nlmsghdr *nlh, struct net *net, u32 portid,
unsigned int nlm_flags);
+static struct mpls_route __rcu **mpls_platform_label_rcu(struct net *net, size_t *platform_labels)
+{
+ struct mpls_route __rcu **platform_label;
+ unsigned int sequence;
+
+ do {
+ sequence = read_seqcount_begin(&net->mpls.platform_label_seq);
+ platform_label = rcu_dereference_rtnl(net->mpls.platform_label);
+ *platform_labels = net->mpls.platform_labels;
+ } while (read_seqcount_retry(&net->mpls.platform_label_seq, sequence));
+
+ return platform_label;
+}
+
static struct mpls_route *mpls_route_input_rcu(struct net *net, unsigned index)
{
- struct mpls_route *rt = NULL;
+ struct mpls_route __rcu **platform_label;
+ size_t platform_labels;
- if (index < net->mpls.platform_labels) {
- struct mpls_route __rcu **platform_label =
- rcu_dereference_rtnl(net->mpls.platform_label);
- rt = rcu_dereference_rtnl(platform_label[index]);
- }
- return rt;
+ platform_label = mpls_platform_label_rcu(net, &platform_labels);
+
+ if (index >= platform_labels)
+ return NULL;
+
+ return rcu_dereference_rtnl(platform_label[index]);
}
bool mpls_output_possible(const struct net_device *dev)
@@ -2582,8 +2597,14 @@ static int resize_platform_label_table(struct net *net, size_t limit)
}
/* Update the global pointers */
+ local_bh_disable();
+ preempt_disable();
+ write_seqcount_begin(&net->mpls.platform_label_seq);
net->mpls.platform_labels = limit;
rcu_assign_pointer(net->mpls.platform_label, labels);
+ write_seqcount_end(&net->mpls.platform_label_seq);
+ preempt_enable();
+ local_bh_enable();
rtnl_unlock();
@@ -2664,6 +2685,8 @@ static int mpls_net_init(struct net *net)
struct ctl_table *table;
int i;
+ seqcount_init(&net->mpls.platform_label_seq);
+
net->mpls.platform_labels = 0;
net->mpls.platform_label = NULL;
net->mpls.ip_ttl_propagate = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 003/703] netlink: do not free nlk->groups while lockless readers can use it
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 001/703] drm/gem-dma: Support dedicated DMA device for allocation and mapping Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 002/703] mpls: add seqcount to protect the platform_label{,s} pair Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 004/703] net: init shinfo->gso_segs from qdisc_pkt_len_init() Greg Kroah-Hartman
` (134 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, James Burton, Eric Dumazet,
Jakub Kicinski, Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit ceac0de741bfb47ca255eee075257b3bb31f0651 ]
netlink_realloc_groups() uses krealloc() under netlink_table_grab().
Whenever NLGRPSZ(groups) lands in a different kmalloc bucket, the old
bitmap is freed immediately.
Two readers of nlk->groups / nlk->ngroups do not hold the netlink
table lock:
1) sk_diag_dump_groups(). Hashed (bound) sockets are dumped from the
rhashtable walk in __netlink_diag_dump(), which only holds RCU.
Only the mc_list part of the dump takes nl_table_lock.
2) netlink_native_seq_show() (/proc/net/netlink), whose walk has been
lockless since commit 21e4902aea80 ("netlink: Lockless lookup with
RCU grace period in socket release").
Both can read a freed buffer, and sk_diag_dump_groups() can also read
past the end of the old (smaller) buffer if it happens to load the old
@groups pointer together with the new @ngroups value, copying the
result into a NETLINK_DIAG_GROUPS attribute.
This is the same class of bug that commit f773608026ee ("netlink:
access nlk groups safely in netlink bind and getname") fixed for bind()
and getname(); these two readers were missed. Simply grabbing the table
lock in sk_diag_dump_groups() is not an option, because it is also
called with nl_table_lock already held from the mc_list section of the
dump.
Make the lockless readers safe instead:
- Allocate a new bitmap and free the old one after an RCU grace period,
instead of relying on the implicit kfree() done by krealloc().
- Publish @groups before @ngroups, both with release semantics, and have
the lockless readers load @ngroups first. A reader can then never pair
the new (bigger) size with the old (smaller) buffer, and a reader
picking up the new pointer while still seeing the old size is
guaranteed to see the initialized bitmap.
netlink_realloc_groups() is called from process context (bind() and
setsockopt()), so kfree_rcu_mightsleep() can be used, once the table
has been released.
Fixes: 21e4902aea80 ("netlink: Lockless lookup with RCU grace period in socket release")
Fixes: ad202074320c ("netlink: Use rhashtable walk interface in diag dump")
Reported-by: James Burton <jamesburton@meta.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260911160804.917099-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Backport to 6.18.y: context adjusted in netlink_native_seq_show(),
where 6.18.y prints sock_i_ino() with "%-8lu" instead of "%-8llu";
the code change is identical to upstream. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netlink/af_netlink.c | 42 ++++++++++++++++++++++++++++++++--------
net/netlink/diag.c | 20 +++++++++++++++----
2 files changed, 50 insertions(+), 12 deletions(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 9e1f64f18e3f8..83e5780afd4c1 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -923,9 +923,9 @@ netlink_update_subscriptions(struct sock *sk, unsigned int subscriptions)
static int netlink_realloc_groups(struct sock *sk)
{
+ unsigned long *new_groups, *old_groups = NULL;
struct netlink_sock *nlk = nlk_sk(sk);
unsigned int groups;
- unsigned long *new_groups;
int err = 0;
netlink_table_grab();
@@ -939,18 +939,37 @@ static int netlink_realloc_groups(struct sock *sk)
if (nlk->ngroups >= groups)
goto out_unlock;
- new_groups = krealloc(nlk->groups, NLGRPSZ(groups), GFP_ATOMIC);
- if (new_groups == NULL) {
+ /* Can not use krealloc(), because the old buffer might be freed
+ * immediately, while lockless readers (netlink diag dump and
+ * /proc/net/netlink) can still be looking at it.
+ */
+ new_groups = kzalloc(NLGRPSZ(groups), GFP_ATOMIC);
+ if (!new_groups) {
err = -ENOMEM;
goto out_unlock;
}
- memset((char *)new_groups + NLGRPSZ(nlk->ngroups), 0,
- NLGRPSZ(groups) - NLGRPSZ(nlk->ngroups));
+ old_groups = nlk->groups;
+ if (old_groups)
+ memcpy(new_groups, old_groups, NLGRPSZ(nlk->ngroups));
+
+ /* Publish the new bitmap and its content: pairs with the address
+ * dependency in lockless readers, which can pick up the new pointer
+ * while still seeing the old (smaller) nlk->ngroups.
+ */
+ smp_store_release(&nlk->groups, new_groups);
+
+ /* Then publish the new size: pairs with smp_load_acquire() from
+ * lockless readers, so that they can not read NLGRPSZ(new ngroups)
+ * bytes from the old buffer.
+ */
+ smp_store_release(&nlk->ngroups, groups);
- nlk->groups = new_groups;
- nlk->ngroups = groups;
out_unlock:
netlink_table_ungrab();
+
+ if (old_groups)
+ kfree_rcu_mightsleep(old_groups);
+
return err;
}
@@ -2719,12 +2738,19 @@ static int netlink_native_seq_show(struct seq_file *seq, void *v)
} else {
struct sock *s = v;
struct netlink_sock *nlk = nlk_sk(s);
+ const unsigned long *groups;
+
+ /* Lockless read : netlink_realloc_groups() can change
+ * nlk->groups under us. The old buffer is freed after an
+ * RCU grace period, and this walk is RCU protected.
+ */
+ groups = READ_ONCE(nlk->groups);
seq_printf(seq, "%pK %-3d %-10u %08x %-8d %-8d %-5d %-8d %-8u %-8lu\n",
s,
s->sk_protocol,
nlk->portid,
- nlk->groups ? (u32)nlk->groups[0] : 0,
+ groups ? (u32)groups[0] : 0,
sk_rmem_alloc_get(s),
sk_wmem_alloc_get(s),
READ_ONCE(nlk->cb_running),
diff --git a/net/netlink/diag.c b/net/netlink/diag.c
index b8e58132e8af1..16de6618e0bea 100644
--- a/net/netlink/diag.c
+++ b/net/netlink/diag.c
@@ -12,12 +12,24 @@
static int sk_diag_dump_groups(struct sock *sk, struct sk_buff *nlskb)
{
struct netlink_sock *nlk = nlk_sk(sk);
-
- if (nlk->groups == NULL)
+ unsigned long *groups;
+ unsigned int ngroups;
+
+ /* Hashed sockets are dumped from the rhashtable walk, which only
+ * holds rcu_read_lock(), while netlink_realloc_groups() can replace
+ * nlk->groups and nlk->ngroups at any time.
+ *
+ * Read nlk->ngroups first : this pairs with smp_store_release()
+ * from netlink_realloc_groups(), so that we can not use the new
+ * (bigger) size with the old (smaller) buffer. The old buffer is
+ * freed after an RCU grace period.
+ */
+ ngroups = smp_load_acquire(&nlk->ngroups);
+ groups = READ_ONCE(nlk->groups);
+ if (!groups)
return 0;
- return nla_put(nlskb, NETLINK_DIAG_GROUPS, NLGRPSZ(nlk->ngroups),
- nlk->groups);
+ return nla_put(nlskb, NETLINK_DIAG_GROUPS, NLGRPSZ(ngroups), groups);
}
static int sk_diag_put_flags(struct sock *sk, struct sk_buff *skb)
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 004/703] net: init shinfo->gso_segs from qdisc_pkt_len_init()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 003/703] netlink: do not free nlk->groups while lockless readers can use it Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 005/703] net: pull headers in qdisc_pkt_len_segs_init() Greg Kroah-Hartman
` (133 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Paolo Abeni,
Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit be1b70ab21cbe8f8bb8ecf39eb34880882252773 ]
Qdisc use shinfo->gso_segs for their pkts stats in bstats_update(),
but this field needs to be initialized for SKB_GSO_DODGY users.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251121083256.674562-3-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 7fb4c1967011 ("net: pull headers in qdisc_pkt_len_segs_init()")
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 91da33c29aa18..4c907f483ca42 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4138,7 +4138,7 @@ EXPORT_SYMBOL_GPL(validate_xmit_skb_list);
static void qdisc_pkt_len_init(struct sk_buff *skb)
{
- const struct skb_shared_info *shinfo = skb_shinfo(skb);
+ struct skb_shared_info *shinfo = skb_shinfo(skb);
qdisc_skb_cb(skb)->pkt_len = skb->len;
@@ -4179,6 +4179,7 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
if (payload <= 0)
return;
gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size);
+ shinfo->gso_segs = gso_segs;
}
qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 005/703] net: pull headers in qdisc_pkt_len_segs_init()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 004/703] net: init shinfo->gso_segs from qdisc_pkt_len_init() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 006/703] xfrm: Dont clobber inner headers when already set Greg Kroah-Hartman
` (132 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Joe Damato,
Jakub Kicinski, Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 7fb4c19670110f052c04e1ec1d2b953b9f4f57e4 ]
Most ndo_start_xmit() methods expects headers of gso packets
to be already in skb->head.
net/core/tso.c users are particularly at risk, because tso_build_hdr()
does a memcpy(hdr, skb->data, hdr_len);
qdisc_pkt_len_segs_init() already does a dissection of gso packets.
Use pskb_may_pull() instead of skb_header_pointer() to make
sure drivers do not have to reimplement this.
Some malicious packets could be fed, detect them so that we can
drop them sooner with a new SKB_DROP_REASON_SKB_BAD_GSO drop_reason.
Fixes: e876f208af18 ("net: Add a software TSO helper API")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260403221540.3297753-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Backport to 6.18.y: 6.18.y lacks the qdisc_pkt_len_segs_init() rename
with per-skb pkt_segs accounting and the preceding no-functional-change
cleanup 30e02ec3b4b6 ("net: qdisc_pkt_len_segs_init() cleanup"), so the
upstream result is applied to qdisc_pkt_len_init() without the pkt_segs
lines. In 6.18.y only __dev_queue_xmit() calls the function, so only
that caller handles the returned drop reason. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/dropreason-core.h | 3 ++
net/core/dev.c | 83 +++++++++++++++++++++--------------
2 files changed, 52 insertions(+), 34 deletions(-)
diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h
index 811057ae8ed25..ab36e3eded67e 100644
--- a/include/net/dropreason-core.h
+++ b/include/net/dropreason-core.h
@@ -79,6 +79,7 @@
FN(UNHANDLED_PROTO) \
FN(SKB_CSUM) \
FN(SKB_GSO_SEG) \
+ FN(SKB_BAD_GSO) \
FN(SKB_UCOPY_FAULT) \
FN(DEV_HDR) \
FN(DEV_READY) \
@@ -422,6 +423,8 @@ enum skb_drop_reason {
SKB_DROP_REASON_SKB_CSUM,
/** @SKB_DROP_REASON_SKB_GSO_SEG: gso segmentation error */
SKB_DROP_REASON_SKB_GSO_SEG,
+ /** @SKB_DROP_REASON_SKB_BAD_GSO: malicious gso packet. */
+ SKB_DROP_REASON_SKB_BAD_GSO,
/**
* @SKB_DROP_REASON_SKB_UCOPY_FAULT: failed to copy data from user space,
* e.g., via zerocopy_sg_from_iter() or skb_orphan_frags_rx()
diff --git a/net/core/dev.c b/net/core/dev.c
index 4c907f483ca42..792cc34fc218a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4136,53 +4136,63 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d
}
EXPORT_SYMBOL_GPL(validate_xmit_skb_list);
-static void qdisc_pkt_len_init(struct sk_buff *skb)
+static enum skb_drop_reason qdisc_pkt_len_init(struct sk_buff *skb)
{
struct skb_shared_info *shinfo = skb_shinfo(skb);
+ unsigned int hdr_len, tlen;
+ u16 gso_segs;
qdisc_skb_cb(skb)->pkt_len = skb->len;
+ if (!shinfo->gso_size)
+ return SKB_NOT_DROPPED_YET;
+
+ gso_segs = shinfo->gso_segs;
/* To get more precise estimation of bytes sent on wire,
* we add to pkt_len the headers size of all segments
*/
- if (shinfo->gso_size && skb_transport_header_was_set(skb)) {
- u16 gso_segs = shinfo->gso_segs;
- unsigned int hdr_len;
-
- /* mac layer + network layer */
- if (!skb->encapsulation)
- hdr_len = skb_transport_offset(skb);
- else
- hdr_len = skb_inner_transport_offset(skb);
- /* + transport layer */
- if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) {
- const struct tcphdr *th;
- struct tcphdr _tcphdr;
+ /* mac layer + network layer */
+ if (!skb->encapsulation) {
+ if (unlikely(!skb_transport_header_was_set(skb)))
+ return SKB_NOT_DROPPED_YET;
+ hdr_len = skb_transport_offset(skb);
+ } else {
+ hdr_len = skb_inner_transport_offset(skb);
+ }
+ /* + transport layer */
+ if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) {
+ const struct tcphdr *th;
- th = skb_header_pointer(skb, hdr_len,
- sizeof(_tcphdr), &_tcphdr);
- if (likely(th))
- hdr_len += __tcp_hdrlen(th);
- } else if (shinfo->gso_type & SKB_GSO_UDP_L4) {
- struct udphdr _udphdr;
+ if (!pskb_may_pull(skb, hdr_len + sizeof(struct tcphdr)))
+ return SKB_DROP_REASON_SKB_BAD_GSO;
- if (skb_header_pointer(skb, hdr_len,
- sizeof(_udphdr), &_udphdr))
- hdr_len += sizeof(struct udphdr);
- }
+ th = (const struct tcphdr *)(skb->data + hdr_len);
+ tlen = __tcp_hdrlen(th);
+ if (tlen < sizeof(*th))
+ return SKB_DROP_REASON_SKB_BAD_GSO;
+ hdr_len += tlen;
+ if (!pskb_may_pull(skb, hdr_len))
+ return SKB_DROP_REASON_SKB_BAD_GSO;
+ } else if (shinfo->gso_type & SKB_GSO_UDP_L4) {
+ if (!pskb_may_pull(skb, hdr_len + sizeof(struct udphdr)))
+ return SKB_DROP_REASON_SKB_BAD_GSO;
+ hdr_len += sizeof(struct udphdr);
+ }
- if (unlikely(shinfo->gso_type & SKB_GSO_DODGY)) {
- int payload = skb->len - hdr_len;
+ /* prior pskb_may_pull() might have changed skb->head. */
+ shinfo = skb_shinfo(skb);
+ if (unlikely(shinfo->gso_type & SKB_GSO_DODGY)) {
+ int payload = skb->len - hdr_len;
- /* Malicious packet. */
- if (payload <= 0)
- return;
- gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size);
- shinfo->gso_segs = gso_segs;
- }
- qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len;
+ /* Malicious packet. */
+ if (payload <= 0)
+ return SKB_DROP_REASON_SKB_BAD_GSO;
+ gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size);
+ shinfo->gso_segs = gso_segs;
}
+ qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len;
+ return SKB_NOT_DROPPED_YET;
}
static int dev_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *q,
@@ -4772,6 +4782,12 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
(SKBTX_SCHED_TSTAMP | SKBTX_BPF)))
__skb_tstamp_tx(skb, NULL, NULL, skb->sk, SCM_TSTAMP_SCHED);
+ reason = qdisc_pkt_len_init(skb);
+ if (unlikely(reason)) {
+ dev_core_stats_tx_dropped_inc(dev);
+ kfree_skb_reason(skb, reason);
+ return -EINVAL;
+ }
/* Disable soft irqs for various locks below. Also
* stops preemption for RCU.
*/
@@ -4779,7 +4795,6 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
skb_update_prio(skb);
- qdisc_pkt_len_init(skb);
tcx_set_ingress(skb, false);
#ifdef CONFIG_NET_EGRESS
if (static_branch_unlikely(&egress_needed_key)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 006/703] xfrm: Dont clobber inner headers when already set
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 005/703] net: pull headers in qdisc_pkt_len_segs_init() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 007/703] net: harden qdisc_pkt_len_segs_init() against malicious GSO packets Greg Kroah-Hartman
` (131 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cosmin Ratiu, Steffen Klassert,
Artem Dinaburg, Sasha Levin
6.18-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: Artem Dinaburg <artem@trailofbits.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 262eea7bdea30..433ce19c29002 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] 139+ messages in thread
* [PATCH 6.18 007/703] net: harden qdisc_pkt_len_segs_init() against malicious GSO packets
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 006/703] xfrm: Dont clobber inner headers when already set Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 008/703] net: reject a negative TCP header offset in qdisc_pkt_len_segs_init() Greg Kroah-Hartman
` (130 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, shaos, Eric Dumazet,
Jamal Hadi Salim, Michael S. Tsirkin, Willem de Bruijn,
Jakub Kicinski, Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@kernel.org>
[ Upstream commit c6648c9f3b51c5a8a3df470c1542b2aa378d88f9 ]
An SKB_GSO_DODGY packet can carry untrusted gso_size and headers.
For instance, gso_size=1 and hdr_len=65532 for a 524275-byte frame
makes qdisc_pkt_len_segs_init() compute an accounted length of
about 4,294,574,091 bytes (after gso_segs silently wrapped in a u16).
With DRR quantum 256, the dequeue path then needs ~16.8 million
deficit refills before it can dequeue the skb, keeping the CPU in
the qdisc path long enough to trigger the soft-lockup watchdog.
Commit 8f735d64382d ("net/sched: bound qdisc_pkt_len to prevent
qdisc soft lockup") added QDISC_PKT_LEN_MAX to bound size table
amplification. Use the same bound for DODGY packets:
- Make gso_segs a u32 and drop packets whose segment count does
not fit GSO_MAX_SEGS, instead of silently truncating it.
- Drop packets whose estimated qdisc_pkt_len() would exceed
QDISC_PKT_LEN_MAX.
Fixes: 15e5a0307164 ("net_sched: better precise estimation on packet length for untrusted packets")
Reported-by: shaos <shawnq1@163.com>
Closes: https://lore.kernel.org/netdev/20261022144755.65025-1-shawnq1@163.com/
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261022155436.117507-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Backport to 6.18.y: context adjusted; 6.18.y keeps the name
qdisc_pkt_len_init() and has no qdisc_skb_cb()->pkt_segs. The code
change is identical to upstream. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/dev.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 792cc34fc218a..40f3bb73c0ca3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4140,7 +4140,7 @@ static enum skb_drop_reason qdisc_pkt_len_init(struct sk_buff *skb)
{
struct skb_shared_info *shinfo = skb_shinfo(skb);
unsigned int hdr_len, tlen;
- u16 gso_segs;
+ u32 gso_segs;
qdisc_skb_cb(skb)->pkt_len = skb->len;
if (!shinfo->gso_size)
@@ -4189,6 +4189,15 @@ static enum skb_drop_reason qdisc_pkt_len_init(struct sk_buff *skb)
if (payload <= 0)
return SKB_DROP_REASON_SKB_BAD_GSO;
gso_segs = DIV_ROUND_UP(payload, shinfo->gso_size);
+ /* shinfo->gso_segs is a 16bit field.
+ * Also make sure untrusted gso_size/hdr_len can not inflate
+ * qdisc_pkt_len() beyond QDISC_PKT_LEN_MAX, or deficit
+ * schedulers could spin in their refill loops.
+ */
+ if (unlikely(gso_segs > GSO_MAX_SEGS ||
+ skb->len + (u64)(gso_segs - 1) * hdr_len >
+ QDISC_PKT_LEN_MAX))
+ return SKB_DROP_REASON_SKB_BAD_GSO;
shinfo->gso_segs = gso_segs;
}
qdisc_skb_cb(skb)->pkt_len += (gso_segs - 1) * hdr_len;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 008/703] net: reject a negative TCP header offset in qdisc_pkt_len_segs_init()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 007/703] net: harden qdisc_pkt_len_segs_init() against malicious GSO packets Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 009/703] sctp: validate cookie AUTH state before use Greg Kroah-Hartman
` (129 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, Eric Dumazet,
Michael S. Tsirkin, Paolo Abeni, Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexei Starovoitov <ast@kernel.org>
[ Upstream commit 35d2d6e5ac0d22428b2a0216061f3330c095393c ]
qdisc_pkt_len_segs_init() stores skb_transport_offset(), or the inner
offset, in the unsigned hdr_len. A header in front of skb->data gives a
negative offset. For an offset a little below zero, pskb_may_pull() gets a
small length and succeeds. Then a 64-bit kernel reads the TCP header far
after the skb and can crash. Further below zero pskb_may_pull() fails.
Commit 28a57fb2c5df ("net: iptunnel: fix stale transport header during
tunnel decapsulation") fixed one source of such offsets. Other code that
removes bytes from the front of a packet can leave the same stale header.
Return SKB_DROP_REASON_SKB_BAD_GSO for a negative offset in the TCP branch.
SKB_GSO_UDP_L4 and the other GSO types read no header and still get a wrong
qdisc_pkt_len(). On a 64-bit kernel only packets that cause the read after
the skb today get a new result. Then __dev_queue_xmit() drops them and
returns -EINVAL, but sch_handle_ingress() ignores the result. Their content
can be valid. Thus the code that leaves the header stale needs its own fix.
Fixes: 7fb4c1967011 ("net: pull headers in qdisc_pkt_len_segs_init()")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
CC: stable@vger.kernel.org
Link: https://patch.msgid.link/20261101194433.2637113-1-alexei.starovoitov@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ Backport to 6.18.y: in 6.18.y the function is qdisc_pkt_len_init()
and __dev_queue_xmit() is its only caller; sch_handle_ingress() does
not call it. The code change is identical to upstream. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/dev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 40f3bb73c0ca3..c0aa4e8625b5d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4164,7 +4164,9 @@ static enum skb_drop_reason qdisc_pkt_len_init(struct sk_buff *skb)
if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) {
const struct tcphdr *th;
- if (!pskb_may_pull(skb, hdr_len + sizeof(struct tcphdr)))
+ /* A header in front of skb->data gives a negative offset. */
+ if ((int)hdr_len < 0 ||
+ !pskb_may_pull(skb, hdr_len + sizeof(struct tcphdr)))
return SKB_DROP_REASON_SKB_BAD_GSO;
th = (const struct tcphdr *)(skb->data + hdr_len);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 009/703] sctp: validate cookie AUTH state before use
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 008/703] net: reject a negative TCP header offset in qdisc_pkt_len_segs_init() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 010/703] net/sched: codel: bound the dropping loop per dequeue call Greg Kroah-Hartman
` (128 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Xin Long,
Jakub Kicinski, Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
[ Upstream commit 3dbb44d88b1e94dd31fe43588af7437b34b44d56 ]
When cookie authentication is disabled, COOKIE_ECHO restores fixed-size
AUTH fields directly from peer-controlled cookie bytes. A forged RANDOM
length, HMAC list, or CHUNKS list can then reach association consumers
with lengths or identifiers that were never validated against the local
backing arrays.
A forged RANDOM length can cause out-of-bounds reads during key-vector
construction. A forged HMAC identifier also caused a 32-byte write past
a zero-length AUTH chunk, providing a primitive for a local privilege
escalation chain.
Validate the cookie's RANDOM, HMACS, and CHUNKS parameters at the cookie
trust boundary before copying them into the association. Reject invalid
types, malformed lengths, unsupported HMAC identifiers, HMAC lists
without SHA1, and forbidden chunk ids.
Fixes: bbd0d59809f9 ("[SCTP]: Implement the receive and verification of AUTH chunk")
Fixes: 1f485649f529 ("[SCTP]: Implement SCTP-AUTH internals")
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20260804200042.2412009-1-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Backport to 6.18.y: context adjusted in include/net/sctp/auth.h, where
6.18.y still declares sctp_auth_init_hmacs(), and in
sctp_unpack_cookie(), where 6.18.y still sets retval->c.peer_addr
after copying the cookie. No code changes. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/sctp/auth.h | 3 ++
net/sctp/auth.c | 75 ++++++++++++++++++++++++++++++++++++++++
net/sctp/sm_make_chunk.c | 3 ++
3 files changed, 81 insertions(+)
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index 3d5879e08e78a..fe45c8df210f9 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -22,6 +22,7 @@ struct sctp_endpoint;
struct sctp_association;
struct sctp_authkey;
struct sctp_hmacalgo;
+struct sctp_cookie;
/* Defines an HMAC algorithm supported by SCTP chunk authentication */
struct sctp_hmac {
@@ -72,6 +73,8 @@ struct sctp_shared_key *sctp_auth_get_shkey(
int sctp_auth_asoc_copy_shkeys(const struct sctp_endpoint *ep,
struct sctp_association *asoc,
gfp_t gfp);
+bool sctp_auth_verify_cookie_params(const struct sctp_endpoint *ep,
+ const struct sctp_cookie *cookie);
int sctp_auth_init_hmacs(struct sctp_endpoint *ep, gfp_t gfp);
const struct sctp_hmac *sctp_auth_get_hmac(__u16 hmac_id);
const struct sctp_hmac *
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index fbbfa0c279552..95c272948c60a 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -377,6 +377,81 @@ int sctp_auth_asoc_copy_shkeys(const struct sctp_endpoint *ep,
return -ENOMEM;
}
+static bool sctp_auth_chunk_id_forbidden(__u8 chunk_id)
+{
+ switch (chunk_id) {
+ case SCTP_CID_INIT:
+ case SCTP_CID_INIT_ACK:
+ case SCTP_CID_SHUTDOWN_COMPLETE:
+ case SCTP_CID_AUTH:
+ return true;
+ default:
+ return false;
+ }
+}
+
+/* Verify AUTH parameters copied from a state cookie before they are restored
+ * into an association. When cookie authentication is disabled these fields
+ * are peer-controlled, so they must satisfy the same constraints as locally
+ * generated AUTH parameters.
+ */
+bool sctp_auth_verify_cookie_params(const struct sctp_endpoint *ep,
+ const struct sctp_cookie *cookie)
+{
+ const struct sctp_paramhdr *random;
+ const struct sctp_hmac_algo_param *hmacs;
+ const struct sctp_chunks_param *chunks;
+ u16 hmacs_len, chunks_len;
+ u16 n_hmacs, n_chunks, i;
+ bool has_sha1 = false;
+
+ if (sctp_sk(ep->base.sk)->cookie_auth_enable || !ep->auth_enable)
+ return true;
+
+ random = (const struct sctp_paramhdr *)cookie->auth_random;
+ if (random->type != SCTP_PARAM_RANDOM ||
+ ntohs(random->length) != sizeof(*random) + SCTP_AUTH_RANDOM_LENGTH)
+ return false;
+
+ hmacs = (const struct sctp_hmac_algo_param *)cookie->auth_hmacs;
+ hmacs_len = ntohs(hmacs->param_hdr.length);
+ if (hmacs->param_hdr.type != SCTP_PARAM_HMAC_ALGO ||
+ hmacs_len < sizeof(struct sctp_paramhdr) +
+ sizeof(hmacs->hmac_ids[0]) ||
+ hmacs_len > sizeof(cookie->auth_hmacs) ||
+ (hmacs_len - sizeof(struct sctp_paramhdr)) %
+ sizeof(hmacs->hmac_ids[0]))
+ return false;
+
+ n_hmacs = (hmacs_len - sizeof(struct sctp_paramhdr)) /
+ sizeof(hmacs->hmac_ids[0]);
+ for (i = 0; i < n_hmacs; i++) {
+ u16 hmac_id = ntohs(hmacs->hmac_ids[i]);
+
+ if (!sctp_hmac_supported(hmac_id))
+ return false;
+ if (hmac_id == SCTP_AUTH_HMAC_ID_SHA1)
+ has_sha1 = true;
+ }
+ if (!has_sha1)
+ return false;
+
+ chunks = (const struct sctp_chunks_param *)cookie->auth_chunks;
+ chunks_len = ntohs(chunks->param_hdr.length);
+ if (chunks->param_hdr.type != SCTP_PARAM_CHUNKS ||
+ chunks_len < sizeof(struct sctp_paramhdr) ||
+ chunks_len > sizeof(cookie->auth_chunks))
+ return false;
+
+ n_chunks = chunks_len - sizeof(struct sctp_paramhdr);
+ for (i = 0; i < n_chunks; i++) {
+ if (sctp_auth_chunk_id_forbidden(chunks->chunks[i]))
+ return false;
+ }
+
+ return true;
+}
+
/* Public interface to create the association shared key.
* See code above for the algorithm.
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index db9406f4681c9..ae4ca90fce9ab 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1867,6 +1867,9 @@ struct sctp_association *sctp_unpack_cookie(
/* Set up our peer's port number. */
retval->peer.port = ntohs(chunk->sctp_hdr->source);
+ if (!sctp_auth_verify_cookie_params(ep, bear_cookie))
+ goto malformed;
+
/* Populate the association from the cookie. */
memcpy(&retval->c, bear_cookie, sizeof(*bear_cookie));
retval->c.peer_addr = paddr;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 010/703] net/sched: codel: bound the dropping loop per dequeue call
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 009/703] sctp: validate cookie AUTH state before use Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 011/703] net: flush skb_defer_nodes in dev_cpu_dead() Greg Kroah-Hartman
` (127 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vega, Eric Dumazet, Victor Nogueira,
Jamal Hadi Salim, Toke Høiland-Jørgensen,
Jakub Kicinski, Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jamal Hadi Salim <jhs@mojatatu.com>
[ Upstream commit 7f4a5ec6258fd7c92633ec4b0493fc51166d9398 ]
The CoDel control law schedules the next drop one interval/sqrt(count)
after the previous drop, using the configured interval
(codel_params.interval). For very small intervals the scheduled step
rounds down to zero, so the dropping loop in codel_dequeue() never
advances and drains the entire backlog under the qdisc lock in one
call - an unprivileged user can trigger a soft lockup this way.
Fix in the shared codel code used by both codel and fq_codel:
1. Make the control-law step at least 1 tick so the dropping loop
always moves forward.
2. Cap the dropping loop at CODEL_MAX_DROPS_PER_DEQUEUE (256) drops
per codel_dequeue() call, resyncing drop_next to now when the cap
is hit: the catch-up owed to the loop grows with the idle gap and
the backlog, which no interval threshold can bound. This is a
deliberate behaviour change after long idle gaps.
The cap applies to fq_codel (4b549a2ef4be) and the mac80211 TXQ path
(fixed interval, cap only).
The target sojourn delay (codel_params.target) is not validated: it
does not feed the control law, so a sub-tick value is aggressive
rather than deadlock-prone.
Conditions to recreate the bug:
- tc qdisc add dev lo root handle 1: tbf rate 1kbit burst 2kb limit 1000000
- tc qdisc add dev lo parent 1:1 handle 10: codel interval 2us target 1ms noecn limit 1000000 (same for fq_codel)
- unpatched kernel: tc accepts it; a UDP flood under the 1kbit tbf
soft-lockups (watchdog: BUG: soft lockup) while one
codel_dequeue() call drops the backlog under the qdisc lock
- patched kernel: same setup, at most 256 drops per dequeue call,
no soft lockup
Testing: claim reproducer and interval 2us/3us variants run clean;
tdc qdisc category passes (see the selftests patch).
Fixes: 76e3cc126bb2 ("codel: Controlled Delay AQM")
Reported-by: Vega <vega@nebusec.ai>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Tested-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@toke.dk>
Link: https://patch.msgid.link/QDISC-1L5H.v1.20260912080102@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Backport to 6.18.y: context adjusted in codel_dequeue(); 6.18.y lacks
the upstream WRITE_ONCE() annotations of the codel state. The added
code is unchanged. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/codel.h | 5 +++++
include/net/codel_impl.h | 16 +++++++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/include/net/codel.h b/include/net/codel.h
index aa80f744826cd..183d43c2bd434 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -140,6 +140,11 @@ struct codel_vars {
/* needed shift to get a Q0.32 number from rec_inv_sqrt */
#define REC_INV_SQRT_SHIFT (32 - REC_INV_SQRT_BITS)
+/* Cap on drops per codel_dequeue() call: the loop's work depends on the
+ * idle gap and backlog, both outside our control; resync when exceeded.
+ */
+#define CODEL_MAX_DROPS_PER_DEQUEUE 256
+
/**
* struct codel_stats - contains codel shared variables and stats
* @maxpacket: largest packet we've seen so far
diff --git a/include/net/codel_impl.h b/include/net/codel_impl.h
index b2c359c6dd1b8..4d5e471472f6a 100644
--- a/include/net/codel_impl.h
+++ b/include/net/codel_impl.h
@@ -93,12 +93,17 @@ static void codel_Newton_step(struct codel_vars *vars)
* CoDel control_law is t + interval/sqrt(count)
* We maintain in rec_inv_sqrt the reciprocal value of sqrt(count) to avoid
* both sqrt() and divide operation.
+ *
+ * Clamp the increment to at least 1 tick: a very small interval (or a
+ * large count) can truncate it to zero, stalling the dropping loop.
*/
static codel_time_t codel_control_law(codel_time_t t,
codel_time_t interval,
u32 rec_inv_sqrt)
{
- return t + reciprocal_scale(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT);
+ return t + max_t(u32, 1,
+ reciprocal_scale(interval,
+ rec_inv_sqrt << REC_INV_SQRT_SHIFT));
}
static bool codel_should_drop(const struct sk_buff *skb,
@@ -154,6 +159,7 @@ static struct sk_buff *codel_dequeue(void *ctx,
codel_skb_dequeue_t dequeue_func)
{
struct sk_buff *skb = dequeue_func(vars, ctx);
+ unsigned int drops = 0;
codel_time_t now;
bool drop;
@@ -180,6 +186,14 @@ static struct sk_buff *codel_dequeue(void *ctx,
*/
while (vars->dropping &&
codel_time_after_eq(now, vars->drop_next)) {
+ if (++drops > CODEL_MAX_DROPS_PER_DEQUEUE) {
+ /* fell far behind the schedule */
+ WRITE_ONCE(vars->drop_next,
+ codel_control_law(now,
+ params->interval,
+ vars->rec_inv_sqrt));
+ break;
+ }
vars->count++; /* dont care of possible wrap
* since there is no more divide
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 011/703] net: flush skb_defer_nodes in dev_cpu_dead()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 010/703] net/sched: codel: bound the dropping loop per dequeue call Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 012/703] ext4: teach ext4_meta_trans_blocks() about number of allocated extents Greg Kroah-Hartman
` (126 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kris Pan,
Jakub Kicinski, Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 06e3f54e8b22040ada01a28343badf1990b4dd7d ]
When a CPU goes offline, dev_cpu_dead() drains its softnet queues
(completion_queue, output_queue, poll_list, process_queue, and
input_pkt_queue), but leaves net_hotdata.skb_defer_nodes untouched.
If oldcpu goes offline while holding pending skbs in its
skb_defer_nodes lists (e.g. below the sysctl_skb_defer_max >> 1 IPI
threshold, or if the IPI races with CPU teardown), those skbs remain
stranded until oldcpu is brought back online. If any of these skbs
hold page_pool fragments, page_pool_destroy() will stall indefinitely
waiting for inflight pages to be returned when a netdev or driver is
torn down while oldcpu is offline.
Additionally, if smp_call_function_single_async() fails in
kick_defer_list_purge() because the target CPU went offline, reset
defer_ipi_scheduled to 0 so future IPI kicks are not blocked when the
CPU comes back online.
Also, if oldcpu was the last online CPU on its NUMA node, drain that
node's slot across all CPUs so no skbs deferred from that node remain
stranded on idle remote CPUs (or if the node itself is subsequently
offlined).
Finally, in skb_attempt_defer_free(), re-check cpu_online(cpu) and
whether the caller migrated CPUs after llist_add(), flushing the node
list if so, to close the preemption TOCTOU race against CPU/node
teardown.
Fixes: 68822bdf76f1 ("net: generalize skb freeing deferral to per-cpu lists")
Fixes: 5628f3fe3b16 ("net: add NUMA awareness to skb_attempt_defer_free()")
Closes: https://lore.kernel.org/netdev/20260916003430.3612956-1-kris.pan@intel.com/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Kris Pan <kris.pan@intel.com>
Link: https://patch.msgid.link/20260923130318.607255-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Backport to 6.18.y: 6.18.y loads skb->alloc_cpu in the declaration of
cpu and lacks the upstream skb_defer_disable_key and skb_zcopy()
bypasses, so my_cpu is declared separately and the remaining hunks
are adjusted for context. The 6.18.y flush loop has no prefetch();
the new __skb_defer_free_flush() helper adds it as upstream does.
skb_defer_free_flush() keeps the for_each_online_node() iteration
from commit 58fb1e2a33ea ("net: iterate online nodes in
skb_defer_free_flush()"), already in 6.18.y. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/dev.c | 46 +++++++++++++++++++++++++++++++++++-----------
net/core/dev.h | 2 ++
net/core/skbuff.c | 11 +++++++++--
3 files changed, 46 insertions(+), 13 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index c0aa4e8625b5d..f7e672a4a39f7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5327,7 +5327,8 @@ void kick_defer_list_purge(unsigned int cpu)
backlog_unlock_irq_restore(sd, flags);
} else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) {
- smp_call_function_single_async(cpu, &sd->defer_csd);
+ if (smp_call_function_single_async(cpu, &sd->defer_csd))
+ WRITE_ONCE(sd->defer_ipi_scheduled, 0);
}
}
@@ -6865,24 +6866,35 @@ bool napi_complete_done(struct napi_struct *n, int work_done)
}
EXPORT_SYMBOL(napi_complete_done);
-static void skb_defer_free_flush(void)
+static void __skb_defer_free_flush(struct skb_defer_node *sdn, int budget)
{
struct llist_node *free_list;
struct sk_buff *skb, *next;
+
+ if (llist_empty(&sdn->defer_list))
+ return;
+ atomic_long_set(&sdn->defer_count, 0);
+ free_list = llist_del_all(&sdn->defer_list);
+
+ llist_for_each_entry_safe(skb, next, free_list, ll_node) {
+ prefetch(next);
+ napi_consume_skb(skb, budget);
+ }
+}
+
+void skb_defer_node_flush(struct skb_defer_node *sdn)
+{
+ __skb_defer_free_flush(sdn, 0);
+}
+
+static void skb_defer_free_flush(void)
+{
struct skb_defer_node *sdn;
int node;
for_each_online_node(node) {
sdn = this_cpu_ptr(net_hotdata.skb_defer_nodes) + node;
-
- if (llist_empty(&sdn->defer_list))
- continue;
- atomic_long_set(&sdn->defer_count, 0);
- free_list = llist_del_all(&sdn->defer_list);
-
- llist_for_each_entry_safe(skb, next, free_list, ll_node) {
- napi_consume_skb(skb, 1);
- }
+ __skb_defer_free_flush(sdn, 1);
}
}
@@ -12704,6 +12716,7 @@ static int dev_cpu_dead(unsigned int oldcpu)
struct sk_buff **list_skb;
struct sk_buff *skb;
unsigned int cpu;
+ int node;
struct softnet_data *sd, *oldsd, *remsd = NULL;
local_irq_disable();
@@ -12764,6 +12777,17 @@ static int dev_cpu_dead(unsigned int oldcpu)
rps_input_queue_head_incr(oldsd);
}
+ for_each_node(node)
+ skb_defer_node_flush(per_cpu_ptr(net_hotdata.skb_defer_nodes,
+ oldcpu) + node);
+ node = cpu_to_node(oldcpu);
+ if (node_possible(node) &&
+ !cpumask_intersects(cpumask_of_node(node), cpu_online_mask)) {
+ for_each_possible_cpu(cpu)
+ skb_defer_node_flush(per_cpu_ptr(net_hotdata.skb_defer_nodes,
+ cpu) + node);
+ }
+
return 0;
}
diff --git a/net/core/dev.h b/net/core/dev.h
index 6a84413e673ae..7e5bce3c78e3a 100644
--- a/net/core/dev.h
+++ b/net/core/dev.h
@@ -360,6 +360,8 @@ static inline void napi_assert_will_not_race(const struct napi_struct *napi)
WARN_ON(READ_ONCE(napi->list_owner) != -1);
}
+struct skb_defer_node;
+void skb_defer_node_flush(struct skb_defer_node *sdn);
void kick_defer_list_purge(unsigned int cpu);
int dev_set_hwtstamp_phylib(struct net_device *dev,
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 07df2030ccf2a..60eb8b4328f89 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -7324,10 +7324,12 @@ void skb_attempt_defer_free(struct sk_buff *skb)
struct skb_defer_node *sdn;
unsigned long defer_count;
int cpu = skb->alloc_cpu;
+ int my_cpu;
unsigned int defer_max;
bool kick;
- if (cpu == raw_smp_processor_id() ||
+ my_cpu = raw_smp_processor_id();
+ if (cpu == my_cpu ||
WARN_ON_ONCE(cpu >= nr_cpu_ids) ||
!cpu_online(cpu)) {
nodefer: kfree_skb_napi_cache(skb);
@@ -7338,7 +7340,7 @@ nodefer: kfree_skb_napi_cache(skb);
DEBUG_NET_WARN_ON_ONCE(skb->destructor);
DEBUG_NET_WARN_ON_ONCE(skb_nfct(skb));
- sdn = per_cpu_ptr(net_hotdata.skb_defer_nodes, cpu) + numa_node_id();
+ sdn = per_cpu_ptr(net_hotdata.skb_defer_nodes, cpu) + cpu_to_node(my_cpu);
defer_max = READ_ONCE(net_hotdata.sysctl_skb_defer_max);
defer_count = atomic_long_inc_return(&sdn->defer_count);
@@ -7348,6 +7350,11 @@ nodefer: kfree_skb_napi_cache(skb);
llist_add(&skb->ll_node, &sdn->defer_list);
+ if (unlikely(!cpu_online(cpu) || my_cpu != raw_smp_processor_id())) {
+ skb_defer_node_flush(sdn);
+ return;
+ }
+
/* Send an IPI every time queue reaches half capacity. */
kick = (defer_count - 1) == (defer_max >> 1);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 012/703] ext4: teach ext4_meta_trans_blocks() about number of allocated extents
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 011/703] net: flush skb_defer_nodes in dev_cpu_dead() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 013/703] ext4: fix transaction overflow during writeback Greg Kroah-Hartman
` (125 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara, Theodore Tso, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
[ Upstream commit 25b2a7e8d420c49fc46f25b6f953603e4dae1dbf ]
So far ext4_meta_trans_blocks() expects that each extent counted in
@pextents will be allocated in the transaction we estimate credits for.
This is correct for the use in ext4_chunk_trans_blocks() and
ext4_chunk_trans_extent() however the use in atomic write path
(ext4_convert_unwritten_extents_atomic() and ext4_iomap_alloc() for
IOMAP_ATOMIC) unnecessarily overestimates the number of necessary
credits as neither of them allocates any data. Add argument to
ext4_meta_trans_blocks() for number of extents that are going to be
allocated in the transaction.
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260805153605.166545-4-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
[ sashal: adjusted ext4.h prototype context for missing upstream declarations, and updated the move_extent.c caller to pass block_len_in_page as the new alloc_extents argument. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ext4/ext4.h | 2 +-
fs/ext4/extents.c | 2 +-
fs/ext4/inode.c | 30 +++++++++++++++---------------
fs/ext4/move_extent.c | 1 +
4 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 9c67a2c28faf5..dc7232e8e8315 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -3123,7 +3123,7 @@ extern int ext4_normal_submit_inode_data_buffers(struct jbd2_inode *jinode);
extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);
extern int ext4_chunk_trans_extent(struct inode *inode, int nrblocks);
extern int ext4_meta_trans_blocks(struct inode *inode, int lblocks,
- int pextents);
+ int pextents, int alloc_extents);
extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
loff_t lstart, loff_t lend);
extern vm_fault_t ext4_page_mkwrite(struct vm_fault *vmf);
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 80d41be515644..d789c7c2b5357 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4946,7 +4946,7 @@ int ext4_convert_unwritten_extents_atomic(handle_t *handle, struct inode *inode,
* it can tell if the extent in the cache is a split extent.
* But for now let's assume pextents as 2 always.
*/
- credits = ext4_meta_trans_blocks(inode, max_blocks, 2);
+ credits = ext4_meta_trans_blocks(inode, max_blocks, 2, 0);
}
if (credits) {
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d46d243d53c47..a8325b778355e 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3731,8 +3731,8 @@ static int ext4_iomap_alloc(struct inode *inode, struct ext4_map_blocks *map,
return ret;
if (map->m_len < orig_mlen) {
map->m_len = orig_mlen;
- dio_credits = ext4_meta_trans_blocks(inode, orig_mlen,
- map->m_len);
+ dio_credits = ext4_meta_trans_blocks(inode, map->m_len,
+ map->m_len, 0);
} else {
dio_credits = ext4_chunk_trans_blocks(inode,
map->m_len);
@@ -6271,17 +6271,17 @@ static int ext4_index_trans_blocks(struct inode *inode, int lblocks,
}
/*
- * Account for index blocks, block groups bitmaps and block group
- * descriptor blocks if modify datablocks and index blocks
- * worse case, the indexs blocks spread over different block groups
- *
- * If datablocks are discontiguous, they are possible to spread over
- * different block groups too. If they are contiguous, with flexbg,
- * they could still across block group boundary.
- *
- * Also account for superblock, inode, quota and xattr blocks
+ * Calculate number of credits needed in a transaction to:
+ * * Allocate data blocks from @alloc_extents different groups - note that
+ * with flexbg a single physical extent can span multiple groups but
+ * single mballoc request only returns extent within one group.
+ * * Allocate metatadata (extent tree blocks, indirect blocks) to store
+ * pointers to @pextents data extents having @lblocks in total.
+ * * Modify extent tree / indirect block tree, inode, superblock, quota
+ * tracking, xattr blocks
*/
-int ext4_meta_trans_blocks(struct inode *inode, int lblocks, int pextents)
+int ext4_meta_trans_blocks(struct inode *inode, int lblocks, int pextents,
+ int alloc_extents)
{
ext4_group_t groups, ngroups = ext4_get_groups_count(inode->i_sb);
int gdpblocks;
@@ -6298,7 +6298,7 @@ int ext4_meta_trans_blocks(struct inode *inode, int lblocks, int pextents)
* Now let's see how many group bitmaps and group descriptors need
* to account
*/
- groups = idxblocks + pextents;
+ groups = idxblocks + alloc_extents;
gdpblocks = groups;
if (groups > ngroups)
groups = ngroups;
@@ -6324,7 +6324,7 @@ int ext4_chunk_trans_extent(struct inode *inode, int nrblocks)
{
int ret;
- ret = ext4_meta_trans_blocks(inode, nrblocks, 1);
+ ret = ext4_meta_trans_blocks(inode, nrblocks, 1, 1);
/* Account for data blocks for journalled mode */
if (ext4_should_journal_data(inode))
ret += nrblocks;
@@ -6342,7 +6342,7 @@ int ext4_chunk_trans_extent(struct inode *inode, int nrblocks)
*/
int ext4_chunk_trans_blocks(struct inode *inode, int nrblocks)
{
- return ext4_meta_trans_blocks(inode, nrblocks, 1);
+ return ext4_meta_trans_blocks(inode, nrblocks, 1, 1);
}
/*
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index e2705ea5e5c63..6a60d29e433bc 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -281,6 +281,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
again:
*err = 0;
jblocks = ext4_meta_trans_blocks(orig_inode, block_len_in_page,
+ block_len_in_page,
block_len_in_page) * 2;
handle = ext4_journal_start(orig_inode, EXT4_HT_MOVE_EXTENTS, jblocks);
if (IS_ERR(handle)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 013/703] ext4: fix transaction overflow during writeback
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 012/703] ext4: teach ext4_meta_trans_blocks() about number of allocated extents Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 014/703] bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call() Greg Kroah-Hartman
` (124 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jan Kara, Theodore Tso, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
[ Upstream commit 46e8e31771f4f1c5e1cdec37a889a6730e42e9f1 ]
Commit 95ad8ee45cdb ("ext4: correct the reserved credits for extent
conversion") was correct to note that we need to reserve enough credits
for all extents possibly underlying a large folio. However it was too
eager to reduce the number of reserved credits. Extent conversion may
not only need to touch several leaf extent blocks, it may also need to
split extents - for example a single large unwritten extent may need to
be split into many small written ones in case of sparse folio dirtying.
This can thus result not only in extent leaf modifications but also in a
need to allocate new extent tree nodes. As a result the reserved
transaction credits were not sufficient in some corner cases. Use
ext4_meta_trans_blocks() for correct upper bound credit estimate.
Fixes: 95ad8ee45cdb ("ext4: correct the reserved credits for extent conversion")
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260805153605.166545-5-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ext4/inode.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index a8325b778355e..2a9167bff4c26 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2862,10 +2862,10 @@ static int ext4_do_writepages(struct mpage_da_data *mpd)
if (ext4_should_dioread_nolock(inode)) {
int bpf = ext4_journal_blocks_per_folio(inode);
/*
- * We may need to convert up to one extent per block in
- * the folio and we may dirty the inode.
+ * We may need to convert up to one extent per block in the
+ * folio.
*/
- rsv_blocks = 1 + ext4_ext_index_trans_blocks(inode, bpf);
+ rsv_blocks = ext4_meta_trans_blocks(inode, bpf, bpf, 0);
}
if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 014/703] bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 013/703] ext4: fix transaction overflow during writeback Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 015/703] bpf: Reject programs with inlined helpers if JIT is not available Greg Kroah-Hartman
` (123 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, KaFai Wan,
Leon Hwang, Tiezhu Yang, Eduard Zingerman, Sasha Levin
6.18-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 2d8cb15fb9ba7..cc9c58ea53b10 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1706,8 +1706,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? */
@@ -2868,7 +2869,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);
@@ -3151,11 +3151,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 59c87eeb07cdb..1d1d834482228 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -125,6 +125,7 @@ struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flag
fp->aux->main_prog_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;
@@ -2566,15 +2567,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 a004c95969636..32bb4c3f70fba 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -3383,6 +3383,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
@@ -3491,11 +3493,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)
@@ -22533,7 +22530,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;
@@ -22547,8 +22543,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] 139+ messages in thread
* [PATCH 6.18 015/703] bpf: Reject programs with inlined helpers if JIT is not available
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 014/703] bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 016/703] bpf: Disallow interpreter fallback for arena-related insns Greg Kroah-Hartman
` (122 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexei Starovoitov, KaFai Wan,
Leon Hwang, Tiezhu Yang, Eduard Zingerman, Sasha Levin
6.18-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 32bb4c3f70fba..d62d844ae3f86 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -23155,8 +23155,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] 139+ messages in thread
* [PATCH 6.18 016/703] bpf: Disallow interpreter fallback for arena-related insns
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 015/703] bpf: Reject programs with inlined helpers if JIT is not available Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 017/703] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn Greg Kroah-Hartman
` (121 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Hwang, Kumar Kartikeya Dwivedi,
Sasha Levin
6.18-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>
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 d62d844ae3f86..ec862cd11942b 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -21172,6 +21172,7 @@ static int check_map_prog_compatibility(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] 139+ messages in thread
* [PATCH 6.18 017/703] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 016/703] bpf: Disallow interpreter fallback for arena-related insns Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 018/703] mm/mmzone: read each zoneref slot once when filtering by nodemask Greg Kroah-Hartman
` (120 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Leon Hwang, Kumar Kartikeya Dwivedi,
Sasha Levin
6.18-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.18.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.18.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 cc9c58ea53b10..74110a8c800d9 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -3784,4 +3784,17 @@ int bpf_prog_get_file_line(struct bpf_prog *prog, unsigned long ip, const char *
const char **linep, int *nump);
struct bpf_prog *bpf_prog_find_from_stack(void);
+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 ec862cd11942b..40265041cc056 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -23346,6 +23346,9 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
return -EFAULT;
}
+ 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)
@@ -23450,6 +23453,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_MOV64_IMM(BPF_REG_0, (u32)(unsigned long)&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] 139+ messages in thread
* [PATCH 6.18 018/703] mm/mmzone: read each zoneref slot once when filtering by nodemask
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 017/703] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 019/703] mm/page_alloc: dont increase highatomic reserve after pcp alloc Greg Kroah-Hartman
` (119 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Zi Yan, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
[ Upstream commit e55119ab611a0e47595db7e1d2ac1e69f7a73ff0 ]
__next_zones_zonelist() tests a slot's zone for NULL, then reads the
slot again to look up the zone's node. Offlining a zone's last block
rebuilds the zonelists in place, so the second read can return the
terminator:
CPU 0 CPU 1
__next_zones_zonelist(nodemask)
zonelist_zone(slot 1) = NORMAL
offline_pages()
build_all_zonelists()
[MOVABLE, NORMAL, NULL]
-> [NORMAL, NULL]
zref_in_nodemask(slot 1)
zone_to_nid(NULL)
Current GCC and clang merge the two reads, but nothing requires it.
With mm/mmzone.o built with -fno-inline -fno-ipa-sra, holding a
nodemask allocation between the reads while the node's last movable
block goes offline oopses every time:
BUG: kernel NULL pointer dereference, address: 0000000000000060
RIP: 0010:zone_to_nid+0x0/0x10
Call Trace:
zref_in_nodemask+0x9/0x20
__next_zones_zonelist+0x23/0x70
prepare_alloc_pages.constprop.0+0x16c/0x190
__alloc_frozen_pages_noprof+0xaf/0x330
Read the slot once and test that zone. A NULL zone still ends the walk.
To achieve that, rename zref_in_nodemask() to zone_in_nodemask() and
pass a zone instead of zoneref pointer.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Link: https://patch.msgid.link/20261101021340.2251928-8-gourry@gourry.net
Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
[ sashal: Adjusted the context line because the helper still has the old one-line signature, and took upstream's const nodemask_t * post-image unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/mmzone.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/mm/mmzone.c b/mm/mmzone.c
index 0c8f181d9d500..cabe38127f798 100644
--- a/mm/mmzone.c
+++ b/mm/mmzone.c
@@ -43,12 +43,14 @@ struct zone *next_zone(struct zone *zone)
return zone;
}
-static inline int zref_in_nodemask(struct zoneref *zref, nodemask_t *nodes)
+/* A NULL zone terminates the zonelist, so it ends the search. */
+static inline bool zone_in_nodemask(const struct zone *zone,
+ const nodemask_t *nodes)
{
#ifdef CONFIG_NUMA
- return node_isset(zonelist_node_idx(zref), *nodes);
+ return !zone || node_isset(zone_to_nid(zone), *nodes);
#else
- return 1;
+ return true;
#endif /* CONFIG_NUMA */
}
@@ -66,7 +68,7 @@ struct zoneref *__next_zones_zonelist(struct zoneref *z,
z++;
else
while (zonelist_zone_idx(z) > highest_zoneidx ||
- (zonelist_zone(z) && !zref_in_nodemask(z, nodes)))
+ !zone_in_nodemask(zonelist_zone(z), nodes))
z++;
return z;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 019/703] mm/page_alloc: dont increase highatomic reserve after pcp alloc
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 018/703] mm/mmzone: read each zoneref slot once when filtering by nodemask Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 020/703] mm/page_alloc: use existing highatomic reserves on the buddy fastpath Greg Kroah-Hartman
` (118 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 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.18-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 074178f4d7a07..6b4a1dd7253e8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -244,6 +244,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:
@@ -3256,6 +3258,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);
@@ -3327,6 +3336,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);
@@ -3955,13 +3978,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, alloc_flags))
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 020/703] mm/page_alloc: use existing highatomic reserves on the buddy fastpath
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 019/703] mm/page_alloc: dont increase highatomic reserve after pcp alloc Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 021/703] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
` (117 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 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.18-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 6b4a1dd7253e8..7c10d42e31d8f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3259,10 +3259,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);
@@ -4544,6 +4545,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)
{
@@ -4566,18 +4590,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
@@ -5370,6 +5385,7 @@ struct page *__alloc_frozen_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] 139+ messages in thread
* [PATCH 6.18 021/703] xprtrdma: serialize unmap_sync with xprt_disconnect
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 020/703] mm/page_alloc: use existing highatomic reserves on the buddy fastpath Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 022/703] gve: Fix race between stats query and queue reconfig Greg Kroah-Hartman
` (116 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chuck Lever, Tim Menninger,
Anna Schumaker, Sasha Levin
6.18-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] 139+ messages in thread
* [PATCH 6.18 022/703] gve: Fix race between stats query and queue reconfig
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 021/703] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 023/703] gve: Block invalid ring sizes when device options are 0 Greg Kroah-Hartman
` (115 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Debarghya Kundu, Pin-yen Lin,
Harshitha Ramamurthy, Jakub Kicinski, Sasha Levin
6.18-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: Adjusted context in gve_queues_start() and gve_queues_mem_remove() because this tree lacks the qpl, header-split and packet-buffer-size lines, so the unlock follows rx_desc_cnt. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/google/gve/gve.h | 5 +++
drivers/net/ethernet/google/gve/gve_main.c | 43 ++++++++++++++++++++--
2 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/google/gve/gve.h b/drivers/net/ethernet/google/gve/gve.h
index f0bc910dd6d44..2aecaf892d659 100644
--- a/drivers/net/ethernet/google/gve/gve.h
+++ b/drivers/net/ethernet/google/gve/gve.h
@@ -877,6 +877,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 9b1f8933813cb..66a3b526b5a6f 100644
--- a/drivers/net/ethernet/google/gve/gve_main.c
+++ b/drivers/net/ethernet/google/gve/gve_main.c
@@ -113,6 +113,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++) {
@@ -140,6 +141,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)
@@ -1343,9 +1345,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.
@@ -1359,6 +1365,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;
@@ -1368,10 +1375,11 @@ static int gve_queues_start(struct gve_priv *priv,
priv->rx_cfg = *rx_alloc_cfg->qcfg_rx;
priv->tx_desc_cnt = tx_alloc_cfg->ring_size;
priv->rx_desc_cnt = rx_alloc_cfg->ring_size;
+ gve_init_sync_stats(priv);
+ spin_unlock_bh(&priv->stats_lock);
gve_tx_start_rings(priv, gve_num_tx_queues(priv));
gve_rx_start_rings(priv, rx_alloc_cfg->qcfg_rx->num_queues);
- gve_init_sync_stats(priv);
err = netif_set_real_num_tx_queues(dev, priv->tx_cfg.num_queues);
if (err)
@@ -2265,6 +2273,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) {
@@ -2329,6 +2338,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 */
@@ -2601,8 +2611,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;
}
@@ -2656,7 +2668,9 @@ static int gve_rx_queue_start(struct net_device *dev,
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);
@@ -2692,7 +2706,9 @@ static int gve_rx_queue_start(struct net_device *dev,
* 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;
}
@@ -2708,9 +2724,15 @@ static void gve_get_rx_queue_stats(struct net_device *dev, int idx,
struct netdev_queue_stats_rx *rx_stats)
{
struct gve_priv *priv = netdev_priv(dev);
- struct gve_rx_ring *rx = &priv->rx[idx];
+ struct gve_rx_ring *rx;
unsigned int start;
+ spin_lock_bh(&priv->stats_lock);
+ if (!priv->rx)
+ goto unlock;
+
+ rx = &priv->rx[idx];
+
do {
start = u64_stats_fetch_begin(&rx->statss);
rx_stats->packets = rx->rpackets;
@@ -2718,20 +2740,32 @@ static void gve_get_rx_queue_stats(struct net_device *dev, int idx,
rx_stats->alloc_fail = rx->rx_skb_alloc_fail +
rx->rx_buf_alloc_fail;
} while (u64_stats_fetch_retry(&rx->statss, start));
+
+unlock:
+ spin_unlock_bh(&priv->stats_lock);
}
static void gve_get_tx_queue_stats(struct net_device *dev, int idx,
struct netdev_queue_stats_tx *tx_stats)
{
struct gve_priv *priv = netdev_priv(dev);
- struct gve_tx_ring *tx = &priv->tx[idx];
+ struct gve_tx_ring *tx;
unsigned int start;
+ spin_lock_bh(&priv->stats_lock);
+ if (!priv->tx)
+ goto unlock;
+
+ tx = &priv->tx[idx];
+
do {
start = u64_stats_fetch_begin(&tx->statss);
tx_stats->packets = tx->pkt_done;
tx_stats->bytes = tx->bytes_done;
} while (u64_stats_fetch_retry(&tx->statss, start));
+
+unlock:
+ spin_unlock_bh(&priv->stats_lock);
}
static void gve_get_base_stats(struct net_device *dev,
@@ -2848,6 +2882,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] 139+ messages in thread
* [PATCH 6.18 023/703] gve: Block invalid ring sizes when device options are 0
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 022/703] gve: Fix race between stats query and queue reconfig Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 024/703] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
` (114 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pin-yen Lin, Joshua Washington,
Jordan Rhee, Harshitha Ramamurthy, Jakub Kicinski, Sasha Levin
6.18-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>
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 367a9f0e89b5c..bcd9a340cefc2 100644
--- a/drivers/net/ethernet/google/gve/gve_adminq.c
+++ b/drivers/net/ethernet/google/gve/gve_adminq.c
@@ -189,7 +189,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 == GVE_DEVICE_OPTION_NO_MIN_RING_SIZE ||
+ 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] 139+ messages in thread
* [PATCH 6.18 024/703] net: wait for in-flight device unregistrations before netns dismantle
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 023/703] gve: Block invalid ring sizes when device options are 0 Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 025/703] ksmbd: pin parent dentries in SMB2 CREATE ACL path Greg Kroah-Hartman
` (113 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+1269fe6cc2016008124e,
Henry Martin, Eric Dumazet, Naman Gulati, Jakub Kicinski,
Sasha Levin
6.18-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: dropped the nonexistent dev_mc_genid and rtnl_net_flush_workqueue() context lines, keeping only the added dev_unreg_pending field and wait_event(), with fuzz in netdev_run_todo(). ]
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 9a1d7ef17c4e9..9f16cca93227b 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 f7e672a4a39f7..7b88c6b8aa4f9 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10832,6 +10832,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,
@@ -11721,6 +11729,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;
}
@@ -11732,8 +11741,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);
@@ -11752,6 +11764,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);
@@ -13079,6 +13093,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
@@ -13106,6 +13131,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] 139+ messages in thread
* [PATCH 6.18 025/703] ksmbd: pin parent dentries in SMB2 CREATE ACL path
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 024/703] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 026/703] ksmbd: refuse to read a handle that is not open for reading Greg Kroah-Hartman
` (112 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Jiwoo Kim, Namjae Jeon,
Sasha Levin
6.18-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> context include and changed const struct mnt_idmap *idmap to non-const struct mnt_idmap *idmap to match the older tree's code. ]
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 aae6e9adf2e84..c46b537bdab8a 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -3438,16 +3438,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;
@@ -3501,10 +3517,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] 139+ messages in thread
* [PATCH 6.18 026/703] ksmbd: refuse to read a handle that is not open for reading
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 025/703] ksmbd: pin parent dentries in SMB2 CREATE ACL path Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 027/703] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
` (111 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wahid Khan, Ian Bridges, Namjae Jeon,
Sasha Levin
6.18-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 466a0853dc486..96ec655d61900 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -393,6 +393,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] 139+ messages in thread
* [PATCH 6.18 027/703] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 026/703] ksmbd: refuse to read a handle that is not open for reading Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 028/703] comedi: comedi_bond: Fix leak of opened device references Greg Kroah-Hartman
` (110 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Sasha Levin
6.18-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: Re-indented the BTF field loop one level deeper, and used mtype in place of the upstream container_type helper variable, because this tree has the loop inline instead of a separate helper. ]
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 ac31528b981b6..33fb1a42bbad3 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -439,6 +439,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:
@@ -476,10 +488,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 */
@@ -632,6 +640,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(btf, field->type, NULL);
+ if (!type) {
+ trace_probe_log_err(ctx->offset, BAD_BTF_TID);
+ return -EINVAL;
+ }
+
/* Accumulate the bit-offsets of the dot-connected fields */
if (btf_type_kflag(mtype)) {
bitoffs += BTF_MEMBER_BIT_OFFSET(field->offset);
@@ -639,12 +653,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(btf, field->type, NULL);
- 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;
@@ -790,13 +807,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);
@@ -805,9 +831,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;
}
@@ -891,6 +921,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);
@@ -1570,7 +1601,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] 139+ messages in thread
* [PATCH 6.18 028/703] comedi: comedi_bond: Fix leak of opened device references
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 027/703] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 029/703] rust_binder: push BR_TRANSACTION_COMPLETE before BR_FAILED_REPLY Greg Kroah-Hartman
` (109 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Wentao Liang, Ian Abbott,
Sasha Levin
6.18-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] 139+ messages in thread
* [PATCH 6.18 029/703] rust_binder: push BR_TRANSACTION_COMPLETE before BR_FAILED_REPLY
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 028/703] comedi: comedi_bond: Fix leak of opened device references Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 030/703] 8021q: use RCU for egress QoS mappings Greg Kroah-Hartman
` (108 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alice Ryhl, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alice Ryhl <aliceryhl@google.com>
commit ff9de8571f05e8f62f9cbe29f38e0aedda9389cf upstream.
When building a reply fails in Thread::reply_inner(), BR_FAILED_REPLY is
delivered to the caller before BR_TRANSACTION_COMPLETE is pushed to the
replying thread's work list.
In a nested transaction, the caller can wake up upon receiving
BR_FAILED_REPLY and send an outer reply to the replying thread before
BR_TRANSACTION_COMPLETE is queued. This causes the outer BR_REPLY to
arrive ahead of BR_TRANSACTION_COMPLETE, which is not legal. This leads
to userspace tripping on an assertion.
Thus, push BR_TRANSACTION_COMPLETE in Thread::reply_inner() before
delivering BR_FAILED_REPLY to the caller.
As a nice side effect, this lets us remove the now-unused
BR_TRANSACTION_COMPLETE error path in Thread::transaction().
Cc: stable@vger.kernel.org
Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver")
Link: https://patch.msgid.link/20261028-binder-reply-fail-v1-1-8b71d4daaf1d@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[aliceryhl: resolve conflicts in Thread::transaction() and reply_inner()]
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/android/binder/error.rs | 1 -
drivers/android/binder/thread.rs | 46 +++++++++++++++-----------------
2 files changed, 21 insertions(+), 26 deletions(-)
diff --git a/drivers/android/binder/error.rs b/drivers/android/binder/error.rs
index fd9e9d9e5658b..4b5689cdb2b8e 100644
--- a/drivers/android/binder/error.rs
+++ b/drivers/android/binder/error.rs
@@ -78,7 +78,6 @@ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
BR_DEAD_REPLY => f.pad("BR_DEAD_REPLY"),
BR_FROZEN_REPLY => f.pad("BR_FROZEN_REPLY"),
BR_TRANSACTION_PENDING_FROZEN => f.pad("BR_TRANSACTION_PENDING_FROZEN"),
- BR_TRANSACTION_COMPLETE => f.pad("BR_TRANSACTION_COMPLETE"),
_ => match self.source.as_ref() {
Some(source) => source.fmt(f),
None => self.reply.fmt(f),
diff --git a/drivers/android/binder/thread.rs b/drivers/android/binder/thread.rs
index e2320704c722e..5ae26faaf13bc 100644
--- a/drivers/android/binder/thread.rs
+++ b/drivers/android/binder/thread.rs
@@ -1262,26 +1262,25 @@ fn transaction(self: &Arc<Self>, cmd: u32, reader: &mut UserSliceReader) -> Resu
self.transaction_inner(&mut info)
};
+ // This runs when a transaction fails with an error returned to the caller.
if let Err(err) = ret {
self.push_return_work(err.reply);
- if err.reply != BR_TRANSACTION_COMPLETE {
- info.reply = err.reply;
- if let Some(source) = &err.source {
- info.errno = source.to_errno();
-
- {
- let mut inner = self.inner.lock();
- inner.extended_error =
- ExtendedError::new(info.debug_id as u32, err.reply, source.to_errno());
- }
-
- pr_warn!(
- "{}:{} transaction to {} failed: {err:?}",
- info.from_pid,
- info.from_tid,
- info.to_pid
- );
+ info.reply = err.reply;
+ if let Some(source) = &err.source {
+ info.errno = source.to_errno();
+
+ {
+ let mut inner = self.inner.lock();
+ inner.extended_error =
+ ExtendedError::new(info.debug_id as u32, err.reply, source.to_errno());
}
+
+ pr_warn!(
+ "{}:{} transaction to {} failed: {err:?}",
+ info.from_pid,
+ info.from_tid,
+ info.to_pid
+ );
}
}
@@ -1336,7 +1335,7 @@ fn reply_inner(self: &Arc<Self>, info: &mut TransactionInfo) -> BinderResult {
info.to_pid = orig.from.process.task.pid();
// We need to complete the transaction even if we cannot complete building the reply.
- let out = (|| -> BinderResult<_> {
+ if let Err(err) = (|| -> BinderResult<_> {
let completion = DTRWrap::arc_try_new(DeliverCode::new(BR_TRANSACTION_COMPLETE))?;
let process = orig.from.process.clone();
let allow_fds = orig.flags & TF_ACCEPT_FDS != 0;
@@ -1344,11 +1343,10 @@ fn reply_inner(self: &Arc<Self>, info: &mut TransactionInfo) -> BinderResult {
self.inner.lock().push_work(completion);
orig.from.deliver_reply(Ok(reply), &orig, None);
Ok(())
- })()
- .map_err(|mut err| {
+ })() {
// At this point we only return `BR_TRANSACTION_COMPLETE` to the caller, and we must let
// the sender know that the transaction has completed (with an error in this case).
-
+ self.push_return_work(BR_TRANSACTION_COMPLETE);
pr_warn!(
"{}:{} reply to {} failed: {err:?}",
info.from_pid,
@@ -1360,11 +1358,9 @@ fn reply_inner(self: &Arc<Self>, info: &mut TransactionInfo) -> BinderResult {
let ee = ExtendedError::new(info.debug_id as u32, err.reply, param);
orig.from
.deliver_reply(Err(BR_FAILED_REPLY), &orig, Some(ee));
- err.reply = BR_TRANSACTION_COMPLETE;
- err
- });
+ }
- out
+ Ok(())
}
fn oneway_transaction_inner(self: &Arc<Self>, info: &mut TransactionInfo) -> BinderResult {
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 030/703] 8021q: use RCU for egress QoS mappings
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 029/703] rust_binder: push BR_TRANSACTION_COMPLETE before BR_FAILED_REPLY Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 031/703] 8021q: delete cleared " Greg Kroah-Hartman
` (107 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Tan, Longxuan Yu, Ren Wei,
Paolo Abeni, Artem Dinaburg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Longxuan Yu <ylong030@ucr.edu>
[ Upstream commit fc69decc811b155a0ed8eef17ee940f28c4f6dbc ]
The TX fast path and reporting paths walk egress QoS mappings without
RTNL. Convert the mapping lists to RCU-protected pointers, use RCU
reader annotations in readers, and defer freeing mapping nodes with an
embedded rcu_head.
This prepares the egress QoS mapping code for safe removal of mapping
nodes in a follow-up change while preserving the current behavior.
Co-developed-by: Yuan Tan <yuantan098@gmail.com>
Signed-off-by: Yuan Tan <yuantan098@gmail.com>
Signed-off-by: Longxuan Yu <ylong030@ucr.edu>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Link: https://patch.msgid.link/9136768189f8c6d3f824f476c62d2fa1111688e8.1776647968.git.yuantan098@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ Backport to 6.18.y: context adjusted in vlan_dev_set_egress_priority();
6.18.y predates the kmalloc_obj() conversion. No functional change
from upstream. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/if_vlan.h | 25 ++++++++++++++++---------
net/8021q/vlan_dev.c | 31 ++++++++++++++++---------------
net/8021q/vlan_netlink.c | 10 ++++++----
net/8021q/vlanproc.c | 12 ++++++++----
4 files changed, 46 insertions(+), 32 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 89472ba4425f0..2c30c5b62fb59 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -147,11 +147,13 @@ extern __be16 vlan_dev_vlan_proto(const struct net_device *dev);
* @priority: skb priority
* @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000
* @next: pointer to next struct
+ * @rcu: used for deferred freeing of mapping nodes
*/
struct vlan_priority_tci_mapping {
u32 priority;
u16 vlan_qos;
- struct vlan_priority_tci_mapping *next;
+ struct vlan_priority_tci_mapping __rcu *next;
+ struct rcu_head rcu;
};
struct proc_dir_entry;
@@ -177,7 +179,7 @@ struct vlan_dev_priv {
unsigned int nr_ingress_mappings;
u32 ingress_priority_map[8];
unsigned int nr_egress_mappings;
- struct vlan_priority_tci_mapping *egress_priority_map[16];
+ struct vlan_priority_tci_mapping __rcu *egress_priority_map[16];
__be16 vlan_proto;
u16 vlan_id;
@@ -209,19 +211,24 @@ static inline u16
vlan_dev_get_egress_qos_mask(struct net_device *dev, u32 skprio)
{
struct vlan_priority_tci_mapping *mp;
+ u16 vlan_qos = 0;
- smp_rmb(); /* coupled with smp_wmb() in vlan_dev_set_egress_priority() */
+ rcu_read_lock();
- mp = vlan_dev_priv(dev)->egress_priority_map[(skprio & 0xF)];
+ mp = rcu_dereference(vlan_dev_priv(dev)->egress_priority_map[skprio & 0xF]);
while (mp) {
if (mp->priority == skprio) {
- return mp->vlan_qos; /* This should already be shifted
- * to mask correctly with the
- * VLAN's TCI */
+ vlan_qos = READ_ONCE(mp->vlan_qos);
+ break;
}
- mp = mp->next;
+ mp = rcu_dereference(mp->next);
}
- return 0;
+ rcu_read_unlock();
+
+ /* This should already be shifted to mask correctly with
+ * the VLAN's TCI.
+ */
+ return vlan_qos;
}
extern bool vlan_do_receive(struct sk_buff **skb);
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 27b84c4120082..f86f6b7706099 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -208,39 +208,34 @@ int vlan_dev_set_egress_priority(const struct net_device *dev,
u32 skb_prio, u16 vlan_prio)
{
struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
- struct vlan_priority_tci_mapping *mp = NULL;
+ struct vlan_priority_tci_mapping *mp;
struct vlan_priority_tci_mapping *np;
+ u32 bucket = skb_prio & 0xF;
u32 vlan_qos = (vlan_prio << VLAN_PRIO_SHIFT) & VLAN_PRIO_MASK;
/* See if a priority mapping exists.. */
- mp = vlan->egress_priority_map[skb_prio & 0xF];
+ mp = rtnl_dereference(vlan->egress_priority_map[bucket]);
while (mp) {
if (mp->priority == skb_prio) {
if (mp->vlan_qos && !vlan_qos)
vlan->nr_egress_mappings--;
else if (!mp->vlan_qos && vlan_qos)
vlan->nr_egress_mappings++;
- mp->vlan_qos = vlan_qos;
+ WRITE_ONCE(mp->vlan_qos, vlan_qos);
return 0;
}
- mp = mp->next;
+ mp = rtnl_dereference(mp->next);
}
/* Create a new mapping then. */
- mp = vlan->egress_priority_map[skb_prio & 0xF];
np = kmalloc(sizeof(struct vlan_priority_tci_mapping), GFP_KERNEL);
if (!np)
return -ENOBUFS;
- np->next = mp;
np->priority = skb_prio;
np->vlan_qos = vlan_qos;
- /* Before inserting this element in hash table, make sure all its fields
- * are committed to memory.
- * coupled with smp_rmb() in vlan_dev_get_egress_qos_mask()
- */
- smp_wmb();
- vlan->egress_priority_map[skb_prio & 0xF] = np;
+ RCU_INIT_POINTER(np->next, rtnl_dereference(vlan->egress_priority_map[bucket]));
+ rcu_assign_pointer(vlan->egress_priority_map[bucket], np);
if (vlan_qos)
vlan->nr_egress_mappings++;
return 0;
@@ -616,11 +611,17 @@ void vlan_dev_free_egress_priority(const struct net_device *dev)
int i;
for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) {
- while ((pm = vlan->egress_priority_map[i]) != NULL) {
- vlan->egress_priority_map[i] = pm->next;
- kfree(pm);
+ pm = rtnl_dereference(vlan->egress_priority_map[i]);
+ RCU_INIT_POINTER(vlan->egress_priority_map[i], NULL);
+ while (pm) {
+ struct vlan_priority_tci_mapping *next;
+
+ next = rtnl_dereference(pm->next);
+ kfree_rcu(pm, rcu);
+ pm = next;
}
}
+ vlan->nr_egress_mappings = 0;
}
static void vlan_dev_uninit(struct net_device *dev)
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index a000b1ef05206..a5b16833e2cee 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -260,13 +260,15 @@ static int vlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
goto nla_put_failure;
for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) {
- for (pm = vlan->egress_priority_map[i]; pm;
- pm = pm->next) {
- if (!pm->vlan_qos)
+ for (pm = rcu_dereference_rtnl(vlan->egress_priority_map[i]); pm;
+ pm = rcu_dereference_rtnl(pm->next)) {
+ u16 vlan_qos = READ_ONCE(pm->vlan_qos);
+
+ if (!vlan_qos)
continue;
m.from = pm->priority;
- m.to = (pm->vlan_qos >> 13) & 0x7;
+ m.to = (vlan_qos >> 13) & 0x7;
if (nla_put(skb, IFLA_VLAN_QOS_MAPPING,
sizeof(m), &m))
goto nla_put_failure;
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index fa67374bda494..0e424e0895b7e 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -262,15 +262,19 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
vlan->ingress_priority_map[7]);
seq_printf(seq, " EGRESS priority mappings: ");
+ rcu_read_lock();
for (i = 0; i < 16; i++) {
- const struct vlan_priority_tci_mapping *mp
- = vlan->egress_priority_map[i];
+ const struct vlan_priority_tci_mapping *mp =
+ rcu_dereference(vlan->egress_priority_map[i]);
while (mp) {
+ u16 vlan_qos = READ_ONCE(mp->vlan_qos);
+
seq_printf(seq, "%u:%d ",
- mp->priority, ((mp->vlan_qos >> 13) & 0x7));
- mp = mp->next;
+ mp->priority, ((vlan_qos >> 13) & 0x7));
+ mp = rcu_dereference(mp->next);
}
}
+ rcu_read_unlock();
seq_puts(seq, "\n");
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 031/703] 8021q: delete cleared egress QoS mappings
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 030/703] 8021q: use RCU for egress QoS mappings Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 032/703] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
` (106 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Yifan Wu, Juefei Pu, Xin Liu,
Yuan Tan, Longxuan Yu, Ren Wei, Paolo Abeni, Artem Dinaburg,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Longxuan Yu <ylong030@ucr.edu>
[ Upstream commit 7dddc74af369478ba7f9bc136d0fc1dc4570cb66 ]
vlan_dev_set_egress_priority() currently keeps cleared egress
priority mappings in the hash as tombstones. Repeated set/clear cycles
with distinct skb priorities therefore accumulate mapping nodes until
device teardown and leak memory.
Delete mappings when vlan_prio is cleared instead of keeping tombstones.
Now that the egress mapping lists are RCU protected, the node can be
unlinked safely and freed after a grace period.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@kernel.org
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Co-developed-by: Yuan Tan <yuantan098@gmail.com>
Signed-off-by: Yuan Tan <yuantan098@gmail.com>
Signed-off-by: Longxuan Yu <ylong030@ucr.edu>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Link: https://patch.msgid.link/ecfa6f6ce2467a42647ff4c5221238ae85b79a59.1776647968.git.yuantan098@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
[ Backport to 6.18.y: context adjusted in vlan_dev_set_egress_priority();
6.18.y predates the kmalloc_obj() conversion. No functional change
from upstream. ]
Signed-off-by: Artem Dinaburg <artem@trailofbits.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/8021q/vlan_dev.c | 20 ++++++++++++++------
net/8021q/vlan_netlink.c | 4 ----
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index f86f6b7706099..5b4ac6c127f08 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -208,26 +208,34 @@ int vlan_dev_set_egress_priority(const struct net_device *dev,
u32 skb_prio, u16 vlan_prio)
{
struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
+ struct vlan_priority_tci_mapping __rcu **mpp;
struct vlan_priority_tci_mapping *mp;
struct vlan_priority_tci_mapping *np;
u32 bucket = skb_prio & 0xF;
u32 vlan_qos = (vlan_prio << VLAN_PRIO_SHIFT) & VLAN_PRIO_MASK;
/* See if a priority mapping exists.. */
- mp = rtnl_dereference(vlan->egress_priority_map[bucket]);
+ mpp = &vlan->egress_priority_map[bucket];
+ mp = rtnl_dereference(*mpp);
while (mp) {
if (mp->priority == skb_prio) {
- if (mp->vlan_qos && !vlan_qos)
+ if (!vlan_qos) {
+ rcu_assign_pointer(*mpp, rtnl_dereference(mp->next));
vlan->nr_egress_mappings--;
- else if (!mp->vlan_qos && vlan_qos)
- vlan->nr_egress_mappings++;
- WRITE_ONCE(mp->vlan_qos, vlan_qos);
+ kfree_rcu(mp, rcu);
+ } else {
+ WRITE_ONCE(mp->vlan_qos, vlan_qos);
+ }
return 0;
}
- mp = rtnl_dereference(mp->next);
+ mpp = &mp->next;
+ mp = rtnl_dereference(*mpp);
}
/* Create a new mapping then. */
+ if (!vlan_qos)
+ return 0;
+
np = kmalloc(sizeof(struct vlan_priority_tci_mapping), GFP_KERNEL);
if (!np)
return -ENOBUFS;
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index a5b16833e2cee..368d53ca7d870 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -263,10 +263,6 @@ static int vlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
for (pm = rcu_dereference_rtnl(vlan->egress_priority_map[i]); pm;
pm = rcu_dereference_rtnl(pm->next)) {
u16 vlan_qos = READ_ONCE(pm->vlan_qos);
-
- if (!vlan_qos)
- continue;
-
m.from = pm->priority;
m.to = (vlan_qos >> 13) & 0x7;
if (nla_put(skb, IFLA_VLAN_QOS_MAPPING,
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 032/703] Bluetooth: btusb: fix use-after-free in force_poll_sync
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 031/703] 8021q: delete cleared " Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 033/703] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
` (105 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Bin Yu, Cheng Wen,
Luiz Augusto von Dentz, YuanZhe Liu, Sasha Levin
6.18-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 6143414711c5d..99bee6e6d286f 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1018,6 +1018,8 @@ struct btusb_data {
int oob_wake_irq; /* irq for out-of-band wake-on-bt */
+ struct dentry *force_poll_sync_dentry;
+
struct qca_dump_info qca_dump;
};
@@ -4418,8 +4420,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;
@@ -4455,6 +4458,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] 139+ messages in thread
* [PATCH 6.18 033/703] tools/bootconfig: Close only opened braces in compact output
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 032/703] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 034/703] ipv6: Remove IPV6_ADDRFORM Greg Kroah-Hartman
` (104 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Eduardo Mucelli Rezende Oliveira, Sasha Levin
6.18-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 6f5d60045f90b..43f0a7fa87c9b 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -39,6 +39,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;
@@ -99,14 +116,12 @@ static void xbc_show_compact_tree(void)
node = xbc_node_get_parent(node);
if (!node)
return;
- if (!xbc_node_get_child(node)->next)
+ if (!depth || !xbc_node_needs_braces(node))
continue;
- if (depth) {
- depth--;
- for (i = 0; i < depth; i++)
- printf("\t");
- printf("}\n");
- }
+ depth--;
+ for (i = 0; i < depth; i++)
+ printf("\t");
+ printf("}\n");
}
node = xbc_node_get_next(node);
}
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 d6211efe6dbee..615f5f72ff1a5 100755
--- a/tools/bootconfig/test-bootconfig.sh
+++ b/tools/bootconfig/test-bootconfig.sh
@@ -200,6 +200,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] 139+ messages in thread
* [PATCH 6.18 034/703] ipv6: Remove IPV6_ADDRFORM.
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 033/703] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 035/703] sched_ext: Read exit_kind before flushing in scx_flush_disable_work() Greg Kroah-Hartman
` (103 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Daehyeon Ko, Hyunwoo Kim,
Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
6.18-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.18.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 ec09620f40f70..e3b4c1af30917 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -122,7 +122,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 857790b478e97..ed625b8ac32ab 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -771,7 +771,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);
@@ -3901,7 +3901,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);
@@ -3923,7 +3922,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 72cb7d9aee910..a581289384795 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -577,7 +577,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)
@@ -778,7 +777,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)
@@ -863,7 +861,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 1c45e1d15506c..6301428bb6c16 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);
@@ -671,7 +668,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);
return INDIRECT_CALL_2(prot->recvmsg, tcp_recvmsg, udpv6_recvmsg,
sk, msg, size, flags);
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index d784a8644ff20..f4a84817579e6 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -548,93 +548,7 @@ int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
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)
@@ -1096,15 +1010,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] 139+ messages in thread
* [PATCH 6.18 035/703] sched_ext: Read exit_kind before flushing in scx_flush_disable_work()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 034/703] ipv6: Remove IPV6_ADDRFORM Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 036/703] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
` (102 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Kuba Piecuch, Andrea Righi,
Tejun Heo, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kuba Piecuch <jpiecuch@google.com>
[ Upstream commit 3133107d98057595c0af39ff907c852134926912 ]
scx_disable_workfn() sets exit_kind to SCX_EXIT_DONE before it tears the
scheduler down. scx_flush_disable_work() reads exit_kind after syncing
disable_irq_work and flushing disable_work, so it can observe DONE from
a disable_work that was queued after its flush and return while the
teardown is still running:
CPU A CPU B
----- -----
scx_vexit()
scx_claim_exit() -> true
bpf_struct_ops_map_link_detach()
bpf_scx_unreg()
scx_disable()
scx_claim_exit() -> false
scx_flush_disable_work()
irq_work_sync() // not queued
kthread_flush_work() // not queued
irq_work_queue()
scx_disable_irq_workfn()
kthread_queue_work()
scx_disable_workfn()
exit_kind = SCX_EXIT_DONE
scx_root_disable()
atomic_read() -> SCX_EXIT_DONE
bpf_map_put()
Once bpf_scx_unreg() returns, its caller drops the struct_ops map
reference, and the struct_ops trampolines can be freed while
scx_root_disable() is still running and can still call into the BPF
scheduler, e.g. ops.exit().
Read exit_kind before syncing and flushing, with acquire ordering paired
with the atomic_try_cmpxchg() in scx_disable_workfn(). DONE is only set
from disable_work, so once it is observed, the following
kthread_flush_work() sees the queued work and waits for the teardown to
finish.
This patch was created with the help of an AI coding assistant.
Fixes: d99f7a32f09d ("sched_ext: Fix scx_flush_disable_work() UAF race")
Cc: stable@vger.kernel.org # v7.1+
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/sashiko-outbox-195908@kernel.org/
Signed-off-by: Kuba Piecuch <jpiecuch@google.com>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ jpiecuch: applied kernel/sched/ext/ext.c hunk to kernel/sched/ext.c;
kept error_irq_work instead of disable_irq_work. ]
Signed-off-by: Kuba Piecuch <jpiecuch@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/ext.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index b3a6d60709403..64a68d698b823 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -4247,10 +4247,17 @@ static void scx_flush_disable_work(struct scx_sched *sch)
{
int kind;
+ /*
+ * scx_disable_workfn() sets SCX_EXIT_DONE before tearing down. Read
+ * exit_kind with acquire ordering (paired with atomic_try_cmpxchg() in
+ * scx_disable_workfn()) before syncing and flushing so that, once DONE
+ * is seen, the following flush observes the queued work and waits for
+ * the teardown to finish.
+ */
do {
+ kind = atomic_read_acquire(&sch->exit_kind);
irq_work_sync(&sch->error_irq_work);
kthread_flush_work(&sch->disable_work);
- kind = atomic_read(&sch->exit_kind);
} while (kind != SCX_EXIT_NONE && kind != SCX_EXIT_DONE);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 036/703] iio: proximity: sx9360: fix sampling frequency write and available range
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 035/703] sched_ext: Read exit_kind before flushing in scx_flush_disable_work() Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 037/703] kprobes: Switch ftrace ops when adding probe with post_handler Greg Kroah-Hartman
` (101 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arnav Kapoor, Jonathan Cameron,
Sasha Levin
6.18-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/mod_devicetable.h> is still included here and the ID
tables carry driver data. ]
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 4448988d4e7eb..7bb54eb7b1c89 100644
--- a/drivers/iio/proximity/sx9360.c
+++ b/drivers/iio/proximity/sx9360.c
@@ -14,11 +14,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>
@@ -44,6 +46,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)
@@ -183,9 +186,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[] = {
@@ -384,11 +387,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] 139+ messages in thread
* [PATCH 6.18 037/703] kprobes: Switch ftrace ops when adding probe with post_handler
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 036/703] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 038/703] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
` (100 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
[ Upstream commit f60f98881b54b0cf36b61f41c91fbd93b76a2d9c ]
When an ftrace-based kprobe is registered without a post_handler, it is
armed using kprobe_ftrace_ops. If a second probe with a post_handler is
subsequently registered at the same address, register_aggr_kprobe() sets
ap->post_handler to aggr_post_handler, but leaves the probe armed using
kprobe_ftrace_ops.
When the probe is later disarmed or disabled, disarm_kprobe_ftrace()
checks whether p->post_handler is non-NULL and attempts to disarm from
kprobe_ipmodify_ops. This fails with -ENOENT, decrements
kprobe_ipmodify_enabled below zero, leaves the probe armed on
kprobe_ftrace_ops, and aborts unregistration, leading to a use-after-free
if the probe module is unloaded.
Switch the armed probe from kprobe_ftrace_ops to kprobe_ipmodify_ops in
register_aggr_kprobe() outside of text_mutex and cpus_read_lock to avoid
lockdep and deadlock issues when modifying ftrace code. Defer adding the
new probe onto ap->list until the ftrace ops switch completes so that the
new probe's handlers are not published prematurely while ap is still on
kprobe_ftrace_ops, and mark ap disabled if rollback re-arming fails.
Also restore ftrace ops registration and counter if ftrace_set_filter_ip()
fails in __disarm_kprobe_ftrace().
Link: https://lore.kernel.org/all/179440641120.328088.15542754095040659094.stgit@devnote2/
Fixes: 5dd7caf0bdc5 ("kprobes: Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/kprobes.c | 55 +++++++++++++++++++++++++++++++++++++++---------
1 file changed, 45 insertions(+), 10 deletions(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index a180911d31d58..9b4447879a2ef 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1120,9 +1120,14 @@ static int __disarm_kprobe_ftrace(struct kprobe *p, struct ftrace_ops *ops,
(*cnt)--;
ret = ftrace_set_filter_ip(ops, (unsigned long)p->addr, 1, 0);
- WARN_ONCE(ret < 0, "Failed to disarm kprobe-ftrace at %pS (error %d)\n",
- p->addr, ret);
- return ret;
+ if (WARN_ONCE(ret < 0, "Failed to disarm kprobe-ftrace at %pS (error %d)\n",
+ p->addr, ret)) {
+ if (*cnt == 0)
+ register_ftrace_function(ops);
+ (*cnt)++;
+ return ret;
+ }
+ return 0;
}
static int disarm_kprobe_ftrace(struct kprobe *p)
@@ -1251,16 +1256,12 @@ void kprobe_busy_end(void)
}
/* Add the new probe to 'ap->list'. */
-static int add_new_kprobe(struct kprobe *ap, struct kprobe *p)
+static void add_new_kprobe(struct kprobe *ap, struct kprobe *p)
{
if (p->post_handler)
unoptimize_kprobe(ap, true); /* Fall back to normal kprobe */
list_add_rcu(&p->list, &ap->list);
- if (p->post_handler && !ap->post_handler)
- ap->post_handler = aggr_post_handler;
-
- return 0;
}
/*
@@ -1293,6 +1294,8 @@ static int register_aggr_kprobe(struct kprobe *orig_p, struct kprobe *p)
{
int ret = 0;
struct kprobe *ap = orig_p;
+ bool reset_post_handler = false;
+ bool ftrace_switch_ops = false;
scoped_guard(cpus_read_lock) {
/* For preparing optimization, jump_label_text_reserved() is called */
@@ -1339,18 +1342,50 @@ static int register_aggr_kprobe(struct kprobe *orig_p, struct kprobe *p)
| KPROBE_FLAG_DISABLED;
}
+ if (p->post_handler && !ap->post_handler) {
+ reset_post_handler = true;
+ if (kprobe_ftrace(ap) && !kprobes_all_disarmed &&
+ !kprobe_disabled(ap))
+ ftrace_switch_ops = true;
+ else
+ ap->post_handler = aggr_post_handler;
+ }
+
/* Copy the insn slot of 'p' to 'ap'. */
copy_kprobe(ap, p);
- ret = add_new_kprobe(ap, p);
+ if (!ftrace_switch_ops)
+ add_new_kprobe(ap, p);
+ }
+
+ if (ftrace_switch_ops) {
+ /*
+ * Must switch ftrace ops outside of text_mutex and cpus_read_lock
+ * to prevent deadlocks when ftrace code modification acquires text_mutex.
+ */
+ ret = disarm_kprobe_ftrace(ap);
+ if (ret)
+ return ret;
+
+ ap->post_handler = aggr_post_handler;
+ ret = arm_kprobe_ftrace(ap);
+ if (ret) {
+ ap->post_handler = NULL;
+ if (arm_kprobe_ftrace(ap))
+ ap->flags |= KPROBE_FLAG_DISABLED;
+ return ret;
+ }
+ add_new_kprobe(ap, p);
}
- if (ret == 0 && kprobe_disabled(ap) && !kprobe_disabled(p)) {
+ if (kprobe_disabled(ap) && !kprobe_disabled(p)) {
ap->flags &= ~KPROBE_FLAG_DISABLED;
if (!kprobes_all_disarmed) {
/* Arm the breakpoint again. */
ret = arm_kprobe(ap);
if (ret) {
ap->flags |= KPROBE_FLAG_DISABLED;
+ if (reset_post_handler)
+ ap->post_handler = NULL;
list_del_rcu(&p->list);
synchronize_rcu();
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 038/703] KEYS: Expand key->{datalen,quotalen} to unsigned int
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 037/703] kprobes: Switch ftrace ops when adding probe with post_handler Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 039/703] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Greg Kroah-Hartman
` (99 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Eric Biggers,
Jarkko Sakkinen, Sasha Levin
6.18-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: Dropped the context lines using the smb_EIO1/smb_EIO2 helpers, which don't exist here, keeping plain -EIO, and applied only the %hu to %u change in the cifs_dbg strings. ]
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 9dcda4c244c3b..f14ca1cbd31f1 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;
}
@@ -430,7 +430,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 77efb30bb73cf..3b8af14fb3239 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] 139+ messages in thread
* [PATCH 6.18 039/703] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 038/703] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 040/703] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
` (98 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mohammed EL Kadiri, Jarkko Sakkinen,
Sasha Levin
6.18-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] 139+ messages in thread
* [PATCH 6.18 040/703] KEYS: Protect pkey method checks against type removal
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 039/703] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Greg Kroah-Hartman
@ 2026-12-04 9:58 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 041/703] btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT Greg Kroah-Hartman
` (97 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:58 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuansheng Yang, Jarkko Sakkinen,
Sasha Levin
6.18-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] 139+ messages in thread
* [PATCH 6.18 041/703] btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2026-12-04 9:58 ` [PATCH 6.18 040/703] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 042/703] tcp: move __reqsk_free() out of line Greg Kroah-Hartman
` (96 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Qu Wenruo, Cheng Yongkang, Qu Wenruo,
David Sterba, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cheng Yongkang <teel4res@gmail.com>
[ Upstream commit 9a58e56e70f610e29b53821e9c706600e529cca3 ]
btrfs_ioctl_subvol_sync() assumes that a cached root with zero
references has BTRFS_ROOT_SUBVOL_DEAD set, and asserts that before
waiting for the cleaner. Two states break the assumption:
- A corrupt ROOT_ITEM with zero references and a matching orphan item,
on a writable filesystem.
- A failed subvolume deletion. btrfs_delete_subvolume() zeroes the
root references, aborts the transaction, which forces the filesystem
read-only, and then clears DEAD again. No on-disk metadata is
corrupted in this case.
With CONFIG_BTRFS_ASSERT=y, both reach a BUG().
Change the ASSERT() into a proper rejection to avoid triggering a BUG().
Fixes: 6c83d153ed86 ("btrfs: add new ioctl to wait for cleaned subvolumes")
CC: stable@vger.kernel.org
Suggested-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Link: https://lore.kernel.org/linux-btrfs/dd97efe9-91ec-495b-b698-acff1447421c@gmx.com/
Signed-off-by: Cheng Yongkang <teel4res@gmail.com>
[ Rework the commit message, drop the ad-hoc RW check. ]
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
[ sashal: The removed ASSERT() is the older one-line form, since this tree does not have the ASSERT() message conversion. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/ioctl.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 84305ed0dc70e..2bf61cf1fd6bb 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -5224,7 +5224,12 @@ static int btrfs_ioctl_subvol_sync(struct btrfs_fs_info *fs_info, void __user *a
return -ENOENT;
wait_for_deletion = true;
- ASSERT(root_flags & BTRFS_ROOT_SUBVOL_DEAD);
+ if (unlikely(!(root_flags & BTRFS_ROOT_SUBVOL_DEAD))) {
+ btrfs_err(fs_info,
+ "subvol %llu has refs 0 without DEAD flag",
+ args.subvolid);
+ return -EUCLEAN;
+ }
sched_ret = schedule_timeout_interruptible(HZ);
/* Early wake up or error. */
if (sched_ret != 0)
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 042/703] tcp: move __reqsk_free() out of line
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 041/703] btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 043/703] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
` (95 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Kuniyuki Iwashima,
Jakub Kicinski, Sasha Levin
6.18-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 cd4d4cf71d0d2..e5108d0b14d72 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -124,14 +124,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 1f75a4a94cad4..e70dd99c2f912 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -934,6 +934,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] 139+ messages in thread
* [PATCH 6.18 043/703] tcp: free saved_syn after an RCU grace period
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 042/703] tcp: move __reqsk_free() out of line Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 044/703] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
` (94 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yingjie Wang, Kuniyuki Iwashima,
Eric Dumazet, Jakub Kicinski, Sasha Levin
6.18-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 7cc2ddcd9bc0d..9796c101b22d2 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -604,13 +604,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 e5108d0b14d72..8717559d028b9 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -40,6 +40,7 @@ struct request_sock_ops {
};
struct saved_syn {
+ struct rcu_head rcu;
u32 mac_hdrlen;
u32 network_hdrlen;
u32 tcp_hdrlen;
@@ -69,7 +70,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 8b76dd1201038..ec8ce9faca0c5 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -5931,7 +5931,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 e70dd99c2f912..5f2ddb5a4ad23 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -897,7 +897,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;
@@ -939,7 +939,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);
@@ -1011,7 +1011,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 41db56f936f06..ec956f96b77eb 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -7454,7 +7454,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] 139+ messages in thread
* [PATCH 6.18 044/703] cgroup/cpuset: Correctly set isolated_cpus when switching partition state
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 043/703] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 045/703] arm64: suspend: rely on daif helpers to handle PMR Greg Kroah-Hartman
` (93 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Waiman Long, Ridong Chen, Tejun Heo,
Sasha Levin
6.18-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: Context differs because the tree lacks the PERR_ISOPARENT check and has a different if/else shape, and the selftest matrix has different neighboring rows; the two new selftest rows carry :S+, which test_cpuset_prs.sh still needs on this tree, and the other added lines are unchanged. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 21 ++++++++++++++++++-
.../selftests/cgroup/test_cpuset_prs.sh | 7 +++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 9bd1753dbcbe2..52eed70c2eb43 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -3235,7 +3235,26 @@ static int update_prstate(struct cpuset *cs, int new_prs)
disable_partition = true;
err = PERR_HKEEPING;
} else {
+ struct cgroup_subsys_state *css;
+ struct cpuset *child;
+
+ /*
+ * Need to scan child partitions, if present, and
+ * exclude their effective_xcpus from cs. In the case
+ * of switching to isolated partition with child root
+ * partitions, those child partitions will be
+ * invalidated in update_cpumasks_hier().
+ */
isolcpus_updated = true;
+ cpumask_copy(tmpmask.new_cpus, cs->effective_xcpus);
+ rcu_read_lock();
+ cpuset_for_each_child(child, css, cs) {
+ if (!is_partition_valid(child))
+ continue;
+ cpumask_andnot(tmpmask.new_cpus, tmpmask.new_cpus,
+ child->effective_xcpus);
+ }
+ rcu_read_unlock();
}
} else {
/*
@@ -3273,7 +3292,7 @@ static int update_prstate(struct cpuset *cs, int new_prs)
if (!is_partition_valid(cs))
reset_partition_data(cs);
else if (isolcpus_updated)
- isolated_cpus_update(old_prs, new_prs, cs->effective_xcpus);
+ isolated_cpus_update(old_prs, new_prs, tmpmask.new_cpus);
spin_unlock_irq(&callback_lock);
update_isolation_cpumasks(isolcpus_updated);
diff --git a/tools/testing/selftests/cgroup/test_cpuset_prs.sh b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
index 25eef20c17466..af083a527b24e 100755
--- a/tools/testing/selftests/cgroup/test_cpuset_prs.sh
+++ b/tools/testing/selftests/cgroup/test_cpuset_prs.sh
@@ -441,6 +441,13 @@ TEST_MATRIX=(
"C1-4:P1:S+ C3-4:P2 . . T:C4-6 . . . 0 A1:5-6|A2:4 A1:P1|A2:P2 4"
"C1-4:P1:S+ C1-2:P2 . . T:C4-6 . . . 0 A1:4-6|A2:4-6 A1:P1|A2:P-2 ."
+ # Switch PRS state (root <=> isolated) will properly update cpuset.cpus.isolated
+ # even if child partitions are present.
+ " C1-6:P1: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
# ------ ------ ------ ------ ------ ------ ------ ------ ---- ----- ------ --------
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 045/703] arm64: suspend: rely on daif helpers to handle PMR
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 044/703] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 046/703] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
` (92 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ada Couprie Diaz, Vladimir Murzin,
Jinjie Ruan, Will Deacon, Sasha Levin
6.18-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] 139+ messages in thread
* [PATCH 6.18 046/703] arm64: suspend: Only track cpuidle context for idle tasks
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 045/703] arm64: suspend: rely on daif helpers to handle PMR Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 047/703] cpufreq: Avoid redundant target() calls for unchanged limits Greg Kroah-Hartman
` (91 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+79883955da3a62652a80,
Uladzislau Zhauniarovich, Catalin Marinas, Sasha Levin
6.18-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] 139+ messages in thread
* [PATCH 6.18 047/703] cpufreq: Avoid redundant target() calls for unchanged limits
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 046/703] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 048/703] cpufreq: Force passing target frequency to driver during resume Greg Kroah-Hartman
` (90 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Viresh Kumar, Lifeng Zheng,
Zhongqiu Han, Rafael J. Wysocki, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Viresh Kumar <viresh.kumar@linaro.org>
[ Upstream commit 9801be8bef65dbcbc40c1a9c2f03d70ed67a5d30 ]
Drivers setting CPUFREQ_NEED_UPDATE_LIMITS expect target() to be
invoked even if the target frequency remains unchanged, so they can
update their internal policy limits state.
Currently the core invokes target() unconditionally whenever the
requested frequency matches policy->cur for such drivers, even if
policy->min and policy->max haven't changed since the previous update.
Track pending policy limit updates explicitly and skip redundant
target() invocations when neither the target frequency nor the
effective limits changed.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Link: https://patch.msgid.link/d0107c364b709abca21acf88072220bc05478594.1779423281.git.viresh.kumar@linaro.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 342d3a73c5db ("cpufreq: Force passing target frequency to driver during resume")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 31 ++++++++++++++++++++++---------
include/linux/cpufreq.h | 3 +++
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 962faa2463db6..94f611512cfc8 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2407,9 +2407,13 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
* exactly same freq is called again and so we can save on few function
* calls.
*/
- if (target_freq == policy->cur &&
- !(cpufreq_driver->flags & CPUFREQ_NEED_UPDATE_LIMITS))
- return 0;
+ if (target_freq == policy->cur) {
+ if (!(cpufreq_driver->flags & CPUFREQ_NEED_UPDATE_LIMITS) ||
+ !policy->update_limits)
+ return 0;
+
+ policy->update_limits = false;
+ }
if (cpufreq_driver->target) {
/*
@@ -2669,6 +2673,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
{
struct cpufreq_policy_data new_data;
struct cpufreq_governor *old_gov;
+ unsigned int freq;
int ret;
memcpy(&new_data.cpuinfo, &policy->cpuinfo, sizeof(policy->cpuinfo));
@@ -2701,12 +2706,20 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
* compiler optimizations around them because they may be accessed
* concurrently by cpufreq_driver_resolve_freq() during the update.
*/
- WRITE_ONCE(policy->max, __resolve_freq(policy, new_data.max,
- new_data.min, new_data.max,
- CPUFREQ_RELATION_H));
- new_data.min = __resolve_freq(policy, new_data.min, new_data.min,
- new_data.max, CPUFREQ_RELATION_L);
- WRITE_ONCE(policy->min, new_data.min > policy->max ? policy->max : new_data.min);
+ freq = __resolve_freq(policy, new_data.max, new_data.min, new_data.max,
+ CPUFREQ_RELATION_H);
+ if (freq != policy->max) {
+ WRITE_ONCE(policy->max, freq);
+ policy->update_limits = true;
+ }
+
+ freq = __resolve_freq(policy, new_data.min, new_data.min, new_data.max,
+ CPUFREQ_RELATION_L);
+ freq = min(freq, policy->max);
+ if (freq != policy->min) {
+ WRITE_ONCE(policy->min, freq);
+ policy->update_limits = true;
+ }
trace_cpu_frequency_limits(policy);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 69034172a7558..fa5d92d408a8c 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -145,6 +145,9 @@ struct cpufreq_policy {
/* Per policy boost supported flag. */
bool boost_supported;
+ /* Pending policy->min/max update for the driver */
+ bool update_limits;
+
/* The policy has been suspended. */
bool suspended;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 048/703] cpufreq: Force passing target frequency to driver during resume
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 047/703] cpufreq: Avoid redundant target() calls for unchanged limits Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 049/703] pNFS: avoid repeatedly cancelling I/O for the same lseg Greg Kroah-Hartman
` (89 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zak Brighton Knight, Doug Smythies,
Rafael J. Wysocki, Zhongqiu Han, Viresh Kumar, Christian Loehle,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 342d3a73c5dbc2f1cd0c5142e2d11bda4dc54cd7 ]
The policy->cur value preserved across a system suspend-resume cycle
may become stale in some cases and it may prevent the CPU performance
scaling logic from being updated due to the target_freq == policy->cur
check in __cpufreq_driver_target() [1].
To address this, adjust the existing mechanism to force the invocation
of the driver .target() callback in __cpufreq_driver_target() and make
cpufreq_resume_policy() use it.
This involves renaming update_limits in struct cpufreq_policy to
force_target and moving the driver CPUFREQ_NEED_UPDATE_LIMITS flag check
from __cpufreq_driver_target() to cpufreq_set_policy(), where it is used
as a condition for setting policy->force_target.
In cpufreq_resume_policy(), policy->force_target is set for drivers that
implement the .target() callback, but don't implement the .get() one,
which is the case when the driver callback needs to run if policy->cur
becomes stale while suspended.
Fixes: 2f0aea936360 ("cpufreq: suspend governors on system suspend/hibernate")
Link: https://lore.kernel.org/linux-pm/20261027143725.3763827-1-zakbrightonknight@gmail.com/ [1]
Reported-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reported-by: Doug Smythies <dsmythies@telus.net>
Cc: All applicable <stable@vger.kernel.org> # eee2a44e4e2b cpufreq: Improve suspend-resume synchronization
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Zak Brighton Knight <zakbrightonknight@gmail.com>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/1995295.tdWV9SEqCh@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 33 +++++++++++++++++++++------------
include/linux/cpufreq.h | 4 ++--
2 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 94f611512cfc8..cd2eb696548b7 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2029,6 +2029,15 @@ static void cpufreq_resume_policy(struct cpufreq_policy *policy, bool start)
if (!start)
return;
+ /*
+ * Force executing the driver .target() callback, if present, in the
+ * next invocation of __cpufreq_driver_target() in case policy->cur has
+ * become stale while suspended, but do it only for drivers without a
+ * .get() callback for which cpufreq_verify_current_freq() is a NOP.
+ */
+ if (cpufreq_driver->target && !cpufreq_driver->get)
+ policy->force_target = true;
+
if (cpufreq_start_governor(policy))
pr_err("%s: Failed to start governor for CPU%u's policy\n",
__func__, policy->cpu);
@@ -2402,17 +2411,14 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
policy->cpu, target_freq, relation, old_target_freq);
/*
- * This might look like a redundant call as we are checking it again
- * after finding index. But it is left intentionally for cases where
- * exactly same freq is called again and so we can save on few function
- * calls.
+ * Unless invoking the target callback is forced, skip the update if the
+ * frequency is not really changing.
*/
- if (target_freq == policy->cur) {
- if (!(cpufreq_driver->flags & CPUFREQ_NEED_UPDATE_LIMITS) ||
- !policy->update_limits)
- return 0;
-
- policy->update_limits = false;
+ if (policy->force_target) {
+ /* Avoid forcing the driver callback unnecessarily next time. */
+ policy->force_target = false;
+ } else if (target_freq == policy->cur) {
+ return 0;
}
if (cpufreq_driver->target) {
@@ -2671,6 +2677,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
struct cpufreq_governor *new_gov,
unsigned int new_pol)
{
+ bool need_update_limits = cpufreq_driver->flags & CPUFREQ_NEED_UPDATE_LIMITS;
struct cpufreq_policy_data new_data;
struct cpufreq_governor *old_gov;
unsigned int freq;
@@ -2710,7 +2717,8 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
CPUFREQ_RELATION_H);
if (freq != policy->max) {
WRITE_ONCE(policy->max, freq);
- policy->update_limits = true;
+ if (need_update_limits)
+ policy->force_target = true;
}
freq = __resolve_freq(policy, new_data.min, new_data.min, new_data.max,
@@ -2718,7 +2726,8 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
freq = min(freq, policy->max);
if (freq != policy->min) {
WRITE_ONCE(policy->min, freq);
- policy->update_limits = true;
+ if (need_update_limits)
+ policy->force_target = true;
}
trace_cpu_frequency_limits(policy);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index fa5d92d408a8c..2b896d30c35d8 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -145,8 +145,8 @@ struct cpufreq_policy {
/* Per policy boost supported flag. */
bool boost_supported;
- /* Pending policy->min/max update for the driver */
- bool update_limits;
+ /* Force passing target frequency to the driver. */
+ bool force_target;
/* The policy has been suspended. */
bool suspended;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 049/703] pNFS: avoid repeatedly cancelling I/O for the same lseg
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 048/703] cpufreq: Force passing target frequency to driver during resume Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 050/703] watchdog: rz: Discard pm_runtime_put() return values Greg Kroah-Hartman
` (88 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tim Menninger, Anna Schumaker,
Sasha Levin
6.18-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 ff_layout_cancel_io() hunk to this tree's older one-argument version with no devid filter or RCU, placing the cancelled_stripes guard after the mirror_ds check. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfs/flexfilelayout/flexfilelayout.c | 12 ++++++++++++
fs/nfs/flexfilelayout/flexfilelayout.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index f45508bd30f6e..48c769f05b8a2 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>
@@ -337,6 +338,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);
}
}
@@ -652,6 +654,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 * dss_count, 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__);
@@ -2548,6 +2556,10 @@ static void ff_layout_cancel_io(struct pnfs_layout_segment *lseg)
mirror_ds = mirror->dss[dss_id].mirror_ds;
if (IS_ERR_OR_NULL(mirror_ds))
continue;
+ /* Do not cancel a stripe again while this lseg drains. */
+ if (test_and_set_bit(idx * mirror->dss_count + dss_id,
+ flseg->cancelled_stripes))
+ continue;
ds = mirror->dss[dss_id].mirror_ds->ds;
if (!ds)
continue;
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h
index ec69cd1c3ae96..311df9306b055 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.h
+++ b/fs/nfs/flexfilelayout/flexfilelayout.h
@@ -109,6 +109,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] 139+ messages in thread
* [PATCH 6.18 050/703] watchdog: rz: Discard pm_runtime_put() return values
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 049/703] pNFS: avoid repeatedly cancelling I/O for the same lseg Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 051/703] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
` (87 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, Guenter Roeck,
Sasha Levin
6.18-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 1c9aa366d0a0e..509f9dffdacde 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 a1698dc50acd6..83540dd9a37b6 100644
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -174,9 +174,7 @@ static int rzv2h_wdt_stop(struct watchdog_device *wdev)
if (priv->of_data->wdtdcr)
rzt2h_wdt_wdtdcr_count_stop(priv);
- 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] 139+ messages in thread
* [PATCH 6.18 051/703] watchdog: rzv2h: Use pm_runtime_put_sync()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 050/703] watchdog: rz: Discard pm_runtime_put() return values Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 052/703] watchdog: rzv2h: Drop runtime PM handling from WDTDCR init Greg Kroah-Hartman
` (86 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lad Prabhakar, Guenter Roeck,
Sasha Levin
6.18-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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/watchdog/rzv2h_wdt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c
index 83540dd9a37b6..057b890de0b05 100644
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -174,7 +174,7 @@ static int rzv2h_wdt_stop(struct watchdog_device *wdev)
if (priv->of_data->wdtdcr)
rzt2h_wdt_wdtdcr_count_stop(priv);
- pm_runtime_put(wdev->parent);
+ pm_runtime_put_sync(wdev->parent);
return 0;
}
@@ -268,7 +268,7 @@ static int rzt2h_wdt_wdtdcr_init(struct platform_device *pdev,
rzt2h_wdt_wdtdcr_count_stop(priv);
- pm_runtime_put(&pdev->dev);
+ pm_runtime_put_sync(&pdev->dev);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 052/703] watchdog: rzv2h: Drop runtime PM handling from WDTDCR init
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 051/703] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 053/703] hwmon: (nct6775) Handle dual use registers Greg Kroah-Hartman
` (85 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lad Prabhakar, Guenter Roeck,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
[ Upstream commit f00afd5d8d5dc03994cb67246543d5c70571ebbe ]
WDTDCR is located in the CPG region, outside the watchdog module, and is
accessible regardless of the watchdog's clocks and reset state.
Drop the unnecessary runtime PM handling from WDTDCR initialization and
access the register directly.
Fixes: f6febd0a30b6e ("watchdog: Add Watchdog Timer driver for RZ/V2H(P)")
Cc: stable@vger.kernel.org
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20261001165201.763882-5-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/watchdog/rzv2h_wdt.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c
index 057b890de0b05..537c62c18a935 100644
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -256,20 +256,12 @@ static const struct watchdog_ops rzv2h_wdt_ops = {
static int rzt2h_wdt_wdtdcr_init(struct platform_device *pdev,
struct rzv2h_wdt_priv *priv)
{
- int ret;
-
priv->wdtdcr = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(priv->wdtdcr))
return PTR_ERR(priv->wdtdcr);
- ret = pm_runtime_resume_and_get(&pdev->dev);
- if (ret)
- return ret;
-
rzt2h_wdt_wdtdcr_count_stop(priv);
- pm_runtime_put_sync(&pdev->dev);
-
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 053/703] hwmon: (nct6775) Handle dual use registers
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 052/703] watchdog: rzv2h: Drop runtime PM handling from WDTDCR init Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 054/703] s390/dasd: Fix typo immediatly -> immediately Greg Kroah-Hartman
` (84 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Anton Lundin, Guenter Roeck,
Sasha Levin
6.18-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] 139+ messages in thread
* [PATCH 6.18 054/703] s390/dasd: Fix typo immediatly -> immediately
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 053/703] hwmon: (nct6775) Handle dual use registers Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 055/703] s390/dasd: Re-initialize RCD buffer with "V1.0" before every start Greg Kroah-Hartman
` (83 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Heiko Carstens, Jan Höppner,
Stefan Haberland, Jens Axboe, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Haberland <sth@linux.ibm.com>
[ Upstream commit ae6f19236b5ae4eef4df2780d51bee19add0eba8 ]
Fix typo in function name dasd_sleep_on_immediatly().
Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20261112102608.1057852-2-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: 25cdc1f63227 ("s390/dasd: Re-initialize RCD buffer with "V1.0" before every start")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/block/dasd.c | 4 ++--
drivers/s390/block/dasd_alias.c | 2 +-
drivers/s390/block/dasd_eckd.c | 14 +++++++-------
drivers/s390/block/dasd_int.h | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index f6e86692a21d7..f887b3657edd2 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -2573,7 +2573,7 @@ static inline int _dasd_term_running_cqr(struct dasd_device *device)
return rc;
}
-int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
+int dasd_sleep_on_immediately(struct dasd_ccw_req *cqr)
{
struct dasd_device *device;
int rc;
@@ -2621,7 +2621,7 @@ int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
return rc;
}
-EXPORT_SYMBOL(dasd_sleep_on_immediatly);
+EXPORT_SYMBOL(dasd_sleep_on_immediately);
/*
* Cancels a request that was started with dasd_sleep_on_req.
diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c
index f7e768d8ca766..2afac13cb79c2 100644
--- a/drivers/s390/block/dasd_alias.c
+++ b/drivers/s390/block/dasd_alias.c
@@ -751,7 +751,7 @@ static int reset_summary_unit_check(struct alias_lcu *lcu,
cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED;
- rc = dasd_sleep_on_immediatly(cqr);
+ rc = dasd_sleep_on_immediately(cqr);
return rc;
}
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 545446b3818f6..499b09162a0ae 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -887,7 +887,7 @@ static int dasd_eckd_read_conf_immediately(struct dasd_device *device,
set_bit(DASD_CQR_ALLOW_SLOCK, &cqr->flags);
cqr->retries = 5;
cqr->callback = read_conf_cb;
- rc = dasd_sleep_on_immediatly(cqr);
+ rc = dasd_sleep_on_immediately(cqr);
return rc;
}
@@ -5101,7 +5101,7 @@ dasd_eckd_release(struct dasd_device *device)
cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED;
- rc = dasd_sleep_on_immediatly(cqr);
+ rc = dasd_sleep_on_immediately(cqr);
if (!rc)
clear_bit(DASD_FLAG_IS_RESERVED, &device->flags);
@@ -5156,7 +5156,7 @@ dasd_eckd_reserve(struct dasd_device *device)
cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED;
- rc = dasd_sleep_on_immediatly(cqr);
+ rc = dasd_sleep_on_immediately(cqr);
if (!rc)
set_bit(DASD_FLAG_IS_RESERVED, &device->flags);
@@ -5210,7 +5210,7 @@ dasd_eckd_steal_lock(struct dasd_device *device)
cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED;
- rc = dasd_sleep_on_immediatly(cqr);
+ rc = dasd_sleep_on_immediately(cqr);
if (!rc)
set_bit(DASD_FLAG_IS_RESERVED, &device->flags);
@@ -5273,7 +5273,7 @@ static int dasd_eckd_snid(struct dasd_device *device,
cqr->status = DASD_CQR_FILLED;
cqr->lpm = usrparm.path_mask;
- rc = dasd_sleep_on_immediatly(cqr);
+ rc = dasd_sleep_on_immediately(cqr);
/* verify that I/O processing didn't modify the path mask */
if (!rc && usrparm.path_mask && (cqr->lpm != usrparm.path_mask))
rc = -EIO;
@@ -5915,7 +5915,7 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device,
cqr->block = NULL;
cqr->expires = 10 * HZ;
set_bit(DASD_CQR_VERIFY_PATH, &cqr->flags);
- /* dasd_sleep_on_immediatly does not do complex error
+ /* dasd_sleep_on_immediately does not do complex error
* recovery so clear erp flag and set retry counter to
* do basic erp */
clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
@@ -5947,7 +5947,7 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device,
cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED;
- rc = dasd_sleep_on_immediatly(cqr);
+ rc = dasd_sleep_on_immediately(cqr);
if (rc == 0) {
prssdp = (struct dasd_psf_prssd_data *) cqr->data;
message_buf = (struct dasd_rssd_messages *)
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 81cfb5c89681b..99c2534216537 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -857,7 +857,7 @@ void dasd_schedule_device_bh(struct dasd_device *);
void dasd_schedule_block_bh(struct dasd_block *);
int dasd_sleep_on(struct dasd_ccw_req *);
int dasd_sleep_on_queue(struct list_head *);
-int dasd_sleep_on_immediatly(struct dasd_ccw_req *);
+int dasd_sleep_on_immediately(struct dasd_ccw_req *);
int dasd_sleep_on_queue_interruptible(struct list_head *);
int dasd_sleep_on_interruptible(struct dasd_ccw_req *);
void dasd_device_set_timer(struct dasd_device *, int);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 055/703] s390/dasd: Re-initialize RCD buffer with "V1.0" before every start
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 054/703] s390/dasd: Fix typo immediatly -> immediately Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 056/703] sched/core: Do not touch SMT siblings that have not joined the core yet Greg Kroah-Hartman
` (82 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jan Höppner, Stefan Haberland,
Jens Axboe, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Haberland <sth@linux.ibm.com>
[ Upstream commit 25cdc1f63227a1ea69a1ec823a8a860e33299169 ]
Under z/VM the Read Configuration Data (RCD) buffer has to start with
EBCDIC "V1.0" to request the virtual device SNEQ that carries the
minidisk UIT. The request and the response share the same buffer:
CP evaluates the magic on the way out and the RCD data is written into
the same buffer on the way back.
The magic is only written when the request is built and again in
read_conf_cb() when the original request fails.
Several restart paths do not run that callback:
- ERP use the same buffer and if the same error occurs again,
the ERP restarts the existing ERP request;
if a different error occurs, it adds another ERP request.
Neither re-initializes the magic.
- Terminated (timed out) ERP requests, killed requests and requests
requeued after the last path was gone are restarted without it.
- dasd_sleep_on_immediately() overwrites cqr->callback, so read_conf_cb()
never ran for dasd_eckd_read_conf_immediately(), and its fastpath
retries in dasd_int_handler() do not call a callback either.
If such a restart succeeds, z/VM omits the virtual device SNEQ, the UID
of that path is built without the UIT and the paths are reported as
"Not all channel paths lead to the same device" although they lead to
the same minidisk.
Every start of a request, whatever path led to it, goes through
dasd_start_IO(). Add an optional prepare_io function to the request
that dasd_start_IO() calls before every start of the request and of
its ERP requests, and use it to write the magic for RCD requests.
The ERP handling stays unchanged. read_conf_cb() is no longer needed
and is removed, which also gets rid of its memset() that only cleared
a single byte.
Fixes: 5915a873fcb1 ("[S390] dasd: re-initialize read_conf buffer for retries")
Cc: stable@vger.kernel.org
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20261112102608.1057852-3-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[ sashal: Context-only conflict in the DASD header: the new helper was added without the neighbouring collision-detection helpers, which this tree lacks. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/block/dasd.c | 1 +
drivers/s390/block/dasd_eckd.c | 52 ++++++++++++----------------------
drivers/s390/block/dasd_int.h | 15 ++++++++++
3 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index f887b3657edd2..de1543bfdb544 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -1402,6 +1402,7 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
cqr->status = DASD_CQR_ERROR;
return -EIO;
}
+ dasd_start_IO_prepare(cqr);
cqr->startclk = get_tod_clock();
cqr->starttime = jiffies;
cqr->retries--;
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 499b09162a0ae..d60d787e17bf2 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -810,20 +810,29 @@ static int dasd_eckd_compare_path_uid(struct dasd_device *device,
return memcmp(&device_uid, &path_uid, sizeof(struct dasd_uid));
}
+/*
+ * The RCD buffer has to start with EBCDIC "V1.0" to show support for
+ * virtual device SNEQ. The RCD data is written into the same buffer, so
+ * a failed attempt may already have overwritten the magic. Re-initialize
+ * it before every start, including restarts by ERP requests.
+ */
+static void dasd_eckd_rcd_prepare_io(struct dasd_ccw_req *cqr)
+{
+ struct ccw1 *ccw = cqr->cpaddr;
+ __u8 *rcd_buffer = dma32_to_virt(ccw->cda);
+
+ rcd_buffer[0] = 0xE5;
+ rcd_buffer[1] = 0xF1;
+ rcd_buffer[2] = 0x4B;
+ rcd_buffer[3] = 0xF0;
+}
+
static void dasd_eckd_fill_rcd_cqr(struct dasd_device *device,
struct dasd_ccw_req *cqr,
__u8 *rcd_buffer,
__u8 lpm)
{
struct ccw1 *ccw;
- /*
- * buffer has to start with EBCDIC "V1.0" to show
- * support for virtual device SNEQ
- */
- rcd_buffer[0] = 0xE5;
- rcd_buffer[1] = 0xF1;
- rcd_buffer[2] = 0x4B;
- rcd_buffer[3] = 0xF0;
ccw = cqr->cpaddr;
ccw->cmd_code = DASD_ECKD_CCW_RCD;
@@ -840,33 +849,10 @@ static void dasd_eckd_fill_rcd_cqr(struct dasd_device *device,
cqr->retries = 256;
cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED;
+ cqr->prepare_io = dasd_eckd_rcd_prepare_io;
set_bit(DASD_CQR_VERIFY_PATH, &cqr->flags);
}
-/*
- * Wakeup helper for read_conf
- * if the cqr is not done and needs some error recovery
- * the buffer has to be re-initialized with the EBCDIC "V1.0"
- * to show support for virtual device SNEQ
- */
-static void read_conf_cb(struct dasd_ccw_req *cqr, void *data)
-{
- struct ccw1 *ccw;
- __u8 *rcd_buffer;
-
- if (cqr->status != DASD_CQR_DONE) {
- ccw = cqr->cpaddr;
- rcd_buffer = dma32_to_virt(ccw->cda);
- memset(rcd_buffer, 0, sizeof(*rcd_buffer));
-
- rcd_buffer[0] = 0xE5;
- rcd_buffer[1] = 0xF1;
- rcd_buffer[2] = 0x4B;
- rcd_buffer[3] = 0xF0;
- }
- dasd_wakeup_cb(cqr, data);
-}
-
static int dasd_eckd_read_conf_immediately(struct dasd_device *device,
struct dasd_ccw_req *cqr,
__u8 *rcd_buffer,
@@ -886,7 +872,6 @@ static int dasd_eckd_read_conf_immediately(struct dasd_device *device,
clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
set_bit(DASD_CQR_ALLOW_SLOCK, &cqr->flags);
cqr->retries = 5;
- cqr->callback = read_conf_cb;
rc = dasd_sleep_on_immediately(cqr);
return rc;
}
@@ -924,7 +909,6 @@ static int dasd_eckd_read_conf_lpm(struct dasd_device *device,
goto out_error;
}
dasd_eckd_fill_rcd_cqr(device, cqr, rcd_buf, lpm);
- cqr->callback = read_conf_cb;
ret = dasd_sleep_on(cqr);
/*
* on success we update the user input parms
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 99c2534216537..beba87a30e75b 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -147,6 +147,8 @@ struct dasd_ccw_req {
void *data; /* pointer to data area */
struct irb irb; /* device status in case of an error */
struct dasd_ccw_req *refers; /* ERP-chain queueing. */
+ /* optional prepare function called before every start_io, must not sleep */
+ void (*prepare_io)(struct dasd_ccw_req *cqr);
void *function; /* originating ERP action */
void *mem_chunk;
@@ -815,6 +817,19 @@ static inline void *dasd_get_callback_data(struct dasd_ccw_req *cqr)
return cqr->callback_data;
}
+/*
+ * Walk down the ERP chain to the original CQR and call its
+ * prepare_io function if set.
+ */
+static inline void dasd_start_IO_prepare(struct dasd_ccw_req *cqr)
+{
+ /* ERP requests use the prepare function of the original request */
+ while (cqr->refers)
+ cqr = cqr->refers;
+ if (cqr->prepare_io)
+ cqr->prepare_io(cqr);
+}
+
/* externals in dasd.c */
#define DASD_PROFILE_OFF 0
#define DASD_PROFILE_ON 1
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 056/703] sched/core: Do not touch SMT siblings that have not joined the core yet
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 055/703] s390/dasd: Re-initialize RCD buffer with "V1.0" before every start Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 057/703] ksmbd: skip metadata-only opens in sharing checks Greg Kroah-Hartman
` (81 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+681e729b2cf0d4860042,
Seiji Nishikawa, Peter Zijlstra (Intel), Ingo Molnar, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Seiji Nishikawa <snishika@redhat.com>
[ Upstream commit ec6f6731538e0d45872eb279fdeb477bed152d6f ]
When a CPU comes online, it is added to cpu_smt_mask() of its siblings
before sched_core_cpu_starting() sets its rq->core to the core leader.
For example, on x86, ap_starting() calls set_cpu_sibling_map() first,
and calls notify_cpu_starting() after that. This order is intended.
Before sched_core_cpu_starting() runs, rq->core of the new CPU still
points to its own rq. But rq->core_enabled of the new CPU is already
set. __sched_core_flip() sets it for all possible CPUs, also for
offline CPUs, and CPU offline does not clear it. So __rq_lockp() of the
new CPU returns its own rq->__lock. It does not return the core wide
lock.
If a sibling CPU runs pick_next_task() for SCHED_CORE at this time, it
checks all CPUs in cpu_smt_mask(). It calls update_rq_clock() and
pick_task() for the rq of the new CPU. But it holds only its own core
lock, not the lock of the new CPU. Then lockdep shows this warning in
update_rq_clock().
debug_locks && !(lock_is_held(&(__rq_lockp(rq))->dep_map) != 0)
WARNING: kernel/sched/sched.h:1666 at update_rq_clock+0x40a/0xd20 kernel/sched/core.c:875, CPU#0: syz-executor251/5712
Call Trace:
<TASK>
pick_next_task kernel/sched/core.c:6375 [inline]
__schedule+0x1c69/0x6920 kernel/sched/core.c:7199
preempt_schedule_irq+0x4e/0x90 kernel/sched/core.c:7606
The next loops in pick_next_task() also change rq_i->core_pick of this
rq, and can call resched_curr() for it, without its lock.
resched_curr() has the same lockdep_assert_rq_held() check.
__sched_core_account_forceidle() also checks all CPUs in the same mask.
CPU offline does not have this problem. remove_siblinginfo() and
sched_core_cpu_dying() both run in take_cpu_down() under stop_machine.
So no sibling CPU can be in pick_next_task() at that time.
Fix this. In these loops, skip a sibling CPU if its rq->core is
different from our rq->core. At run time, rq->core of a CPU is changed
by sched_core_cpu_starting(), sched_core_cpu_deactivate() and
sched_core_cpu_dying(). The first two hold sched_core_lock(), and
sched_core_lock() takes the rq locks of all CPUs in the SMT mask. The
last one runs under stop_machine, as written above. So while we hold
our core lock, the result of this check does not change. A CPU that is
not in the core yet will pick its own tasks. The comment in the
reschedule loop of pick_next_task() already expects this case.
I tested this with the syzbot C reproducer in QEMU. The two vCPUs were
SMT siblings (-smp 2,sockets=1,cores=1,threads=2). Without this patch,
the warning came after about 100 seconds. Just before the warning, a
debug print showed that the loop on CPU 0 saw CPU 1 with rq->core
pointing to CPU 1 itself, and cpu_online() was false for CPU 1. With
this patch, the same state still happened, but there was no warning
in more than 2 hours.
Fixes: 3c474b3239f1 ("sched: Fix Core-wide rq->lock for uninitialized CPUs")
Closes: https://syzkaller.appspot.com/bug?extid=681e729b2cf0d4860042
Reported-by: syzbot+681e729b2cf0d4860042@syzkaller.appspotmail.com
Signed-off-by: Seiji Nishikawa <snishika@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261104022004.3810619-1-snishika@redhat.com
[ sashal: Dropped the local smt_mask and converted the loops to the new iterators, keeping this tree's existing max initialization and need_sync assignment because it lacks the restart label and annotation. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/core.c | 8 +++-----
kernel/sched/core_sched.c | 3 +--
kernel/sched/sched.h | 19 +++++++++++++++++++
3 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3b51a93ba609c..d11274908ffc2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6044,7 +6044,6 @@ static struct task_struct *
pick_next_task(struct rq *rq, struct rq_flags *rf)
{
struct task_struct *next, *p, *max = NULL;
- const struct cpumask *smt_mask;
bool fi_before = false;
bool core_clock_updated = (rq == rq->core);
unsigned long cookie;
@@ -6094,7 +6093,6 @@ pick_next_task(struct rq *rq, struct rq_flags *rf)
prev_balance(rq, rf);
- smt_mask = cpu_smt_mask(cpu);
need_sync = !!rq->core->core_cookie;
/* reset state */
@@ -6150,7 +6148,7 @@ pick_next_task(struct rq *rq, struct rq_flags *rf)
*
* Tie-break prio towards the current CPU
*/
- for_each_cpu_wrap(i, smt_mask, cpu) {
+ for_each_core_cpu_wrap(i, rq) {
rq_i = cpu_rq(i);
/*
@@ -6174,7 +6172,7 @@ pick_next_task(struct rq *rq, struct rq_flags *rf)
* For each thread: try and find a runnable task that matches @max or
* force idle.
*/
- for_each_cpu(i, smt_mask) {
+ for_each_core_cpu(i, rq) {
rq_i = cpu_rq(i);
p = rq_i->core_pick;
@@ -6220,7 +6218,7 @@ pick_next_task(struct rq *rq, struct rq_flags *rf)
* their task. This ensures there is no inter-sibling overlap between
* non-matching user state.
*/
- for_each_cpu(i, smt_mask) {
+ for_each_core_cpu(i, rq) {
rq_i = cpu_rq(i);
/*
diff --git a/kernel/sched/core_sched.c b/kernel/sched/core_sched.c
index 9ede71ecba7f8..fb64cf180d1f6 100644
--- a/kernel/sched/core_sched.c
+++ b/kernel/sched/core_sched.c
@@ -241,7 +241,6 @@ int sched_core_share_pid(unsigned int cmd, pid_t pid, enum pid_type type,
/* REQUIRES: rq->core's clock recently updated. */
void __sched_core_account_forceidle(struct rq *rq)
{
- const struct cpumask *smt_mask = cpu_smt_mask(cpu_of(rq));
u64 delta, now = rq_clock(rq->core);
struct rq *rq_i;
struct task_struct *p;
@@ -273,7 +272,7 @@ void __sched_core_account_forceidle(struct rq *rq)
delta = div_u64(delta, rq->core->core_forceidle_occupation);
}
- for_each_cpu(i, smt_mask) {
+ for_each_core_cpu(i, rq) {
rq_i = cpu_rq(i);
p = rq_i->core_pick ?: rq_i->curr;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index ad7b72317f0f2..ea470cc608d51 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1430,6 +1430,25 @@ static inline raw_spinlock_t *__rq_lockp(struct rq *rq)
return &rq->__lock;
}
+/*
+ * A CPU coming online is set in cpu_smt_mask() before
+ * sched_core_cpu_starting() links its rq->core to the core leader.
+ * Until then it does not share the core-wide lock, so it must not be
+ * touched as part of the core.
+ */
+static inline bool sched_core_sibling(struct rq *rq, struct rq *rq_i)
+{
+ return rq_i->core == rq->core;
+}
+
+#define for_each_core_cpu(i, rq) \
+ for_each_cpu(i, cpu_smt_mask(rq->cpu)) \
+ if (sched_core_sibling(rq, cpu_rq(i)))
+
+#define for_each_core_cpu_wrap(i, rq) \
+ for_each_cpu_wrap(i, cpu_smt_mask(rq->cpu), rq->cpu) \
+ if (sched_core_sibling(rq, cpu_rq(i)))
+
extern bool
cfs_prio_less(const struct task_struct *a, const struct task_struct *b, bool fi);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 057/703] ksmbd: skip metadata-only opens in sharing checks
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 056/703] sched/core: Do not touch SMT siblings that have not joined the core yet Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 058/703] wifi: mac80211_hwsim: ignore non-generic netlink releases Greg Kroah-Hartman
` (80 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ian Bridges, Namjae Jeon,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Bridges <icb@fastmail.org>
[ Upstream commit 81fefb6c635489e71e286d1465b6dd1d0a27ceec ]
A READ_CONTROL open without sharing can block later reads, writes and
deletes even though it holds no data, execute or delete access.
Keep the existing attribute-only exception. For other pairs, require
both effective access masks to hold one of those rights. MS-FSA
2.1.5.1.2 grants FILE_WRITE_DATA when an open overwrites a file or
stream, or creates a named stream on an existing file. Use that granted
access for sharing checks while keeping the requested access on the
returned handle.
The Time Machine AFP_AfpInfo synthesis keeps its requested access.
ksmbd implements FILE_SUPERSEDE by truncating the file, so count it as
a write.
This also prevents an overwrite from truncating a file while another
open that holds data, execute or delete access does not share writing.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Ian Bridges <icb@fastmail.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
[ sashal: Context-only adjustments: dropped const on idmap and omitted the app_instance_* and posix_append lines, which this tree lacks. The new stream_created declaration and defines were placed beside the nearest existing lines. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 30 ++++++++++++++++++++++--------
fs/smb/server/smb_common.c | 34 +++++++++++++++++++++++++++++++++-
fs/smb/server/smb_common.h | 5 +++++
fs/smb/server/vfs_cache.h | 2 ++
4 files changed, 62 insertions(+), 9 deletions(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index c46b537bdab8a..2fd2d52eca00c 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2541,7 +2541,8 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
static noinline int smb2_set_stream_name_xattr(const struct path *path,
struct ksmbd_file *fp,
- char *stream_name, int s_type)
+ char *stream_name, int s_type,
+ bool *created)
{
struct mnt_idmap *idmap = mnt_idmap(path->mnt);
size_t xattr_stream_size;
@@ -2579,6 +2580,8 @@ static noinline int smb2_set_stream_name_xattr(const struct path *path,
rc = ksmbd_vfs_setxattr(idmap, path, xattr_stream_name, NULL, 0, 0, false);
if (rc < 0)
pr_err("Failed to store XATTR stream name :%d\n", rc);
+ else
+ *created = true;
return 0;
}
@@ -3004,6 +3007,7 @@ int smb2_open(struct ksmbd_work *work)
char *name = NULL;
char *stream_name = NULL;
bool file_present = false, created = false, already_permitted = false;
+ bool stream_created = false;
int share_ret, need_truncate = 0;
u64 time, alloc_size = 0;
umode_t posix_mode = 0;
@@ -3609,7 +3613,8 @@ int smb2_open(struct ksmbd_work *work)
rc = smb2_set_stream_name_xattr(&path,
fp,
stream_name,
- s_type);
+ s_type,
+ &stream_created);
if (rc)
goto err_out;
file_info = FILE_CREATED;
@@ -3617,12 +3622,24 @@ int smb2_open(struct ksmbd_work *work)
fp->attrib_only = !(req->DesiredAccess & ~(FILE_READ_ATTRIBUTES_LE |
FILE_WRITE_ATTRIBUTES_LE | FILE_SYNCHRONIZE_LE));
+ need_truncate = !S_ISDIR(file_inode(filp)->i_mode) &&
+ open_flags & O_TRUNC && !fp->attrib_only && !stream_name;
+ /*
+ * Count the FILE_WRITE_DATA that MS-FSA 2.1.5.1.2 grants an overwrite,
+ * supersede included, or a new named stream on an existing file.
+ * An attribute-only open of the file is not truncated, and the
+ * synthesized AFP_AfpInfo stream is not created by the client.
+ */
+ fp->implied_write = need_truncate ||
+ (stream_name &&
+ (open_flags & O_TRUNC ||
+ (file_present && stream_created)));
fp->is_posix_ctxt = posix_ctxt;
/* fp should be searchable through ksmbd_inode.m_fp_list
- * after daccess, saccess, attrib_only, and stream are
- * initialized.
+ * after daccess, saccess, attrib_only, implied_write, and
+ * stream are initialized.
*/
down_write(&fp->f_ci->m_lock);
list_add(&fp->node, &fp->f_ci->m_fp_list);
@@ -3637,11 +3654,8 @@ int smb2_open(struct ksmbd_work *work)
if (file_present || created)
path_put(&path);
- if (!S_ISDIR(file_inode(filp)->i_mode) && open_flags & O_TRUNC &&
- !fp->attrib_only && !stream_name) {
+ if (need_truncate)
smb_break_all_oplock(work, fp);
- need_truncate = 1;
- }
share_ret = ksmbd_smb_check_shared_mode(fp->filp, fp);
if (!test_share_config_flag(work->tcon->share_conf, KSMBD_SHARE_FLAG_OPLOCKS) ||
diff --git a/fs/smb/server/smb_common.c b/fs/smb/server/smb_common.c
index 3a4b7b380a6bc..7ff75a069cd59 100644
--- a/fs/smb/server/smb_common.c
+++ b/fs/smb/server/smb_common.c
@@ -664,10 +664,24 @@ static void smb_shared_mode_error(int error, struct ksmbd_file *prev_fp,
prev_fp->saccess, curr_fp->daccess);
}
+/*
+ * Sharing checks use fp->daccess plus the FILE_WRITE_DATA that MS-FSA
+ * grants an open that overwrites data or creates a named stream.
+ * fp->daccess keeps the open's own access.
+ */
+__le32 ksmbd_sharing_daccess(const struct ksmbd_file *fp)
+{
+ if (fp->implied_write)
+ return fp->daccess | FILE_WRITE_DATA_LE;
+ return fp->daccess;
+}
+
int ksmbd_smb_check_shared_mode(struct file *filp, struct ksmbd_file *curr_fp)
{
int rc = 0;
struct ksmbd_file *prev_fp;
+ __le32 curr_access = ksmbd_sharing_daccess(curr_fp);
+ __le32 access;
/*
* Lookup fp in master fp list, and check desired access and
@@ -688,6 +702,24 @@ int ksmbd_smb_check_shared_mode(struct file *filp, struct ksmbd_file *curr_fp)
if (prev_fp->attrib_only != curr_fp->attrib_only)
continue;
+ /*
+ * MS-FSA checks sharing per stream, so a named stream open's
+ * implied write is not a write against the primary stream.
+ * It still decides whether the pair is checked.
+ */
+ access = curr_access;
+ if (ksmbd_stream_fd(curr_fp) && !ksmbd_stream_fd(prev_fp))
+ access = curr_fp->daccess;
+
+ /*
+ * Two opens conflict only if both hold a right in
+ * FILE_SHARE_CHECKED_ACCESS_LE (MS-FSA 2.1.5.1.2.1 and
+ * 2.1.5.1.2.2)
+ */
+ if (!(ksmbd_sharing_daccess(prev_fp) & FILE_SHARE_CHECKED_ACCESS_LE) ||
+ !(curr_access & FILE_SHARE_CHECKED_ACCESS_LE))
+ continue;
+
if (!(prev_fp->saccess & FILE_SHARE_DELETE_LE) &&
curr_fp->daccess & FILE_DELETE_LE) {
smb_shared_mode_error(SHARE_DELETE_ERROR,
@@ -714,7 +746,7 @@ int ksmbd_smb_check_shared_mode(struct file *filp, struct ksmbd_file *curr_fp)
}
if (!(prev_fp->saccess & FILE_SHARE_WRITE_LE) &&
- curr_fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE)) {
+ access & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE)) {
smb_shared_mode_error(SHARE_WRITE_ERROR,
prev_fp,
curr_fp);
diff --git a/fs/smb/server/smb_common.h b/fs/smb/server/smb_common.h
index d6f72195482f9..912f1bb70b181 100644
--- a/fs/smb/server/smb_common.h
+++ b/fs/smb/server/smb_common.h
@@ -82,6 +82,10 @@
FILE_EXECUTE | FILE_DELETE_CHILD | \
FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES)
+/* Rights that make an open take part in sharing checks */
+#define FILE_SHARE_CHECKED_ACCESS_LE (FILE_EXECUTE_LE | FILE_READ_DATA_LE | \
+ FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE | FILE_DELETE_LE)
+
#define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff)
#define SMB_COM_NEGOTIATE 0x72
#define SMB1_CLIENT_GUID_SIZE (16)
@@ -221,6 +225,7 @@ int ksmbd_extract_shortname(struct ksmbd_conn *conn,
int ksmbd_smb_negotiate_common(struct ksmbd_work *work, unsigned int command);
+__le32 ksmbd_sharing_daccess(const struct ksmbd_file *fp);
int ksmbd_smb_check_shared_mode(struct file *filp, struct ksmbd_file *curr_fp);
int __ksmbd_override_fsids(struct ksmbd_work *work,
struct ksmbd_share_config *share);
diff --git a/fs/smb/server/vfs_cache.h b/fs/smb/server/vfs_cache.h
index 03494f2627cd6..c39deb10d2166 100644
--- a/fs/smb/server/vfs_cache.h
+++ b/fs/smb/server/vfs_cache.h
@@ -107,6 +107,8 @@ struct ksmbd_file {
bool is_nt_open;
bool attrib_only;
+ /* writes data on open, see ksmbd_sharing_daccess() */
+ bool implied_write;
bool allocation_size_set;
char client_guid[16];
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 058/703] wifi: mac80211_hwsim: ignore non-generic netlink releases
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 057/703] ksmbd: skip metadata-only opens in sharing checks Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 059/703] gpio: mvebu: name regmaps to fix debugfs collisions Greg Kroah-Hartman
` (79 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zhao Li, Johannes Berg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
[ Upstream commit 989f47c56e48d442d79497a25ed946d029c4dc53 ]
Closing an unrelated netlink socket can remove mac80211_hwsim radios or
clear the active wmediumd registration when its port ID matches a generic
netlink socket.
mac80211_hwsim_netlink_notify() handles every NETLINK_URELEASE event,
but netlink port IDs are scoped by protocol. The notifier therefore treats
a release from another protocol as a MAC80211_HWSIM socket release.
Ignore release notifications unless they come from NETLINK_GENERIC.
LLM assistance was used to find the bug and review.
Fixes: 7882513bacb1 ("mac80211_hwsim driver support userspace frame tx/rx")
Fixes: e9ed49bf4c2c ("mac80211-hwsim: Add support for HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028141751.6728-2-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/virtual/mac80211_hwsim.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c
index 89794c724858c..eecd6e2ee27e4 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
@@ -6747,7 +6747,7 @@ static int mac80211_hwsim_netlink_notify(struct notifier_block *nb,
{
struct netlink_notify *notify = _notify;
- if (state != NETLINK_URELEASE)
+ if (state != NETLINK_URELEASE || notify->protocol != NETLINK_GENERIC)
return NOTIFY_DONE;
remove_user_radios(notify->portid, hwsim_net_get_netgroup(notify->net));
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 059/703] gpio: mvebu: name regmaps to fix debugfs collisions
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 058/703] wifi: mac80211_hwsim: ignore non-generic netlink releases Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 060/703] gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask() Greg Kroah-Hartman
` (78 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Rosen Penev, Linus Walleij,
Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <rosenp@gmail.com>
[ Upstream commit 4d305c2273123119c27d6e4c822215e650c451e3 ]
Each marvell,armada-370-gpio node provides both 'gpio' and 'pwm'
register windows, and the driver creates one regmap per window on the
same platform device. The shared regmap_config was unnamed, so both
maps defaulted their debugfs directory to dev_name(), e.g.
debugfs: 'f1018100.gpio' already exists in 'regmap'
because the PWM regmap (and on Armada XP the per-CPU regmap) claimed
the same directory as the GPIO regmap.
Give each regmap a distinct .name so the debugfs directories become
'<dev>.gpio', '<dev>.percpu' and '<dev>.pwm'. This only affects
debugfs naming; register access is unchanged.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260905004334.177074-1-rosenp@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Stable-dep-of: 42269cdb3d3b ("gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mvebu.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index c613d74ed48d0..aa2484a8d8af4 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -599,6 +599,21 @@ static void mvebu_gpio_irq_handler(struct irq_desc *desc)
}
static const struct regmap_config mvebu_gpio_regmap_config = {
+ .name = "gpio",
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+};
+
+static const struct regmap_config mvebu_gpio_percpu_regmap_config = {
+ .name = "percpu",
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+};
+
+static const struct regmap_config mvebu_pwm_regmap_config = {
+ .name = "pwm",
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
@@ -840,7 +855,7 @@ static int mvebu_pwm_probe(struct platform_device *pdev,
return PTR_ERR(base);
mvpwm->regs = devm_regmap_init_mmio(&pdev->dev, base,
- &mvebu_gpio_regmap_config);
+ &mvebu_pwm_regmap_config);
if (IS_ERR(mvpwm->regs))
return PTR_ERR(mvpwm->regs);
@@ -1107,7 +1122,7 @@ static int mvebu_gpio_probe_raw(struct platform_device *pdev,
mvchip->percpu_regs =
devm_regmap_init_mmio(&pdev->dev, base,
- &mvebu_gpio_regmap_config);
+ &mvebu_gpio_percpu_regmap_config);
if (IS_ERR(mvchip->percpu_regs))
return PTR_ERR(mvchip->percpu_regs);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 060/703] gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 059/703] gpio: mvebu: name regmaps to fix debugfs collisions Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 061/703] gpio: keep the chip reference when deferred setup fails Greg Kroah-Hartman
` (77 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Bartosz Golaszewski,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ Upstream commit 42269cdb3d3b46ba6e80f31d0e00d0bdcff1d8d4 ]
mvebu_gpio_write_level_mask() is called with a raw spinlock taken but
the underlying regmap uses a standard spinlock which can sleep on
RT_PREEMPT kernels. Add the .use_raw_spinlock attribute to the
appropriate regmap config.
Cc: stable@vger.kernel.org
Fixes: 2233bf7a92e7 ("gpio: mvebu: switch to regmap for register access")
Fixes: 4d305c227312 ("gpio: mvebu: name regmaps to fix debugfs collisions")
Closes: https://sashiko.dev/#/bug/linux-6bee0c4f-384c-494c-868e-07c420195d13
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261109-gpio-mvebu-sleeping-while-atomic-v2-1-41f070421e70@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mvebu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index aa2484a8d8af4..7ad2b1fe95d5e 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -603,6 +603,7 @@ static const struct regmap_config mvebu_gpio_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
+ .use_raw_spinlock = true,
};
static const struct regmap_config mvebu_gpio_percpu_regmap_config = {
@@ -610,6 +611,7 @@ static const struct regmap_config mvebu_gpio_percpu_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
+ .use_raw_spinlock = true,
};
static const struct regmap_config mvebu_pwm_regmap_config = {
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 061/703] gpio: keep the chip reference when deferred setup fails
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 060/703] gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 062/703] cpufreq: Fix updates of cached resolved frequency and index Greg Kroah-Hartman
` (76 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Wentao Liang, Bartosz Golaszewski,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit 7e899fe007d2ffc753e6aa5bc8f2ae0a802b9e07 ]
gpiochip_setup_devs() runs once gpiolib has been initialized and
finishes the registration of the chips that were added before that.
When the registration of such a chip fails, the function drops the
reference taken in gpiochip_add_data_with_key() with
gpio_device_put(), and only then logs the error through &gdev->dev.
For these chips that reference is the last one, so gpiodev_release()
frees gdev: the dev_err() dereferences freed memory, and the chip is
still linked in gpio_devices, so the next lookup walks into the freed
object as well. Here the registration cannot be undone the way
gpiochip_add_data_with_key() does it, as the driver already got success
from gpiochip_add_data() and will call gpiochip_remove(), which unlinks
the chip and drops the reference.
Keep the reference and only report the failure.
Fixes: 16fdabe143fc ("gpio: Fix resource leaks on errors in gpiochip_add_data_with_key()")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20261104025345.1527526-1-vulab@iscas.ac.cn
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ sashal: Adjusted the gpiochip_setup_dev() prototype and its call site to take struct gpio_device *gdev instead of struct gpio_chip *gc, since this tree has no per-chip gc lookup in that loop. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index a41219961778d..e126218751eb2 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -884,7 +884,8 @@ static const struct device_type gpio_dev_type = {
/*
* An initial reference count has been held in gpiochip_add_data_with_key().
- * The caller should drop the reference via gpio_device_put() on errors.
+ * A caller that tears the chip down on errors must drop the reference via
+ * gpio_device_put().
*/
static int gpiochip_setup_dev(struct gpio_device *gdev)
{
@@ -955,12 +956,16 @@ static void gpiochip_setup_devs(void)
list_for_each_entry_srcu(gdev, &gpio_devices, list,
srcu_read_lock_held(&gpio_devices_srcu)) {
+ /*
+ * The reference taken in gpiochip_add_data_with_key() is
+ * dropped by gpiochip_remove(): this chip is still registered
+ * and its driver has not been told about the failure, so the
+ * reference must be kept here.
+ */
ret = gpiochip_setup_dev(gdev);
- if (ret) {
- gpio_device_put(gdev);
+ if (ret)
dev_err(&gdev->dev,
"Failed to initialize gpio device (%d)\n", ret);
- }
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 062/703] cpufreq: Fix updates of cached resolved frequency and index
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 061/703] gpio: keep the chip reference when deferred setup fails Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 063/703] mm/page_alloc: retry allocations that raced with a zonelist rebuild Greg Kroah-Hartman
` (75 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhongqiu Han, Rafael J. Wysocki,
Christian Loehle, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit 75120f31aed010c326b28d7c80d22314df34d9a8 ]
The cached resolved frequency and index, cached_target_freq and
cached_resolved_idx, respectively, may be updated concurrently if
cpufreq_driver_resolve_freq() is called by the schedutil governor
while cpufreq_set_policy() is running for the same policy. Those
concurrent updates are not synchronized in any way and the values
written by cpufreq_set_policy(), if it wins the race, may confuse
drivers using those policy fields [1].
To address this, use the observation that the only place where
cached_target_freq and cached_resolved_idx need to be updated is
cpufreq_driver_resolve_freq() because the only legitimate users of
them are .fast_switch() driver callbacks. Although cached_resolved_idx
is also used in __cpufreq_driver_target(), that is in fact unnecessary
and it is better to use a local variable for storing the frequency
table index in that function.
Accordingly, rearrange __resolve_freq() and its callers so that
cached_target_freq and cached_resolved_idx are only updated in
cpufreq_driver_resolve_freq().
The cached_target_freq initialization in cpufreq_set_policy() is still
needed, but move it after stopping the old governor and before starting
the new one to avoid racing with cpufreq_driver_resolve_freq().
Fixes: f9ccdec24d91 ("cpufreq: Reuse cpufreq_driver_resolve_freq() in __cpufreq_driver_target()")
Fixes: 151717690694 ("cpufreq: Make policy min/max hard requirements")
Reported-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Closes: https://lore.kernel.org/linux-pm/20261105140357.1331894-1-zhongqiu.han@oss.qualcomm.com/ [1]
Co-developed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Signed-off-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Cc: All applicable <stable@vger.kernel.org> # 342d3a73c5db cpufreq: Force passing target frequency to driver during resume
Cc: All applicable <stable@vger.kernel.org> # 166207cac451 cpufreq: Cache post-resolution target frequency in __resolve_freq()
Link: https://patch.msgid.link/3472677.aeNJFYEL58@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/cpufreq.c | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index cd2eb696548b7..bd56db09ac8e6 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -498,7 +498,7 @@ EXPORT_SYMBOL_GPL(cpufreq_disable_fast_switch);
static unsigned int __resolve_freq(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int min, unsigned int max,
- unsigned int relation)
+ unsigned int relation, unsigned int *idx_p)
{
unsigned int idx;
@@ -508,9 +508,10 @@ static unsigned int __resolve_freq(struct cpufreq_policy *policy,
return target_freq;
idx = cpufreq_frequency_table_target(policy, target_freq, min, max, relation);
- policy->cached_resolved_idx = idx;
- policy->cached_target_freq = policy->freq_table[idx].frequency;
- return policy->cached_target_freq;
+ if (idx_p)
+ *idx_p = idx;
+
+ return policy->freq_table[idx].frequency;
}
/**
@@ -541,7 +542,10 @@ unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy *policy,
if (unlikely(min > max))
min = max;
- return __resolve_freq(policy, target_freq, min, max, CPUFREQ_RELATION_LE);
+ policy->cached_target_freq = __resolve_freq(policy, target_freq, min, max,
+ CPUFREQ_RELATION_LE,
+ &policy->cached_resolved_idx);
+ return policy->cached_target_freq;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_resolve_freq);
@@ -2400,12 +2404,13 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned int relation)
{
unsigned int old_target_freq = target_freq;
+ unsigned int idx = 0;
if (cpufreq_disabled())
return -ENODEV;
target_freq = __resolve_freq(policy, target_freq, policy->min,
- policy->max, relation);
+ policy->max, relation, &idx);
pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
policy->cpu, target_freq, relation, old_target_freq);
@@ -2435,7 +2440,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
if (!cpufreq_driver->target_index)
return -EINVAL;
- return __target_index(policy, policy->cached_resolved_idx);
+ return __target_index(policy, idx);
}
EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
@@ -2714,7 +2719,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
* concurrently by cpufreq_driver_resolve_freq() during the update.
*/
freq = __resolve_freq(policy, new_data.max, new_data.min, new_data.max,
- CPUFREQ_RELATION_H);
+ CPUFREQ_RELATION_H, NULL);
if (freq != policy->max) {
WRITE_ONCE(policy->max, freq);
if (need_update_limits)
@@ -2722,7 +2727,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
}
freq = __resolve_freq(policy, new_data.min, new_data.min, new_data.max,
- CPUFREQ_RELATION_L);
+ CPUFREQ_RELATION_L, NULL);
freq = min(freq, policy->max);
if (freq != policy->min) {
WRITE_ONCE(policy->min, freq);
@@ -2734,8 +2739,6 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
cpufreq_update_pressure(policy);
- policy->cached_target_freq = UINT_MAX;
-
pr_debug("new min and max freqs are %u - %u kHz\n",
policy->min, policy->max);
@@ -2761,6 +2764,12 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
cpufreq_exit_governor(policy);
}
+ /*
+ * Initialize cached_target_freq while no governor is running to avoid
+ * racing with cpufreq_driver_resolve_freq(), which updates it.
+ */
+ policy->cached_target_freq = UINT_MAX;
+
/* start new governor */
policy->governor = new_gov;
ret = cpufreq_init_governor(policy);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 063/703] mm/page_alloc: retry allocations that raced with a zonelist rebuild
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 062/703] cpufreq: Fix updates of cached resolved frequency and index Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 064/703] mm/hugetlb: retry the pool walk when the zonelist is rebuilt Greg Kroah-Hartman
` (74 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
[ Upstream commit bcfc8286f0cd5a74c827d502f9f1ad408d7eff30 ]
Onlining the first block of a zone rebuilds every zonelist in place,
shifting the slots after the new zone. The iterator approves a slot,
then the allocator loads the zone from it, so a GFP_KERNEL request can
land in ZONE_MOVABLE and a nodemask request on a node outside its mask:
CPU 0 CPU 1
prepare_alloc_pages()
first_zones_zonelist(nodemask {1})
slot 0 (NORMAL1) approved
online_pages()
build_all_zonelists()
[NORMAL1, NORMAL2, ...]
-> [MOVABLE1, NORMAL1, ...]
get_page_from_freelist()
zone = zonelist_zone(slot 0) /* MOVABLE1 */
allocates from MOVABLE1
zonelist_update_seq detects the rebuild, but only the slowpath's failure
exits check it.
Check it whenever an allocation succeeds too, and if it changed, free
the page and retry, as the memcg charge failure path does. Eligible
pages are dropped as well: zonelists only change when memory comes or
goes, and a retry is simpler than rechecking the page.
Freeing the page does not undo a block the allocation claimed. A
GFP_KERNEL request that lands in a fresh ZONE_MOVABLE converts a free
block to MIGRATE_UNMOVABLE, which stays until the zone's movable free
list runs out and a movable allocation takes it back.
The fast and bulk paths read the seqlock's raw seqcount without waiting:
an ALLOC_NOLOCK caller can be an NMI that interrupted the writer, and on
PREEMPT_RT the seqlock accessor takes the spinlock. A sample taken
mid-write costs a retry, or NULL under ALLOC_NOLOCK.
check_retry_zonelist() returns 0 when compiled out, so a backport
without the hot-add change stays harmless.
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-9-gourry@gourry.net
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
[ sashal: Added a matching zonelist-cookie check to the separate nolock allocation function (freeing with the trylock flag and returning NULL), and used the non-nolock free flag in the regular path. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 39 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7c10d42e31d8f..2039fe1abfe15 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4450,12 +4450,25 @@ static unsigned int zonelist_iter_begin(void)
return 0;
}
+/*
+ * Never wait for the writer, which an ALLOC_NOLOCK caller in NMI may have
+ * interrupted. Read the raw seqcount: on PREEMPT_RT the seqlock accessor takes
+ * the spinlock while a write is in progress.
+ */
+static unsigned int zonelist_iter_sample(void)
+{
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
+ return raw_seqcount_begin(&zonelist_update_seq.seqcount.seqcount);
+
+ return 0;
+}
+
static unsigned int check_retry_zonelist(unsigned int seq)
{
if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
return read_seqretry(&zonelist_update_seq, seq);
- return seq;
+ return 0;
}
/* Perform direct synchronous page reclaim */
@@ -5124,6 +5137,12 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
warn_alloc(gfp_mask, ac->nodemask,
"page allocation failure: order:%u", order);
got_pg:
+ /* A rebuild during the walk may have handed out an ineligible zone. */
+ if (page && check_retry_zonelist(zonelist_iter_cookie)) {
+ __free_frozen_pages(page, order, FPI_NONE);
+ page = NULL;
+ goto restart;
+ }
return page;
}
@@ -5205,6 +5224,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
struct alloc_context ac;
gfp_t alloc_gfp;
unsigned int alloc_flags = ALLOC_WMARK_LOW;
+ unsigned int zonelist_iter_cookie;
int nr_populated = 0, nr_account = 0;
/*
@@ -5245,6 +5265,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
/* May set ALLOC_NOFRAGMENT, fragmentation will return 1 page. */
gfp &= gfp_allowed_mask;
alloc_gfp = gfp;
+ zonelist_iter_cookie = zonelist_iter_sample();
if (!prepare_alloc_pages(gfp, 0, preferred_nid, nodemask, &ac, &alloc_gfp, &alloc_flags))
goto out;
gfp = alloc_gfp;
@@ -5295,6 +5316,10 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
if (unlikely(!zone))
goto failed;
+ /* The zone was chosen from a zonelist that a rebuild may have changed. */
+ if (unlikely(check_retry_zonelist(zonelist_iter_cookie)))
+ goto failed;
+
/* spin_trylock may fail due to a parallel drain or IRQ reentrancy. */
pcp_trylock_prepare(UP_flags);
pcp = pcp_spin_trylock(zone->per_cpu_pageset);
@@ -5358,6 +5383,7 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
unsigned int alloc_flags = ALLOC_WMARK_LOW;
gfp_t alloc_gfp; /* The gfp_t that was actually used for allocation */
struct alloc_context ac = { };
+ unsigned int zonelist_iter_cookie;
/*
* There are several places where we assume that the order value is sane
@@ -5376,6 +5402,7 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
*/
gfp = current_gfp_context(gfp);
alloc_gfp = gfp;
+ zonelist_iter_cookie = zonelist_iter_sample();
if (!prepare_alloc_pages(gfp, order, preferred_nid, nodemask, &ac,
&alloc_gfp, &alloc_flags))
return NULL;
@@ -5389,6 +5416,10 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order,
/* First allocation attempt */
page = get_page_from_freelist(alloc_gfp, order, alloc_flags, &ac);
+ if (likely(page) && unlikely(check_retry_zonelist(zonelist_iter_cookie))) {
+ __free_frozen_pages(page, order, FPI_NONE);
+ page = NULL;
+ }
if (likely(page))
goto out;
@@ -7789,6 +7820,7 @@ struct page *alloc_frozen_pages_nolock_noprof(gfp_t gfp_flags, int nid, unsigned
| gfp_flags;
unsigned int alloc_flags = ALLOC_TRYLOCK;
struct alloc_context ac = { };
+ unsigned int zonelist_iter_cookie;
struct page *page;
VM_WARN_ON_ONCE(gfp_flags & ~__GFP_ACCOUNT);
@@ -7820,6 +7852,7 @@ struct page *alloc_frozen_pages_nolock_noprof(gfp_t gfp_flags, int nid, unsigned
if (nid == NUMA_NO_NODE)
nid = numa_node_id();
+ zonelist_iter_cookie = zonelist_iter_sample();
prepare_alloc_pages(alloc_gfp, order, nid, NULL, &ac,
&alloc_gfp, &alloc_flags);
@@ -7828,6 +7861,10 @@ struct page *alloc_frozen_pages_nolock_noprof(gfp_t gfp_flags, int nid, unsigned
* If it's empty attempt to spin_trylock zone->lock.
*/
page = get_page_from_freelist(alloc_gfp, order, alloc_flags, &ac);
+ if (page && unlikely(check_retry_zonelist(zonelist_iter_cookie))) {
+ __free_frozen_pages(page, order, FPI_TRYLOCK);
+ page = NULL;
+ }
/* Unlike regular alloc_pages() there is no __alloc_pages_slowpath(). */
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 064/703] mm/hugetlb: retry the pool walk when the zonelist is rebuilt
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 063/703] mm/page_alloc: retry allocations that raced with a zonelist rebuild Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 065/703] page_alloc: allow migration of smaller hugepages during contig_alloc Greg Kroah-Hartman
` (73 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
[ Upstream commit 9f6674f842bbceda8326cf4e494af5ad3a5a05e6 ]
Onlining the first block of a zone rebuilds every zonelist in place,
shifting the slots after the new zone. dequeue_hugetlb_folio_nodemask()
approves a slot by its node, then loads the zone from it, so a hugetlb
fault bound to one node can take a pool page from another:
CPU 0 CPU 1
dequeue_hugetlb_folio_nodemask(nodemask {2})
slot 3 (NORMAL2) approved
online_pages()
build_all_zonelists()
[.., NORMAL1, NORMAL2]
-> [.., MOVABLE1, NORMAL1, ...]
zone = zonelist_zone(slot 3) /* NORMAL1 */
dequeue_hugetlb_folio_node_exact(h, 1)
Check zonelist_update_seq before using each zone, and on the way out
with nothing found, and restart the walk if it changed. Checking before
the dequeue leaves nothing to put back. Reset the last-tried node on
restart, so it is not skipped.
With kprobes holding the walk across the online, a fault bound to node 2
took a node 1 page in 3 of 3 runs, and a node 2 page in 3 of 3 with this
change.
Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Link: https://patch.msgid.link/20261101021340.2251928-10-gourry@gourry.net
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
[ sashal: Moved zonelist_iter_begin() and check_retry_zonelist() into mm/internal.h since mm/page_alloc.h doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/hugetlb.c | 13 ++++++++++---
mm/internal.h | 19 +++++++++++++++++++
mm/page_alloc.c | 18 +-----------------
3 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 93634e3524a73..a41a477361a7e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1338,11 +1338,11 @@ static struct folio *dequeue_hugetlb_folio_node_exact(struct hstate *h,
static struct folio *dequeue_hugetlb_folio_nodemask(struct hstate *h, gfp_t gfp_mask,
int nid, nodemask_t *nmask)
{
- unsigned int cpuset_mems_cookie;
+ unsigned int cpuset_mems_cookie, zonelist_cookie;
struct zonelist *zonelist;
struct zone *zone;
struct zoneref *z;
- int node = NUMA_NO_NODE;
+ int node;
/* 'nid' should not be NUMA_NO_NODE. Try to catch any misuse of it and rectifiy. */
if (nid == NUMA_NO_NODE)
@@ -1351,10 +1351,16 @@ static struct folio *dequeue_hugetlb_folio_nodemask(struct hstate *h, gfp_t gfp_
zonelist = node_zonelist(nid, gfp_mask);
retry_cpuset:
+ node = NUMA_NO_NODE;
cpuset_mems_cookie = read_mems_allowed_begin();
+ zonelist_cookie = zonelist_iter_begin();
for_each_zone_zonelist_nodemask(zone, z, zonelist, gfp_zone(gfp_mask), nmask) {
struct folio *folio;
+ /* A rebuild may have shifted a node outside @nmask into this slot. */
+ if (unlikely(check_retry_zonelist(zonelist_cookie)))
+ goto retry_cpuset;
+
if (!cpuset_zone_allowed(zone, gfp_mask))
continue;
/*
@@ -1369,7 +1375,8 @@ static struct folio *dequeue_hugetlb_folio_nodemask(struct hstate *h, gfp_t gfp_
if (folio)
return folio;
}
- if (unlikely(read_mems_allowed_retry(cpuset_mems_cookie)))
+ if (unlikely(read_mems_allowed_retry(cpuset_mems_cookie) ||
+ check_retry_zonelist(zonelist_cookie)))
goto retry_cpuset;
return NULL;
diff --git a/mm/internal.h b/mm/internal.h
index 7504592042b23..9f201e191af7a 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -14,6 +14,7 @@
#include <linux/pagemap.h>
#include <linux/pagewalk.h>
#include <linux/rmap.h>
+#include <linux/seqlock.h>
#include <linux/swap.h>
#include <linux/swapops.h>
#include <linux/swap_cgroup.h>
@@ -873,6 +874,24 @@ extern void zone_pcp_disable(struct zone *zone);
extern void zone_pcp_enable(struct zone *zone);
extern void zone_pcp_init(struct zone *zone);
+extern seqlock_t zonelist_update_seq;
+
+static inline unsigned int zonelist_iter_begin(void)
+{
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
+ return read_seqbegin(&zonelist_update_seq);
+
+ return 0;
+}
+
+static inline unsigned int check_retry_zonelist(unsigned int seq)
+{
+ if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
+ return read_seqretry(&zonelist_update_seq, seq);
+
+ return 0;
+}
+
extern void *memmap_alloc(phys_addr_t size, phys_addr_t align,
phys_addr_t min_addr,
int nid, bool exact_nid);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 2039fe1abfe15..ce32a8bb22da4 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4440,15 +4440,7 @@ EXPORT_SYMBOL_GPL(fs_reclaim_release);
* retries the allocation if zonelist changes. Writer side is protected by the
* embedded spin_lock.
*/
-static DEFINE_SEQLOCK(zonelist_update_seq);
-
-static unsigned int zonelist_iter_begin(void)
-{
- if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
- return read_seqbegin(&zonelist_update_seq);
-
- return 0;
-}
+DEFINE_SEQLOCK(zonelist_update_seq);
/*
* Never wait for the writer, which an ALLOC_NOLOCK caller in NMI may have
@@ -4463,14 +4455,6 @@ static unsigned int zonelist_iter_sample(void)
return 0;
}
-static unsigned int check_retry_zonelist(unsigned int seq)
-{
- if (IS_ENABLED(CONFIG_MEMORY_HOTPLUG))
- return read_seqretry(&zonelist_update_seq, seq);
-
- return 0;
-}
-
/* Perform direct synchronous page reclaim */
static unsigned long
__perform_reclaim(gfp_t gfp_mask, unsigned int order,
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 065/703] page_alloc: allow migration of smaller hugepages during contig_alloc
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 064/703] mm/hugetlb: retry the pool walk when the zonelist is rebuilt Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 066/703] mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt Greg Kroah-Hartman
` (72 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price, David Hildenbrand,
Zi Yan, Wei Yang, Michal Hocko, David Hildenbrand (Red Hat),
Brendan Jackman, Johannes Weiner, Suren Baghdasaryan,
Vlastimil Babka, Andrew Morton, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price <gourry@gourry.net>
[ Upstream commit 3bb64898f00368cd110d4b31334f93251d56b404 ]
We presently skip regions with hugepages entirely when trying to do
contiguous page allocation. This will cause otherwise-movable 2MB HugeTLB
pages to be considered unmovable, and makes 1GB gigantic page allocation
less reliable on systems utilizing both.
Commit 4d73ba5fa710 ("mm: page_alloc: skip regions with hugetlbfs pages
when allocating 1G pages") skipped all HugePage containing regions because
it can cause significant delays in 1G allocation (as HugeTLB migrations
may fail for a number of reasons).
Instead, if hugepage migration is enabled, consider regions with hugepages
smaller than the target contiguous allocation request as valid targets for
allocation.
We optimize for the existing behavior by searching for non-hugetlb regions
in a first pass, then retrying the search to include hugetlb only on
failure. This allows the existing fast-path to remain the default case
with a slow-path fallback to increase reliability.
We only fallback to the slow path if a hugetlb region was detected, and we
do a full re-scan because the zones/blocks may have changed during the
first pass (and it's not worth further complexity).
isolate_migrate_pages_block() has similar hugetlb filter logic, and the
hugetlb code does a migratable check in folio_isolate_hugetlb() during
isolation. The code servicing the allocation and migration already
supports this exact use case.
To test, allocate a bunch of 2MB HugeTLB pages (in this case 48GB) and
then attempt to allocate some 1G HugeTLB pages (in this case 4GB) (Scale
to your machine's memory capacity).
echo 24576 > .../hugepages-2048kB/nr_hugepages
echo 4 > .../hugepages-1048576kB/nr_hugepages
Prior to this patch, the 1GB page reservation can fail if no contiguous
1GB pages remain. After this patch, the kernel will try to move 2MB pages
and successfully allocate the 1GB pages (assuming overall sufficient
memory is available). Also tested this while a program had the 2MB
reservations mapped, and the 1GB reservation still succeeds.
folio_alloc_gigantic() is the primary user of alloc_contig_pages(),
other users are debug or init-time allocations and largely unaffected.
- ppc/memtrace is a debugfs interface
- x86/tdx memory allocation occurs once on module-init
- kfence/core happens once on module (late) init
- THP uses it in debug_vm_pgtable_alloc_huge_page at __init time
Link: https://lkml.kernel.org/r/20251221124656.2362540-1-gourry@gourry.net
Signed-off-by: Gregory Price <gourry@gourry.net>
Suggested-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/linux-mm/6fe3562d-49b2-4975-aa86-e139c535ad00@redhat.com/
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: da0d7a895e90 ("mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 59 +++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 55 insertions(+), 4 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ce32a8bb22da4..b8dc3071a9053 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7277,7 +7277,8 @@ static int __alloc_contig_pages(unsigned long start_pfn,
}
static bool pfn_range_valid_contig(struct zone *z, unsigned long start_pfn,
- unsigned long nr_pages)
+ unsigned long nr_pages, bool skip_hugetlb,
+ bool *skipped_hugetlb)
{
unsigned long i, end_pfn = start_pfn + nr_pages;
struct page *page;
@@ -7293,8 +7294,42 @@ static bool pfn_range_valid_contig(struct zone *z, unsigned long start_pfn,
if (PageReserved(page))
return false;
- if (PageHuge(page))
- return false;
+ /*
+ * Only consider ranges containing hugepages if those pages are
+ * smaller than the requested contiguous region. e.g.:
+ * Move 2MB pages to free up a 1GB range.
+ * Don't move 1GB pages to free up a 2MB range.
+ *
+ * This makes contiguous allocation more reliable if multiple
+ * hugepage sizes are used without causing needless movement.
+ */
+ if (PageHuge(page)) {
+ unsigned int order;
+
+ if (!IS_ENABLED(CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION))
+ return false;
+
+ if (skip_hugetlb) {
+ *skipped_hugetlb = true;
+ return false;
+ }
+
+ page = compound_head(page);
+ order = compound_order(page);
+ if ((order >= MAX_FOLIO_ORDER) ||
+ (nr_pages <= (1 << order)))
+ return false;
+
+ /*
+ * Reaching this point means we've encounted a huge page
+ * smaller than nr_pages, skip all pfn's for that page.
+ *
+ * We can't get here from a tail-PageHuge, as it implies
+ * we started a scan in the middle of a hugepage larger
+ * than nr_pages - which the prior check filters for.
+ */
+ i += (1 << order) - 1;
+ }
}
return true;
}
@@ -7337,7 +7372,10 @@ struct page *alloc_contig_pages_noprof(unsigned long nr_pages, gfp_t gfp_mask,
struct zonelist *zonelist;
struct zone *zone;
struct zoneref *z;
+ bool skip_hugetlb = true;
+ bool skipped_hugetlb = false;
+retry:
zonelist = node_zonelist(nid, gfp_mask);
for_each_zone_zonelist_nodemask(zone, z, zonelist,
gfp_zone(gfp_mask), nodemask) {
@@ -7345,7 +7383,9 @@ struct page *alloc_contig_pages_noprof(unsigned long nr_pages, gfp_t gfp_mask,
pfn = ALIGN(zone->zone_start_pfn, nr_pages);
while (zone_spans_last_pfn(zone, pfn, nr_pages)) {
- if (pfn_range_valid_contig(zone, pfn, nr_pages)) {
+ if (pfn_range_valid_contig(zone, pfn, nr_pages,
+ skip_hugetlb,
+ &skipped_hugetlb)) {
/*
* We release the zone lock here because
* alloc_contig_range() will also lock the zone
@@ -7364,6 +7404,17 @@ struct page *alloc_contig_pages_noprof(unsigned long nr_pages, gfp_t gfp_mask,
}
spin_unlock_irqrestore(&zone->lock, flags);
}
+ /*
+ * If we failed, retry the search, but treat regions with HugeTLB pages
+ * as valid targets. This retains fast-allocations on first pass
+ * without trying to migrate HugeTLB pages (which may fail). On the
+ * second pass, we will try moving HugeTLB pages when those pages are
+ * smaller than the requested contiguous region size.
+ */
+ if (skip_hugetlb && skipped_hugetlb) {
+ skip_hugetlb = false;
+ goto retry;
+ }
return NULL;
}
#endif /* CONFIG_CONTIG_ALLOC */
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 066/703] mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 065/703] page_alloc: allow migration of smaller hugepages during contig_alloc Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 067/703] mm: page_isolation: introduce page_is_unmovable() Greg Kroah-Hartman
` (71 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gregory Price (Meta),
Vlastimil Babka (SUSE), Zi Yan, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory Price (Meta) <gourry@gourry.net>
[ Upstream commit da0d7a895e9021dc2cffa90fb6fafd8b9379e544 ]
Onlining the first block of a zone rebuilds every zonelist in place,
shifting the slots after the new zone.
alloc_contig_frozen_pages_noprof() approves a slot by the caller's gfp
and nodemask, then loads the zone from it:
CPU 0 CPU 1
alloc_contig_frozen_pages_noprof(GFP_HIGHUSER | __GFP_THISNODE)
slot 0 (NORMAL1) approved
online_pages()
build_all_zonelists()
[NORMAL1]
-> [MOVABLE1, NORMAL1]
zone = zonelist_zone(slot 0) /* MOVABLE1 */
alloc_contig_frozen_range(MOVABLE1 pfns)
A gigantic hugetlb page can then land in ZONE_MOVABLE, and a nodemask
caller can get a range from another node. Gigantic pages are kept out
of ZONE_MOVABLE since commit 79b63f12abcb ("mm, hugetlb: do not allocate
non-migrateable gigantic pages from movable zones").
Check zonelist_update_seq before using each zone, and restart the walk
if it changed, as the hugetlb pool walk does. Check again before
escalating to the pass that may migrate hugetlb pages, so a pass a
rebuild cut short is redone rather than escalated.
With kprobes holding the walk across the online, the base kernel put the
1G page in ZONE_MOVABLE in 3 of 3 runs, and this change put it in
ZONE_NORMAL in 3 of 3. Direct GFP_KERNEL calls with nodemask {1} and
{2} got a ZONE_MOVABLE range and a node 1 range on base, 3 of 3 each,
and neither with this change.
Fixes: 5e27a2df03b8 ("mm/page_alloc: add alloc_contig_pages()")
Cc: stable@vger.kernel.org
Signed-off-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Link: https://patch.msgid.link/20261101021340.2251928-11-gourry@gourry.net
Acked-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index b8dc3071a9053..f041971e79b42 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -7369,6 +7369,7 @@ struct page *alloc_contig_pages_noprof(unsigned long nr_pages, gfp_t gfp_mask,
int nid, nodemask_t *nodemask)
{
unsigned long ret, pfn, flags;
+ unsigned int zonelist_cookie;
struct zonelist *zonelist;
struct zone *zone;
struct zoneref *z;
@@ -7377,8 +7378,13 @@ struct page *alloc_contig_pages_noprof(unsigned long nr_pages, gfp_t gfp_mask,
retry:
zonelist = node_zonelist(nid, gfp_mask);
+ zonelist_cookie = zonelist_iter_begin();
for_each_zone_zonelist_nodemask(zone, z, zonelist,
gfp_zone(gfp_mask), nodemask) {
+ /* A rebuild may have shifted an ineligible zone into this slot. */
+ if (unlikely(check_retry_zonelist(zonelist_cookie)))
+ goto retry;
+
spin_lock_irqsave(&zone->lock, flags);
pfn = ALIGN(zone->zone_start_pfn, nr_pages);
@@ -7411,6 +7417,9 @@ struct page *alloc_contig_pages_noprof(unsigned long nr_pages, gfp_t gfp_mask,
* second pass, we will try moving HugeTLB pages when those pages are
* smaller than the requested contiguous region size.
*/
+ /* Redo a pass that a rebuild cut short before escalating. */
+ if (unlikely(check_retry_zonelist(zonelist_cookie)))
+ goto retry;
if (skip_hugetlb && skipped_hugetlb) {
skip_hugetlb = false;
goto retry;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 067/703] mm: page_isolation: introduce page_is_unmovable()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 066/703] mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 068/703] mm/memory_hotplug: fix possible race in scan_movable_pages() Greg Kroah-Hartman
` (70 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kefeng Wang, Zi Yan, Oscar Salvador,
Brendan Jackman, David Hildenbrand, Jane Chu, Johannes Weiner,
Matthew Wilcox (Oracle), Muchun Song, Sidhartha Kumar,
Vlastimil Babka, Andrew Morton, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kefeng Wang <wangkefeng.wang@huawei.com>
[ Upstream commit c83109e95c9d78e41b39e65b6490e511f4b8fba2 ]
Patch series "mm: accelerate gigantic folio allocation".
Optimize pfn_range_valid_contig() and replace_free_hugepage_folios() in
alloc_contig_frozen_pages() to speed up gigantic folio allocation. The
allocation time for 120*1G folios drops from 3.605s to 0.431s.
This patch (of 5):
Factor out the check if a page is unmovable into a new helper, and will be
reused in the following patch.
No functional change intended, the minor changes are as follows,
1) Avoid unnecessary calls by checking CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
2) Directly call PageCompound since PageTransCompound may be dropped
3) Using folio_test_hugetlb()
Link: https://lkml.kernel.org/r/20260112150954.1802953-1-wangkefeng.wang@huawei.com
Link: https://lkml.kernel.org/r/20260112150954.1802953-2-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 213268869301 ("mm: page_isolation: do not take slab pages for free")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/page-isolation.h | 2 +
mm/page_isolation.c | 187 +++++++++++++++++----------------
2 files changed, 101 insertions(+), 88 deletions(-)
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
index 3e2f960e166ca..6f8638c9904ff 100644
--- a/include/linux/page-isolation.h
+++ b/include/linux/page-isolation.h
@@ -67,4 +67,6 @@ void undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn);
int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
enum pb_isolate_mode mode);
+bool page_is_unmovable(struct zone *zone, struct page *page,
+ enum pb_isolate_mode mode, unsigned long *step);
#endif
diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index 2e366e7bd5e93..7a32350eb8c2d 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -15,6 +15,100 @@
#define CREATE_TRACE_POINTS
#include <trace/events/page_isolation.h>
+bool page_is_unmovable(struct zone *zone, struct page *page,
+ enum pb_isolate_mode mode, unsigned long *step)
+{
+ /*
+ * Both, bootmem allocations and memory holes are marked
+ * PG_reserved and are unmovable. We can even have unmovable
+ * allocations inside ZONE_MOVABLE, for example when
+ * specifying "movablecore".
+ */
+ if (PageReserved(page))
+ return true;
+
+ /*
+ * If the zone is movable and we have ruled out all reserved
+ * pages then it should be reasonably safe to assume the rest
+ * is movable.
+ */
+ if (zone_idx(zone) == ZONE_MOVABLE)
+ return false;
+
+ /*
+ * Hugepages are not in LRU lists, but they're movable.
+ * THPs are on the LRU, but need to be counted as #small pages.
+ * We need not scan over tail pages because we don't
+ * handle each tail page individually in migration.
+ */
+ if (PageHuge(page) || PageCompound(page)) {
+ struct folio *folio = page_folio(page);
+
+ if (folio_test_hugetlb(folio)) {
+ struct hstate *h;
+
+ if (!IS_ENABLED(CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION))
+ return true;
+
+ /*
+ * The huge page may be freed so can not
+ * use folio_hstate() directly.
+ */
+ h = size_to_hstate(folio_size(folio));
+ if (h && !hugepage_migration_supported(h))
+ return true;
+
+ } else if (!folio_test_lru(folio)) {
+ return true;
+ }
+
+ *step = folio_nr_pages(folio) - folio_page_idx(folio, page);
+ return false;
+ }
+
+ /*
+ * We can't use page_count without pin a page
+ * because another CPU can free compound page.
+ * This check already skips compound tails of THP
+ * because their page->_refcount is zero at all time.
+ */
+ if (!page_ref_count(page)) {
+ if (PageBuddy(page))
+ *step = (1 << buddy_order(page));
+ return false;
+ }
+
+ /*
+ * The HWPoisoned page may be not in buddy system, and
+ * page_count() is not 0.
+ */
+ if ((mode == PB_ISOLATE_MODE_MEM_OFFLINE) && PageHWPoison(page))
+ return false;
+
+ /*
+ * We treat all PageOffline() pages as movable when offlining
+ * to give drivers a chance to decrement their reference count
+ * in MEM_GOING_OFFLINE in order to indicate that these pages
+ * can be offlined as there are no direct references anymore.
+ * For actually unmovable PageOffline() where the driver does
+ * not support this, we will fail later when trying to actually
+ * move these pages that still have a reference count > 0.
+ * (false negatives in this function only)
+ */
+ if ((mode == PB_ISOLATE_MODE_MEM_OFFLINE) && PageOffline(page))
+ return false;
+
+ if (PageLRU(page) || page_has_movable_ops(page))
+ return false;
+
+ /*
+ * If there are RECLAIMABLE pages, we need to check
+ * it. But now, memory offline itself doesn't call
+ * shrink_node_slabs() and it still to be fixed.
+ */
+ return true;
+}
+
/*
* This function checks whether the range [start_pfn, end_pfn) includes
* unmovable pages or not. The range must fall into a single pageblock and
@@ -35,7 +129,6 @@ static struct page *has_unmovable_pages(unsigned long start_pfn, unsigned long e
{
struct page *page = pfn_to_page(start_pfn);
struct zone *zone = page_zone(page);
- unsigned long pfn;
VM_BUG_ON(pageblock_start_pfn(start_pfn) !=
pageblock_start_pfn(end_pfn - 1));
@@ -52,96 +145,14 @@ static struct page *has_unmovable_pages(unsigned long start_pfn, unsigned long e
return page;
}
- for (pfn = start_pfn; pfn < end_pfn; pfn++) {
- page = pfn_to_page(pfn);
+ while (start_pfn < end_pfn) {
+ unsigned long step = 1;
- /*
- * Both, bootmem allocations and memory holes are marked
- * PG_reserved and are unmovable. We can even have unmovable
- * allocations inside ZONE_MOVABLE, for example when
- * specifying "movablecore".
- */
- if (PageReserved(page))
+ page = pfn_to_page(start_pfn);
+ if (page_is_unmovable(zone, page, mode, &step))
return page;
- /*
- * If the zone is movable and we have ruled out all reserved
- * pages then it should be reasonably safe to assume the rest
- * is movable.
- */
- if (zone_idx(zone) == ZONE_MOVABLE)
- continue;
-
- /*
- * Hugepages are not in LRU lists, but they're movable.
- * THPs are on the LRU, but need to be counted as #small pages.
- * We need not scan over tail pages because we don't
- * handle each tail page individually in migration.
- */
- if (PageHuge(page) || PageTransCompound(page)) {
- struct folio *folio = page_folio(page);
- unsigned int skip_pages;
-
- if (PageHuge(page)) {
- struct hstate *h;
-
- /*
- * The huge page may be freed so can not
- * use folio_hstate() directly.
- */
- h = size_to_hstate(folio_size(folio));
- if (h && !hugepage_migration_supported(h))
- return page;
- } else if (!folio_test_lru(folio)) {
- return page;
- }
-
- skip_pages = folio_nr_pages(folio) - folio_page_idx(folio, page);
- pfn += skip_pages - 1;
- continue;
- }
-
- /*
- * We can't use page_count without pin a page
- * because another CPU can free compound page.
- * This check already skips compound tails of THP
- * because their page->_refcount is zero at all time.
- */
- if (!page_ref_count(page)) {
- if (PageBuddy(page))
- pfn += (1 << buddy_order(page)) - 1;
- continue;
- }
-
- /*
- * The HWPoisoned page may be not in buddy system, and
- * page_count() is not 0.
- */
- if ((mode == PB_ISOLATE_MODE_MEM_OFFLINE) && PageHWPoison(page))
- continue;
-
- /*
- * We treat all PageOffline() pages as movable when offlining
- * to give drivers a chance to decrement their reference count
- * in MEM_GOING_OFFLINE in order to indicate that these pages
- * can be offlined as there are no direct references anymore.
- * For actually unmovable PageOffline() where the driver does
- * not support this, we will fail later when trying to actually
- * move these pages that still have a reference count > 0.
- * (false negatives in this function only)
- */
- if ((mode == PB_ISOLATE_MODE_MEM_OFFLINE) && PageOffline(page))
- continue;
-
- if (PageLRU(page) || page_has_movable_ops(page))
- continue;
-
- /*
- * If there are RECLAIMABLE pages, we need to check
- * it. But now, memory offline itself doesn't call
- * shrink_node_slabs() and it still to be fixed.
- */
- return page;
+ start_pfn += step;
}
return NULL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 068/703] mm/memory_hotplug: fix possible race in scan_movable_pages()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 067/703] mm: page_isolation: introduce page_is_unmovable() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 069/703] mm: page_isolation: do not take slab pages for free Greg Kroah-Hartman
` (69 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Hildenbrand (Arm),
Lorenzo Stoakes (Oracle), Axel Rasmussen, Liam Howlett,
Michal Hocko, Mike Rapoport, Oscar Salvador, Sidhartha Kumar,
Suren Baghdasaryan, Vlastimil Babka, Wei Xu, Yuanchu Xie,
Andrew Morton, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand (Arm) <david@kernel.org>
[ Upstream commit 89e69c7d187eca8a040d4db0e080f79b5b32163d ]
Patch series "mm: memory hot(un)plug and SPARSEMEM cleanups", v2.
Some cleanups around memory hot(un)plug and SPARSEMEM. In essence, we can
limit CONFIG_MEMORY_HOTPLUG to CONFIG_SPARSEMEM_VMEMMAP, remove some dead
code, and move all the hotplug bits over to mm/sparse-vmemmap.c.
Some further/related cleanups around other unnecessary code (memory hole
handling and complicated usemap allocation).
I have some further sparse.c cleanups lying around, and I'm planning on
getting rid of bootmem_info.c entirely.
This patch (of 15):
If a hugetlb folio gets freed while we are in scan_movable_pages(),
folio_nr_pages() could return 0, resulting in or'ing "0 - 1 = -1" to the
PFN, resulting in PFN = -1. We're not holding any locks or references
that would prevent that.
for_each_valid_pfn() would then search for the next valid PFN, and could
return a PFN that is outside of the range of the original requested range.
do_migrate_page() would then try to migrate quite a big range, which is
certainly undesirable.
To fix it, simply test for valid folio_nr_pages() values. While at it, as
PageHuge() really just does a page_folio() internally, we can just use
folio_test_hugetlb() on the folio directly.
scan_movable_pages() is expected to be fast, and we try to avoid taking
locks or grabbing references. We cannot use folio_try_get() as that does
not work for free hugetlb folios. We could grab the hugetlb_lock, but
that just adds complexity.
The race is unlikely to trigger in practice, so we won't be CCing stable.
Link: https://lkml.kernel.org/r/20260320-sparsemem_cleanups-v2-0-096addc8800d@kernel.org
Link: https://lkml.kernel.org/r/20260320-sparsemem_cleanups-v2-1-096addc8800d@kernel.org
Fixes: 16540dae959d ("mm/hugetlb: mm/memory_hotplug: use a folio in scan_movable_pages()")
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 213268869301 ("mm: page_isolation: do not take slab pages for free")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memory_hotplug.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index bdc064c026ec1..e62c196dfdfb8 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1782,6 +1782,7 @@ static int scan_movable_pages(unsigned long start, unsigned long end,
unsigned long pfn;
for_each_valid_pfn(pfn, start, end) {
+ unsigned long nr_pages;
struct page *page;
struct folio *folio;
@@ -1798,9 +1799,9 @@ static int scan_movable_pages(unsigned long start, unsigned long end,
if (PageOffline(page) && page_count(page))
return -EBUSY;
- if (!PageHuge(page))
- continue;
folio = page_folio(page);
+ if (!folio_test_hugetlb(folio))
+ continue;
/*
* This test is racy as we hold no reference or lock. The
* hugetlb page could have been free'ed and head is no longer
@@ -1810,7 +1811,11 @@ static int scan_movable_pages(unsigned long start, unsigned long end,
*/
if (folio_test_hugetlb_migratable(folio))
goto found;
- pfn |= folio_nr_pages(folio) - 1;
+ nr_pages = folio_nr_pages(folio);
+ if (unlikely(nr_pages < 1 || nr_pages > MAX_FOLIO_NR_PAGES ||
+ !is_power_of_2(nr_pages)))
+ continue;
+ pfn |= nr_pages - 1;
}
return -ENOENT;
found:
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 069/703] mm: page_isolation: do not take slab pages for free
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 068/703] mm/memory_hotplug: fix possible race in scan_movable_pages() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 070/703] mm: rejig pageblock mask definitions Greg Kroah-Hartman
` (68 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, David Hildenbrand (Arm),
Zi Yan, Johannes Weiner, Vlastimil Babka (SUSE), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 213268869301f747d19ca00a391757a6cf2d4fa8 ]
page_is_unmovable() regards a page with a reference count of zero as free
or about to be freed. Since slab allocates frozen pages, they will
be wrongly considered to be freed if order 0 (higher-order compound
pages are caught earlier).
If such slabs are the only unmovable pages of a memory block, memory
offlining now isolates the block, this can lead to offline_pages()
looping without progress.
Thus detect the slab pages as removable to return -EBUSY, as would
happen before commit 9aec2fb0fd5e ("slab: allocate frozen pages").
Fixes: 9aec2fb0fd5e ("slab: allocate frozen pages")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-3-e0d2890ab74f@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/memory_hotplug.c | 7 +++++++
mm/page_isolation.c | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index e62c196dfdfb8..1f29e1a64d181 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1799,6 +1799,13 @@ static int scan_movable_pages(unsigned long start, unsigned long end,
if (PageOffline(page) && page_count(page))
return -EBUSY;
+ /*
+ * A page that was allocated, but was not a slab page yet, when
+ * its pageblock was isolated.
+ */
+ if (PageSlab(page))
+ return -EBUSY;
+
folio = page_folio(page);
if (!folio_test_hugetlb(folio))
continue;
diff --git a/mm/page_isolation.c b/mm/page_isolation.c
index 7a32350eb8c2d..63c29a5527486 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -66,6 +66,13 @@ bool page_is_unmovable(struct zone *zone, struct page *page,
return false;
}
+ /*
+ * Slab pages are frozen: do not take their reference count of zero
+ * for that of a free page.
+ */
+ if (PageSlab(page))
+ return true;
+
/*
* We can't use page_count without pin a page
* because another CPU can free compound page.
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 070/703] mm: rejig pageblock mask definitions
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 069/703] mm: page_isolation: do not take slab pages for free Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 071/703] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx() Greg Kroah-Hartman
` (67 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Brendan Jackman,
Vlastimil Babka (SUSE), Axel Rasmussen, Barry Song,
David Hildenbrand, Johannes Weiner, Kairui Song, Len Brown,
Liam R. Howlett, Lorenzo Stoakes, Michal Hocko,
Mike Rapoport (Microsoft), Rafael J. Wysocki, Shakeel Butt,
Suren Baghdasaryan, Wei Xu, Yuanchu Xie, Zi Yan, Andrew Morton,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brendan Jackman <jackmanb@google.com>
[ Upstream commit 3687c0fd67249cb971990b382a47f02f19ed9f67 ]
- Add a PAGEBLOCK_ prefix to the names to avoid polluting the "global
namespace" too much.
- This new prefix makes MIGRATETYPE_AND_ISO_MASK look pretty long. Well,
that global mask only exists for quite a specific purpose, and is
quite a weird thing to have a name for anyway. So drop it and take
advantage of the newly-defined PAGEBLOCK_ISO_MASK.
Link: https://lore.kernel.org/20260513-page_alloc-unmapped-prep-v1-3-dacdf5402be8@google.com
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 2122887b04f3 ("mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/pageblock-flags.h | 6 +++---
mm/page_alloc.c | 18 +++++++++---------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index e046278a01fa8..9a6c3ea17684d 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -36,12 +36,12 @@ enum pageblock_bits {
#define NR_PAGEBLOCK_BITS (roundup_pow_of_two(__NR_PAGEBLOCK_BITS))
-#define MIGRATETYPE_MASK (BIT(PB_migrate_0)|BIT(PB_migrate_1)|BIT(PB_migrate_2))
+#define PAGEBLOCK_MIGRATETYPE_MASK (BIT(PB_migrate_0)|BIT(PB_migrate_1)|BIT(PB_migrate_2))
#ifdef CONFIG_MEMORY_ISOLATION
-#define MIGRATETYPE_AND_ISO_MASK (MIGRATETYPE_MASK | BIT(PB_migrate_isolate))
+#define PAGEBLOCK_ISO_MASK BIT(PB_migrate_isolate)
#else
-#define MIGRATETYPE_AND_ISO_MASK MIGRATETYPE_MASK
+#define PAGEBLOCK_ISO_MASK 0
#endif
#if defined(CONFIG_HUGETLB_PAGE)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index f041971e79b42..5cd96eaf8d7ae 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -400,7 +400,7 @@ get_pfnblock_bitmap_bitidx(const struct page *page, unsigned long pfn,
#else
BUILD_BUG_ON(NR_PAGEBLOCK_BITS != 4);
#endif
- BUILD_BUG_ON(__MIGRATE_TYPE_END > MIGRATETYPE_MASK);
+ BUILD_BUG_ON(__MIGRATE_TYPE_END > PAGEBLOCK_MIGRATETYPE_MASK);
VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page);
bitmap = get_pageblock_bitmap(page, pfn);
@@ -473,7 +473,7 @@ bool get_pfnblock_bit(const struct page *page, unsigned long pfn,
__always_inline enum migratetype
get_pfnblock_migratetype(const struct page *page, unsigned long pfn)
{
- unsigned long mask = MIGRATETYPE_AND_ISO_MASK;
+ unsigned long mask = PAGEBLOCK_MIGRATETYPE_MASK | PAGEBLOCK_ISO_MASK;
unsigned long flags;
flags = __get_pfnblock_flags_mask(page, pfn, mask);
@@ -482,7 +482,7 @@ get_pfnblock_migratetype(const struct page *page, unsigned long pfn)
if (flags & BIT(PB_migrate_isolate))
return MIGRATE_ISOLATE;
#endif
- return flags & MIGRATETYPE_MASK;
+ return flags & PAGEBLOCK_MIGRATETYPE_MASK;
}
/**
@@ -570,11 +570,11 @@ static void set_pageblock_migratetype(struct page *page,
}
VM_WARN_ONCE(get_pageblock_isolate(page),
"Use clear_pageblock_isolate() to unisolate pageblock");
- /* MIGRATETYPE_AND_ISO_MASK clears PB_migrate_isolate if it is set */
+ /* PAGEBLOCK_ISO_MASK clears PB_migrate_isolate if it is set */
#endif
__set_pfnblock_flags_mask(page, page_to_pfn(page),
(unsigned long)migratetype,
- MIGRATETYPE_AND_ISO_MASK);
+ PAGEBLOCK_MIGRATETYPE_MASK | PAGEBLOCK_ISO_MASK);
}
void __meminit init_pageblock_migratetype(struct page *page,
@@ -600,7 +600,7 @@ void __meminit init_pageblock_migratetype(struct page *page,
flags |= BIT(PB_migrate_isolate);
#endif
__set_pfnblock_flags_mask(page, page_to_pfn(page), flags,
- MIGRATETYPE_AND_ISO_MASK);
+ PAGEBLOCK_MIGRATETYPE_MASK | PAGEBLOCK_ISO_MASK);
}
#ifdef CONFIG_DEBUG_VM
@@ -2181,15 +2181,15 @@ static bool __move_freepages_block_isolate(struct zone *zone,
}
move:
- /* Use MIGRATETYPE_MASK to get non-isolate migratetype */
+ /* Use PAGEBLOCK_MIGRATETYPE_MASK to get non-isolate migratetype */
if (isolate) {
from_mt = __get_pfnblock_flags_mask(page, page_to_pfn(page),
- MIGRATETYPE_MASK);
+ PAGEBLOCK_MIGRATETYPE_MASK);
to_mt = MIGRATE_ISOLATE;
} else {
from_mt = MIGRATE_ISOLATE;
to_mt = __get_pfnblock_flags_mask(page, page_to_pfn(page),
- MIGRATETYPE_MASK);
+ PAGEBLOCK_MIGRATETYPE_MASK);
}
__move_freepages_block(zone, start_pfn, from_mt, to_mt);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 071/703] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 070/703] mm: rejig pageblock mask definitions Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 072/703] Bluetooth: L2CAP: Only accept LE responses to outstanding requests Greg Kroah-Hartman
` (66 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Josef Bacik, Vlastimil Babka (SUSE),
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlastimil Babka (SUSE) <vbabka@kernel.org>
[ Upstream commit 2122887b04f3f2d76daa80055c2c273926032fa0 ]
Whenever the flags of a pageblock are read or written, a kernel with
CONFIG_DEBUG_VM makes sure that the pfn lies within the zone of the page.
Unlike bad_range(), that check reads zone->zone_start_pfn and
zone->spanned_pages without zone->span_seqlock.
Memory hotplug changes the two fields one after the other. If the lower
end of a zone moves, the zone seems to end before its last pages in
between. A page of that part which is freed at that moment, on another
CPU, ends in
page dumped because: VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn))
kernel BUG at mm/page_alloc.c:372!
free_unref_folios+0x55e/0xed0
folios_put_refs+0x2b5/0x530
An attempt has been made [1] to fix this with the span seqlock check.
But that can trigger all sorts of problems in restricted contexts, as
noted by sashiko [2].
Since this is just a sanity debug check and anything with BUG_ON is
frowned upon anyway, just remove it altogether.
Reported-by: Josef Bacik <josef@toxicpanda.com>
Closes: https://lore.kernel.org/all/20261027-pgalloc-ai-hotfixes-v1-9-9c7d1aca801e@kernel.org/ [1]
Link: https://lore.kernel.org/all/sashiko-outbox-188081@kernel.org/ [2]
Fixes: 86051ca5eaf5 ("mm: fix usemap initialization")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-5-e0d2890ab74f@kernel.org
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5cd96eaf8d7ae..9c4d5650f47d0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -401,7 +401,6 @@ get_pfnblock_bitmap_bitidx(const struct page *page, unsigned long pfn,
BUILD_BUG_ON(NR_PAGEBLOCK_BITS != 4);
#endif
BUILD_BUG_ON(__MIGRATE_TYPE_END > PAGEBLOCK_MIGRATETYPE_MASK);
- VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page);
bitmap = get_pageblock_bitmap(page, pfn);
*bitidx = pfn_to_bitidx(page, pfn);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 072/703] Bluetooth: L2CAP: Only accept LE responses to outstanding requests
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 071/703] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 073/703] spi: tegra210-quad: Refactor error handling into helper functions Greg Kroah-Hartman
` (65 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhao Li, Luiz Augusto von Dentz,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhao Li <enderaoelyther@gmail.com>
[ Upstream commit f50b32aa233d4687af2d241ddcb572da969e8989 ]
The LE and ECRED response handlers match channels by identifier without
checking whether they sent the request. An incoming channel stores the
identifier chosen by the peer, so an unsolicited response can bypass
deferred setup, delete an established channel, or leave an unaccepted
socket and channel allocated after l2cap_chan_del().
Extend the BR/EDR lookup from commit a518b9a9ef6e ("Bluetooth: L2CAP:
Only accept connection responses to outstanding requests") to LE.
Require the matching connect-request flag and add a reconfigure-request
flag. Check reconfigure identifiers under the channel lock, since
BT_RCVMTU can replace a request without the connection lock. Match all
members of a rejected ECRED request, which share one identifier.
A reconfigure request can outlive close(). Complete it even in
BT_DISCONN, and call the close callback after deletion to release an
orphaned socket. Otherwise deletion cancels the timer and removes the
channel before the disconnect response or the channel timeout can close
it.
AI assistance was used.
Fixes: f1496dee9cbd ("Bluetooth: Add initial code for LE L2CAP Connect Request")
Fixes: 71fb419724fa ("Bluetooth: Fix handling of L2CAP Command Reject over LE")
Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
Cc: <stable@vger.kernel.org> # 5.7.x: a518b9a9ef6e: Bluetooth: L2CAP: Only accept connection responses to outstanding requests
Cc: <stable@vger.kernel.org> # 5.7.x
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ sashal: Dropped the __must_hold(&conn->lock) annotations and lockdep_assert_held() calls, and adjusted context in the l2cap_chan_lock and hold lines, because the older tree lacks them. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/bluetooth/l2cap.h | 1 +
net/bluetooth/l2cap_core.c | 78 +++++++++++++++++------------------
2 files changed, 40 insertions(+), 39 deletions(-)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index d56db97d45c5d..89b8af8d3e0a7 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -752,6 +752,7 @@ enum {
FLAG_DEFER_SETUP,
FLAG_LE_CONN_REQ_SENT,
FLAG_ECRED_CONN_REQ_SENT,
+ FLAG_ECRED_RECONF_REQ_SENT,
FLAG_PENDING_SECURITY,
FLAG_HOLD_HCI_CONN,
FLAG_DEL,
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index eef49a65084b4..d03a20b87287b 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -149,23 +149,12 @@ static struct l2cap_chan *l2cap_get_chan_by_dcid(struct l2cap_conn *conn,
return c;
}
-static struct l2cap_chan *__l2cap_get_chan_by_ident(struct l2cap_conn *conn,
- u8 ident)
-{
- struct l2cap_chan *c;
-
- list_for_each_entry(c, &conn->chan_l, list) {
- if (c->ident == ident)
- return c;
- }
- return NULL;
-}
-
/* Our connection request has been sent and is still outstanding */
static bool l2cap_chan_connect_pending(struct l2cap_chan *chan)
{
return chan->state == BT_CONNECT &&
- test_bit(CONF_CONNECT_PEND, &chan->conf_state);
+ (test_bit(CONF_CONNECT_PEND, &chan->conf_state) ||
+ test_bit(FLAG_LE_CONN_REQ_SENT, &chan->flags));
}
/* Other channels may hold the same ident for a response they still have
@@ -177,7 +166,7 @@ static struct l2cap_chan *__l2cap_get_connect_chan_by_ident(struct l2cap_conn *c
struct l2cap_chan *c;
list_for_each_entry(c, &conn->chan_l, list) {
- if (c->ident == ident && l2cap_chan_connect_pending(c))
+ if (l2cap_chan_connect_pending(c) && c->ident == ident)
return c;
}
return NULL;
@@ -4919,7 +4908,7 @@ static int l2cap_le_connect_rsp(struct l2cap_conn *conn,
BT_DBG("dcid 0x%4.4x mtu %u mps %u credits %u result 0x%2.2x",
dcid, mtu, mps, credits, result);
- chan = __l2cap_get_chan_by_ident(conn, cmd->ident);
+ chan = __l2cap_get_connect_chan_by_ident(conn, cmd->ident);
if (!chan)
return -EBADSLT;
@@ -5454,9 +5443,10 @@ static inline int l2cap_ecred_conn_rsp(struct l2cap_conn *conn,
struct l2cap_chan *orig;
u16 dcid;
- if (chan->ident != cmd->ident ||
+ if (chan->state != BT_CONNECT ||
chan->mode != L2CAP_MODE_EXT_FLOWCTL ||
- chan->state == BT_CONNECTED)
+ !test_bit(FLAG_ECRED_CONN_REQ_SENT, &chan->flags) ||
+ chan->ident != cmd->ident)
continue;
l2cap_chan_hold(chan);
@@ -5671,23 +5661,24 @@ static inline int l2cap_ecred_reconf_rsp(struct l2cap_conn *conn,
BT_DBG("result 0x%4.4x", result);
- if (!result) {
- list_for_each_entry(chan, &conn->chan_l, list) {
- if (chan->ident == cmd->ident)
- chan->ident = 0;
- }
- return 0;
- }
-
list_for_each_entry_safe(chan, tmp, &conn->chan_l, list) {
- if (chan->ident != cmd->ident)
+ /* Reconfiguration updates ident with only chan->lock held. */
+ if (data_race(READ_ONCE(chan->ident)) != cmd->ident)
continue;
if (!l2cap_chan_hold_unless_zero(chan))
continue;
l2cap_chan_lock(chan);
- l2cap_chan_del(chan, ECONNRESET);
+ if (chan->ident == cmd->ident &&
+ test_and_clear_bit(FLAG_ECRED_RECONF_REQ_SENT, &chan->flags)) {
+ if (result) {
+ l2cap_chan_del(chan, ECONNRESET);
+ chan->ops->close(chan);
+ } else {
+ chan->ident = 0;
+ }
+ }
l2cap_chan_unlock(chan);
l2cap_chan_put(chan);
@@ -5701,25 +5692,33 @@ static inline int l2cap_le_command_rej(struct l2cap_conn *conn,
u8 *data)
{
struct l2cap_cmd_rej_unk *rej = (struct l2cap_cmd_rej_unk *) data;
- struct l2cap_chan *chan;
+ struct l2cap_chan *chan, *tmp;
if (cmd_len < sizeof(*rej))
return -EPROTO;
- chan = __l2cap_get_chan_by_ident(conn, cmd->ident);
- if (!chan)
- goto done;
+ list_for_each_entry_safe(chan, tmp, &conn->chan_l, list) {
+ /* Reconfiguration updates ident with only chan->lock held. */
+ if (data_race(READ_ONCE(chan->ident)) != cmd->ident)
+ continue;
- chan = l2cap_chan_hold_unless_zero(chan);
- if (!chan)
- goto done;
+ if (!l2cap_chan_hold_unless_zero(chan))
+ continue;
- l2cap_chan_lock(chan);
- l2cap_chan_del(chan, ECONNREFUSED);
- l2cap_chan_unlock(chan);
- l2cap_chan_put(chan);
+ l2cap_chan_lock(chan);
+ if (chan->ident == cmd->ident &&
+ ((chan->state == BT_CONNECT &&
+ (test_bit(FLAG_LE_CONN_REQ_SENT, &chan->flags) ||
+ test_bit(FLAG_ECRED_CONN_REQ_SENT, &chan->flags))) ||
+ test_bit(FLAG_ECRED_RECONF_REQ_SENT, &chan->flags))) {
+ l2cap_chan_del(chan, ECONNREFUSED);
+ chan->ops->close(chan);
+ }
+
+ l2cap_chan_unlock(chan);
+ l2cap_chan_put(chan);
+ }
-done:
return 0;
}
@@ -7558,6 +7557,7 @@ static void l2cap_ecred_reconfigure(struct l2cap_chan *chan)
pdu->scid[0] = cpu_to_le16(chan->scid);
chan->ident = l2cap_get_ident(conn);
+ set_bit(FLAG_ECRED_RECONF_REQ_SENT, &chan->flags);
l2cap_send_cmd(conn, chan->ident, L2CAP_ECRED_RECONF_REQ,
struct_size(pdu, scid, 1), pdu);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 073/703] spi: tegra210-quad: Refactor error handling into helper functions
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 072/703] Bluetooth: L2CAP: Only accept LE responses to outstanding requests Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 074/703] spi: tegra210-quad: Check hardware status on timeout Greg Kroah-Hartman
` (64 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vishwaroop A, Thierry Reding,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <va@nvidia.com>
[ Upstream commit 6022eacdda8b0b06a2e1d4122e5268099b62ff5d ]
Extract common cleanup code into dedicated helper functions to simplify
the code and improve readability. This refactoring includes:
- tegra_qspi_reset(): Device reset and interrupt cleanup
- tegra_qspi_dma_stop(): DMA termination and disable
- tegra_qspi_pio_stop(): PIO mode disable
No functional changes. This is purely a code reorganization to prepare
for improved timeout handling in subsequent patches.
Signed-off-by: Vishwaroop A <va@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20251028155703.4151791-3-va@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: d04ad85dd801 ("spi: tegra210-quad: Unmap DMA buffers on transfer timeout")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-tegra210-quad.c | 84 +++++++++++++++++----------------
1 file changed, 44 insertions(+), 40 deletions(-)
diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index b91d0131acc51..a7f8fef7d8256 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1048,17 +1048,22 @@ static void tegra_qspi_dump_regs(struct tegra_qspi *tqspi)
tegra_qspi_readl(tqspi, QSPI_FIFO_STATUS));
}
-static void tegra_qspi_handle_error(struct tegra_qspi *tqspi)
+static void tegra_qspi_reset(struct tegra_qspi *tqspi)
{
- dev_err(tqspi->dev, "error in transfer, fifo status 0x%08x\n", tqspi->status_reg);
- tegra_qspi_dump_regs(tqspi);
- tegra_qspi_flush_fifos(tqspi, true);
if (device_reset(tqspi->dev) < 0) {
dev_warn_once(tqspi->dev, "device reset failed\n");
tegra_qspi_mask_clear_irq(tqspi);
}
}
+static void tegra_qspi_handle_error(struct tegra_qspi *tqspi)
+{
+ dev_err(tqspi->dev, "error in transfer, fifo status 0x%08x\n", tqspi->status_reg);
+ tegra_qspi_dump_regs(tqspi);
+ tegra_qspi_flush_fifos(tqspi, true);
+ tegra_qspi_reset(tqspi);
+}
+
static void tegra_qspi_transfer_end(struct spi_device *spi)
{
struct tegra_qspi *tqspi = spi_controller_get_devdata(spi->controller);
@@ -1103,6 +1108,30 @@ static u32 tegra_qspi_addr_config(bool is_ddr, u8 bus_width, u8 len)
return addr_config;
}
+static void tegra_qspi_dma_stop(struct tegra_qspi *tqspi)
+{
+ u32 value;
+
+ if ((tqspi->cur_direction & DATA_DIR_TX) && tqspi->tx_dma_chan)
+ dmaengine_terminate_all(tqspi->tx_dma_chan);
+
+ if ((tqspi->cur_direction & DATA_DIR_RX) && tqspi->rx_dma_chan)
+ dmaengine_terminate_all(tqspi->rx_dma_chan);
+
+ value = tegra_qspi_readl(tqspi, QSPI_DMA_CTL);
+ value &= ~QSPI_DMA_EN;
+ tegra_qspi_writel(tqspi, value, QSPI_DMA_CTL);
+}
+
+static void tegra_qspi_pio_stop(struct tegra_qspi *tqspi)
+{
+ u32 value;
+
+ value = tegra_qspi_readl(tqspi, QSPI_COMMAND1);
+ value &= ~QSPI_PIO;
+ tegra_qspi_writel(tqspi, value, QSPI_COMMAND1);
+}
+
static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
struct spi_message *msg)
{
@@ -1110,7 +1139,7 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
struct spi_transfer *xfer;
struct spi_device *spi = msg->spi;
u8 transfer_phase = 0;
- u32 cmd1 = 0, dma_ctl = 0;
+ u32 cmd1 = 0;
int ret = 0;
u32 address_value = 0;
u32 cmd_config = 0, addr_config = 0;
@@ -1180,39 +1209,16 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
if (WARN_ON_ONCE(ret == 0)) {
dev_err_ratelimited(tqspi->dev,
"QSPI Transfer failed with timeout\n");
- if (tqspi->is_curr_dma_xfer) {
- if ((tqspi->cur_direction & DATA_DIR_TX) &&
- tqspi->tx_dma_chan)
- dmaengine_terminate_all(tqspi->tx_dma_chan);
- if ((tqspi->cur_direction & DATA_DIR_RX) &&
- tqspi->rx_dma_chan)
- dmaengine_terminate_all(tqspi->rx_dma_chan);
- }
/* Abort transfer by resetting pio/dma bit */
- if (!tqspi->is_curr_dma_xfer) {
- cmd1 = tegra_qspi_readl
- (tqspi,
- QSPI_COMMAND1);
- cmd1 &= ~QSPI_PIO;
- tegra_qspi_writel
- (tqspi, cmd1,
- QSPI_COMMAND1);
- } else {
- dma_ctl = tegra_qspi_readl
- (tqspi,
- QSPI_DMA_CTL);
- dma_ctl &= ~QSPI_DMA_EN;
- tegra_qspi_writel(tqspi, dma_ctl,
- QSPI_DMA_CTL);
- }
+ if (tqspi->is_curr_dma_xfer)
+ tegra_qspi_dma_stop(tqspi);
+ else
+ tegra_qspi_pio_stop(tqspi);
/* Reset controller if timeout happens */
- if (device_reset(tqspi->dev) < 0) {
- dev_warn_once(tqspi->dev,
- "device reset failed\n");
- tegra_qspi_mask_clear_irq(tqspi);
- }
+ tegra_qspi_reset(tqspi);
+
ret = -EIO;
goto exit;
}
@@ -1311,12 +1317,10 @@ static int tegra_qspi_non_combined_seq_xfer(struct tegra_qspi *tqspi,
QSPI_DMA_TIMEOUT);
if (WARN_ON(ret == 0)) {
dev_err(tqspi->dev, "transfer timeout\n");
- if (tqspi->is_curr_dma_xfer) {
- if ((tqspi->cur_direction & DATA_DIR_TX) && tqspi->tx_dma_chan)
- dmaengine_terminate_all(tqspi->tx_dma_chan);
- if ((tqspi->cur_direction & DATA_DIR_RX) && tqspi->rx_dma_chan)
- dmaengine_terminate_all(tqspi->rx_dma_chan);
- }
+
+ if (tqspi->is_curr_dma_xfer)
+ tegra_qspi_dma_stop(tqspi);
+
tegra_qspi_handle_error(tqspi);
ret = -EIO;
goto complete_xfer;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 074/703] spi: tegra210-quad: Check hardware status on timeout
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 073/703] spi: tegra210-quad: Refactor error handling into helper functions Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 075/703] spi: tegra210-quad: Unmap DMA buffers on transfer timeout Greg Kroah-Hartman
` (63 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vishwaroop A, Thierry Reding,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <va@nvidia.com>
[ Upstream commit 380fd29d57abe6679d87ec56babe65ddc5873a37 ]
Under high system load, QSPI interrupts can be delayed or blocked on the
target CPU, causing wait_for_completion_timeout() to report failure even
though the hardware successfully completed the transfer.
When a timeout occurs, check the QSPI_RDY bit in QSPI_TRANS_STATUS to
determine if the hardware actually completed the transfer. If so, manually
invoke the completion handler to process the transfer successfully instead
of failing it.
This distinguishes lost/delayed interrupts from real hardware timeouts,
preventing unnecessary failures of transfers that completed successfully.
Signed-off-by: Vishwaroop A <va@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20251028155703.4151791-4-va@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: d04ad85dd801 ("spi: tegra210-quad: Unmap DMA buffers on transfer timeout")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-tegra210-quad.c | 100 +++++++++++++++++++++++++-------
1 file changed, 80 insertions(+), 20 deletions(-)
diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index a7f8fef7d8256..8caf17a32e397 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1077,6 +1077,49 @@ static void tegra_qspi_transfer_end(struct spi_device *spi)
tegra_qspi_writel(tqspi, tqspi->def_command1_reg, QSPI_COMMAND1);
}
+static irqreturn_t handle_cpu_based_xfer(struct tegra_qspi *tqspi);
+static irqreturn_t handle_dma_based_xfer(struct tegra_qspi *tqspi);
+
+/**
+ * tegra_qspi_handle_timeout - Handle transfer timeout with hardware check
+ * @tqspi: QSPI controller instance
+ *
+ * When a timeout occurs but hardware has completed the transfer (interrupt
+ * was lost or delayed), manually trigger transfer completion processing.
+ * This avoids failing transfers that actually succeeded.
+ *
+ * Returns: 0 if transfer was completed, -ETIMEDOUT if real timeout
+ */
+static int tegra_qspi_handle_timeout(struct tegra_qspi *tqspi)
+{
+ irqreturn_t ret;
+ u32 status;
+
+ /* Check if hardware actually completed the transfer */
+ status = tegra_qspi_readl(tqspi, QSPI_TRANS_STATUS);
+ if (!(status & QSPI_RDY))
+ return -ETIMEDOUT;
+
+ /*
+ * Hardware completed but interrupt was lost/delayed. Manually
+ * process the completion by calling the appropriate handler.
+ */
+ dev_warn_ratelimited(tqspi->dev,
+ "QSPI interrupt timeout, but transfer complete\n");
+
+ /* Clear the transfer status */
+ status = tegra_qspi_readl(tqspi, QSPI_TRANS_STATUS);
+ tegra_qspi_writel(tqspi, status, QSPI_TRANS_STATUS);
+
+ /* Manually trigger completion handler */
+ if (!tqspi->is_curr_dma_xfer)
+ ret = handle_cpu_based_xfer(tqspi);
+ else
+ ret = handle_dma_based_xfer(tqspi);
+
+ return (ret == IRQ_HANDLED) ? 0 : -EIO;
+}
+
static u32 tegra_qspi_cmd_config(bool is_ddr, u8 bus_width, u8 len)
{
u32 cmd_config = 0;
@@ -1207,20 +1250,28 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
QSPI_DMA_TIMEOUT);
if (WARN_ON_ONCE(ret == 0)) {
- dev_err_ratelimited(tqspi->dev,
- "QSPI Transfer failed with timeout\n");
-
- /* Abort transfer by resetting pio/dma bit */
- if (tqspi->is_curr_dma_xfer)
- tegra_qspi_dma_stop(tqspi);
- else
- tegra_qspi_pio_stop(tqspi);
-
- /* Reset controller if timeout happens */
- tegra_qspi_reset(tqspi);
-
- ret = -EIO;
- goto exit;
+ /*
+ * Check if hardware completed the transfer
+ * even though interrupt was lost or delayed.
+ * If so, process the completion and continue.
+ */
+ ret = tegra_qspi_handle_timeout(tqspi);
+ if (ret < 0) {
+ /* Real timeout - clean up and fail */
+ dev_err(tqspi->dev, "transfer timeout\n");
+
+ /* Abort transfer by resetting pio/dma bit */
+ if (tqspi->is_curr_dma_xfer)
+ tegra_qspi_dma_stop(tqspi);
+ else
+ tegra_qspi_pio_stop(tqspi);
+
+ /* Reset controller if timeout happens */
+ tegra_qspi_reset(tqspi);
+
+ ret = -EIO;
+ goto exit;
+ }
}
if (tqspi->tx_status || tqspi->rx_status) {
@@ -1316,14 +1367,23 @@ static int tegra_qspi_non_combined_seq_xfer(struct tegra_qspi *tqspi,
ret = wait_for_completion_timeout(&tqspi->xfer_completion,
QSPI_DMA_TIMEOUT);
if (WARN_ON(ret == 0)) {
- dev_err(tqspi->dev, "transfer timeout\n");
+ /*
+ * Check if hardware completed the transfer even though
+ * interrupt was lost or delayed. If so, process the
+ * completion and continue.
+ */
+ ret = tegra_qspi_handle_timeout(tqspi);
+ if (ret < 0) {
+ /* Real timeout - clean up and fail */
+ dev_err(tqspi->dev, "transfer timeout\n");
- if (tqspi->is_curr_dma_xfer)
- tegra_qspi_dma_stop(tqspi);
+ if (tqspi->is_curr_dma_xfer)
+ tegra_qspi_dma_stop(tqspi);
- tegra_qspi_handle_error(tqspi);
- ret = -EIO;
- goto complete_xfer;
+ tegra_qspi_handle_error(tqspi);
+ ret = -EIO;
+ goto complete_xfer;
+ }
}
if (tqspi->tx_status || tqspi->rx_status) {
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 075/703] spi: tegra210-quad: Unmap DMA buffers on transfer timeout
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 074/703] spi: tegra210-quad: Check hardware status on timeout Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 076/703] sched_ext: Fix ops.enqueue/dispatch() calls before ops.cpu_online() Greg Kroah-Hartman
` (62 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Vishwaroop A, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishwaroop A <va@nvidia.com>
[ Upstream commit d04ad85dd8015713b0b2531b5b934fe67828d741 ]
tegra_qspi_start_dma_based_transfer() maps the client TX/RX buffers with
dma_map_single() via tegra_qspi_dma_map_xfer(). The matching unmap only
happens in handle_dma_based_xfer(), which runs from the interrupt bottom
half.
When wait_for_completion_timeout() expires and tegra_qspi_handle_timeout()
cannot establish that the hardware finished, it returns an error without
the bottom half ever having run. Both transfer paths then abort the
transfer with tegra_qspi_dma_stop(), reset the controller and clear
curr_xfer, but never unmap the buffers. Every genuine transfer timeout
therefore leaks the streaming DMA mappings for that chunk, which
gradually exhausts the IOVA space on systems with an IOMMU in front of
QSPI.
Unmap the transfer after stopping DMA on both timeout error paths. The
unmap is placed after tegra_qspi_dma_stop() so the DMA engine is
quiesced before the mappings go away.
The recovery paths that do reach handle_dma_based_xfer() unmap there
themselves. The preceding patch makes tegra_qspi_dma_unmap_xfer() a no-op
once the mapping is released, so this cleanup cannot unmap twice or run
against a chunk that was never mapped.
Fixes: 921fc1838fb0 ("spi: tegra210-quad: Add support for Tegra210 QSPI controller")
Cc: stable@vger.kernel.org # with "spi: tegra210-quad: Track DMA mapping state"
Signed-off-by: Vishwaroop A <va@nvidia.com>
Link: https://patch.msgid.link/20261026111412.3843954-4-va@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-tegra210-quad.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 8caf17a32e397..1b28dcce8372e 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -1261,10 +1261,12 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
dev_err(tqspi->dev, "transfer timeout\n");
/* Abort transfer by resetting pio/dma bit */
- if (tqspi->is_curr_dma_xfer)
+ if (tqspi->is_curr_dma_xfer) {
tegra_qspi_dma_stop(tqspi);
- else
+ tegra_qspi_dma_unmap_xfer(tqspi, xfer);
+ } else {
tegra_qspi_pio_stop(tqspi);
+ }
/* Reset controller if timeout happens */
tegra_qspi_reset(tqspi);
@@ -1377,8 +1379,10 @@ static int tegra_qspi_non_combined_seq_xfer(struct tegra_qspi *tqspi,
/* Real timeout - clean up and fail */
dev_err(tqspi->dev, "transfer timeout\n");
- if (tqspi->is_curr_dma_xfer)
+ if (tqspi->is_curr_dma_xfer) {
tegra_qspi_dma_stop(tqspi);
+ tegra_qspi_dma_unmap_xfer(tqspi, xfer);
+ }
tegra_qspi_handle_error(tqspi);
ret = -EIO;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 076/703] sched_ext: Fix ops.enqueue/dispatch() calls before ops.cpu_online()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 075/703] spi: tegra210-quad: Unmap DMA buffers on transfer timeout Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 077/703] Bluetooth: l2cap: defer conn param update to avoid conn->lock/hdev->lock inversion Greg Kroah-Hartman
` (61 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo, Andrea Righi, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
[ Upstream commit 2227a34ff7bfcf6112931039e3554f4b70b65ab9 ]
ops.cpu_online() documents that the cpu doesn't call ops.enqueue() or
ops.dispatch() before that op. Both are gated on SCX_RQ_ONLINE, which
follows the core's rq online state through the ext class's rq_online and
rq_offline hooks. On a runtime cpu up, sched_cpu_activate() runs:
1. set_cpu_active() marks the cpu active.
2. cpuset_cpu_active() rebuilds the sched domains synchronously, and
rq_attach_root() puts the rq online as the cpu is active now. The
rq_online hook sets SCX_RQ_ONLINE.
3. scx_rq_activate() calls the root's ops.cpu_online().
Between 2 and 3, ops.enqueue() can be called for tasks woken or migrated
onto the cpu, and ops.dispatch() can run on it.
The hooks can't call the ops. They run under the rq lock with IRQs off while
the ops can be sleepable BPF programs, and handle_hotplug() needs the
rebuilt sched domains for its idle topology update.
Track SCX_RQ_ONLINE in handle_hotplug() alone. Set it right after the root's
ops.cpu_online(). Clear it and move the cpu's tasks to its local DSQ when
the cpu goes down. Sched domain rebuilds, which take a live cpu's rq offline
and online again, no longer touch the flag, so a remote dispatch can't see
it cleared by a rebuild and bounce to the global DSQ.
Between 2 and 3, tasks that land on the cpu now go to its local DSQ without
ops.enqueue(), and with sub-schedulers a task whose scheduler lacks caps on
the cpu is admitted anyway and counted in SCX_EV_SUB_FORCED_ADMIT. Both
already happen between 1 and 2.
Fixes: 60c27fb59f6c ("sched_ext: Implement sched_ext_ops.cpu_online/offline()")
Cc: stable@vger.kernel.org # v6.12+
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
[ sashal: Inlined the drain loop into handle_hotplug() since drain_offline_rq() doesn't exist here, and dropped the sub-scheduler, ecaps and rescue-flush parts and the path split into ext/ files. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/ext.c | 84 ++++++++++++++++++++++++--------------------
kernel/sched/sched.h | 9 ++---
2 files changed, 50 insertions(+), 43 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 64a68d698b823..855a49c14142f 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -1244,11 +1244,11 @@ static void direct_dispatch(struct scx_sched *sch, struct task_struct *p,
static bool scx_rq_online(struct rq *rq)
{
/*
- * Test both cpu_active() and %SCX_RQ_ONLINE. %SCX_RQ_ONLINE indicates
- * the online state as seen from the BPF scheduler. cpu_active() test
- * guarantees that, if this function returns %true, %SCX_RQ_ONLINE will
- * stay set until the current scheduling operation is complete even if
- * we aren't locking @rq.
+ * Test both cpu_active() and %SCX_RQ_ONLINE. %SCX_RQ_ONLINE is set
+ * after the root's ops.cpu_online() and cleared when the cpu goes down.
+ * cpu_active() test guarantees that, if this function returns %true,
+ * %SCX_RQ_ONLINE will stay set until the current scheduling operation
+ * is complete even if we aren't locking @rq.
*/
return likely((rq->scx.flags & SCX_RQ_ONLINE) && cpu_active(cpu_of(rq)));
}
@@ -1369,7 +1369,7 @@ static void set_task_runnable(struct rq *rq, struct task_struct *p)
}
/*
- * list_add_tail() must be used. scx_bypass() and rq_offline_scx()
+ * list_add_tail() must be used. scx_bypass() and handle_hotplug()
* depend on tasks being appended to the runnable_list.
*/
list_add_tail(&p->scx.runnable_node, &rq->scx.runnable_list);
@@ -2154,7 +2154,7 @@ static int balance_one(struct rq *rq, struct task_struct *prev)
/*
* scx_rq_online() can't be used. Its cpu_active() test goes false
* before CPU hotplug waits for an RCU grace period, and
- * rq_offline_scx() moves this CPU's tasks to the local DSQ only after
+ * handle_hotplug() moves this CPU's tasks to the local DSQ only after
* the wait. The grace period can depend on those tasks running.
*/
if (unlikely(!SCX_HAS_OP(sch, dispatch)) ||
@@ -2655,6 +2655,25 @@ static void handle_hotplug(struct rq *rq, bool online)
struct scx_sched *sch = scx_root;
int cpu = cpu_of(rq);
+ if (!online) {
+ struct task_struct *p, *n;
+
+ guard(rq_lock_irqsave)(rq);
+ update_rq_clock(rq);
+ rq->scx.flags &= ~SCX_RQ_ONLINE;
+
+ /*
+ * An offline CPU no longer calls ops.dispatch(). Re-enqueue its
+ * tasks onto the local DSQ so that they run here and
+ * balance_push() moves them off.
+ */
+ list_for_each_entry_safe_reverse(p, n, &rq->scx.runnable_list, scx.runnable_node) {
+ if (p->scx.dsq == &rq->scx.local_dsq)
+ continue;
+ guard(sched_change)(p, DEQUEUE_SAVE | DEQUEUE_MOVE | DEQUEUE_NOCLOCK);
+ }
+ }
+
atomic_long_inc(&scx_hotplug_seq);
/*
@@ -2662,8 +2681,14 @@ static void handle_hotplug(struct rq *rq, bool online)
* stable here. Note that we can't depend on scx_enabled() test as the
* hotplug ops need to be enabled before __scx_enabled is set.
*/
- if (unlikely(!sch))
+ if (unlikely(!sch)) {
+ /* no root to notify, set %SCX_RQ_ONLINE right away */
+ if (online) {
+ guard(rq_lock_irqsave)(rq);
+ rq->scx.flags |= SCX_RQ_ONLINE;
+ }
return;
+ }
if (scx_enabled())
scx_idle_update_selcpu_topology(&sch->ops);
@@ -2677,6 +2702,18 @@ static void handle_hotplug(struct rq *rq, bool online)
SCX_ECODE_ACT_RESTART | SCX_ECODE_RSN_HOTPLUG,
"cpu %d going %s, exiting scheduler", cpu,
online ? "online" : "offline");
+
+ if (online) {
+ /*
+ * The cpu must not call ops.enqueue() or ops.dispatch() before
+ * the root's ops.cpu_online(). The core's rq online state can't
+ * gate them, as the sched domain rebuild in
+ * sched_cpu_activate() can put @rq online before this function
+ * runs. Set %SCX_RQ_ONLINE here.
+ */
+ guard(rq_lock_irqsave)(rq);
+ rq->scx.flags |= SCX_RQ_ONLINE;
+ }
}
void scx_rq_activate(struct rq *rq)
@@ -2689,34 +2726,6 @@ void scx_rq_deactivate(struct rq *rq)
handle_hotplug(rq, false);
}
-static void rq_online_scx(struct rq *rq)
-{
- rq->scx.flags |= SCX_RQ_ONLINE;
-}
-
-static void rq_offline_scx(struct rq *rq)
-{
- struct task_struct *p, *n;
-
- rq->scx.flags &= ~SCX_RQ_ONLINE;
-
- /* sched domain rebuilds call rq_offline with the CPU staying alive */
- if (cpu_active(cpu_of(rq)))
- return;
-
- /*
- * An offline CPU no longer calls ops.dispatch(). Re-enqueue its tasks
- * onto the local DSQ so that they run here and balance_push() moves
- * them off.
- */
- list_for_each_entry_safe_reverse(p, n, &rq->scx.runnable_list, scx.runnable_node) {
- if (p->scx.dsq == &rq->scx.local_dsq)
- continue;
- guard(sched_change)(p, DEQUEUE_SAVE | DEQUEUE_MOVE | DEQUEUE_NOCLOCK);
- }
-}
-
-
static bool check_rq_for_timeouts(struct rq *rq)
{
struct scx_sched *sch;
@@ -3438,9 +3447,6 @@ DEFINE_SCHED_CLASS(ext) = {
.task_woken = task_woken_scx,
.set_cpus_allowed = set_cpus_allowed_scx,
- .rq_online = rq_online_scx,
- .rq_offline = rq_offline_scx,
-
.task_tick = task_tick_scx,
.switching_to = switching_to_scx,
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index ea470cc608d51..834ef37212b8c 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -773,9 +773,10 @@ struct cfs_rq {
/* scx_rq->flags, protected by the rq lock */
enum scx_rq_flags {
/*
- * A hotplugged CPU starts scheduling before rq_online_scx(). Track
- * ops.cpu_on/offline() state so that ops.enqueue/dispatch() are called
- * only while the BPF scheduler considers the CPU to be online.
+ * Set right after the root's ops.cpu_online() when a CPU comes up and
+ * cleared when the CPU goes down, see handle_hotplug(). A hotplugged
+ * CPU starts scheduling before %SCX_RQ_ONLINE is set. ops.enqueue() and
+ * ops.dispatch() are called for the CPU only while the flag is set.
*/
SCX_RQ_ONLINE = 1 << 0,
SCX_RQ_CAN_STOP_TICK = 1 << 1,
@@ -3944,7 +3945,7 @@ extern void balance_callbacks(struct rq *rq, struct balance_callback *head);
* Typically this must be called while holding task_rq_lock, since most/all
* properties are serialized under those locks. There are currently two
* exceptions to this rule in sched/ext which only hold rq->lock: scx_bypass()
- * and rq_offline_scx().
+ * and handle_hotplug().
*/
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 077/703] Bluetooth: l2cap: defer conn param update to avoid conn->lock/hdev->lock inversion
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 076/703] sched_ext: Fix ops.enqueue/dispatch() calls before ops.cpu_online() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 078/703] Revert "mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback" Greg Kroah-Hartman
` (60 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mikhail Gavrilov, Paul Menzel,
Luiz Augusto von Dentz, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
[ Upstream commit 91b5a598b5285da794b72619f31777b62dd336f8 ]
When a BLE peripheral sends an L2CAP Connection Parameter Update Request
the processing path is:
process_pending_rx() [takes conn->lock]
l2cap_le_sig_channel()
l2cap_conn_param_update_req()
hci_le_conn_update() [takes hdev->lock]
Meanwhile other code paths take the locks in the opposite order:
l2cap_chan_connect() [takes hdev->lock]
...
mutex_lock(&conn->lock)
l2cap_conn_ready() [hdev->lock via hci_cb_list_lock]
...
mutex_lock(&conn->lock)
This is a classic AB/BA deadlock which lockdep reports as a circular
locking dependency when connecting a BLE MIDI keyboard (Carry-On FC-49).
Fix this by making hci_le_conn_update() defer the HCI command through
hci_cmd_sync_queue() so it no longer needs to take hdev->lock in the
caller context. The sync callback uses __hci_cmd_sync_status_sk() to
wait for the HCI_EV_LE_CONN_UPDATE_COMPLETE event, then updates the
stored connection parameters (hci_conn_params) and notifies userspace
(mgmt_new_conn_param) only after the controller has confirmed the update.
A reference on hci_conn is held via hci_conn_get()/hci_conn_put() for
the lifetime of the queued work to prevent use-after-free, and
hci_conn_valid() is checked before proceeding in case the connection was
removed while the work was pending. The hci_dev_lock is held across
hci_conn_valid() and all conn field accesses to prevent a concurrent
disconnect from invalidating the connection mid-use.
Fixes: f044eb0524a0 ("Bluetooth: Store latency and supervision timeout in connection params")
Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/bluetooth/hci_core.h | 2 +-
net/bluetooth/hci_conn.c | 105 +++++++++++++++++++++++++------
net/bluetooth/l2cap_core.c | 12 +---
3 files changed, 89 insertions(+), 30 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index d244fd50345ec..7642508c7ac24 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2480,7 +2480,7 @@ void mgmt_adv_monitor_device_lost(struct hci_dev *hdev, u16 handle,
bdaddr_t *bdaddr, u8 addr_type);
int hci_abort_conn(struct hci_conn *conn, u8 reason);
-u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
+void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
u16 to_multiplier);
void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,
__u8 ltk[16], __u8 key_size);
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 29e13da009505..706699071368a 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -504,40 +504,107 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle)
return hci_setup_sync_conn(conn, handle);
}
-u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
- u16 to_multiplier)
+struct le_conn_update_data {
+ struct hci_conn *conn;
+ u16 min;
+ u16 max;
+ u16 latency;
+ u16 to_multiplier;
+};
+
+static int le_conn_update_sync(struct hci_dev *hdev, void *data)
{
- struct hci_dev *hdev = conn->hdev;
+ struct le_conn_update_data *d = data;
+ struct hci_conn *conn = d->conn;
struct hci_conn_params *params;
struct hci_cp_le_conn_update cp;
+ u16 timeout;
+ u8 store_hint;
+ int err;
+ /* Verify connection is still alive and read conn fields under
+ * the same lock to prevent a concurrent disconnect from freeing
+ * or reusing the connection while we build the HCI command.
+ */
hci_dev_lock(hdev);
- params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
- if (params) {
- params->conn_min_interval = min;
- params->conn_max_interval = max;
- params->conn_latency = latency;
- params->supervision_timeout = to_multiplier;
+ if (!hci_conn_valid(hdev, conn)) {
+ hci_dev_unlock(hdev);
+ return -ECANCELED;
}
- hci_dev_unlock(hdev);
-
memset(&cp, 0, sizeof(cp));
cp.handle = cpu_to_le16(conn->handle);
- cp.conn_interval_min = cpu_to_le16(min);
- cp.conn_interval_max = cpu_to_le16(max);
- cp.conn_latency = cpu_to_le16(latency);
- cp.supervision_timeout = cpu_to_le16(to_multiplier);
+ cp.conn_interval_min = cpu_to_le16(d->min);
+ cp.conn_interval_max = cpu_to_le16(d->max);
+ cp.conn_latency = cpu_to_le16(d->latency);
+ cp.supervision_timeout = cpu_to_le16(d->to_multiplier);
cp.min_ce_len = cpu_to_le16(0x0000);
cp.max_ce_len = cpu_to_le16(0x0000);
+ timeout = conn->conn_timeout;
+
+ hci_dev_unlock(hdev);
+
+ err = __hci_cmd_sync_status_sk(hdev, HCI_OP_LE_CONN_UPDATE,
+ sizeof(cp), &cp,
+ HCI_EV_LE_CONN_UPDATE_COMPLETE,
+ timeout, NULL);
+ if (err)
+ return err;
+
+ /* Update stored connection parameters after the controller has
+ * confirmed the update via the LE Connection Update Complete event.
+ */
+ hci_dev_lock(hdev);
+
+ params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
+ if (params) {
+ params->conn_min_interval = d->min;
+ params->conn_max_interval = d->max;
+ params->conn_latency = d->latency;
+ params->supervision_timeout = d->to_multiplier;
+ store_hint = 0x01;
+ } else {
+ store_hint = 0x00;
+ }
- hci_send_cmd(hdev, HCI_OP_LE_CONN_UPDATE, sizeof(cp), &cp);
+ hci_dev_unlock(hdev);
- if (params)
- return 0x01;
+ mgmt_new_conn_param(hdev, &conn->dst, conn->dst_type, store_hint,
+ d->min, d->max, d->latency, d->to_multiplier);
- return 0x00;
+ return 0;
+}
+
+static void le_conn_update_complete(struct hci_dev *hdev, void *data, int err)
+{
+ struct le_conn_update_data *d = data;
+
+ hci_conn_put(d->conn);
+ kfree(d);
+}
+
+void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
+ u16 to_multiplier)
+{
+ struct le_conn_update_data *d;
+
+ d = kzalloc_obj(*d);
+ if (!d)
+ return;
+
+ hci_conn_get(conn);
+ d->conn = conn;
+ d->min = min;
+ d->max = max;
+ d->latency = latency;
+ d->to_multiplier = to_multiplier;
+
+ if (hci_cmd_sync_queue(conn->hdev, le_conn_update_sync, d,
+ le_conn_update_complete) < 0) {
+ hci_conn_put(conn);
+ kfree(d);
+ }
}
void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index d03a20b87287b..801367941642d 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4867,16 +4867,8 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn,
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONN_PARAM_UPDATE_RSP,
sizeof(rsp), &rsp);
- if (!err) {
- u8 store_hint;
-
- store_hint = hci_le_conn_update(hcon, min, max, latency,
- to_multiplier);
- mgmt_new_conn_param(hcon->hdev, &hcon->dst, hcon->dst_type,
- store_hint, min, max, latency,
- to_multiplier);
-
- }
+ if (!err)
+ hci_le_conn_update(hcon, min, max, latency, to_multiplier);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 078/703] Revert "mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback"
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 077/703] Bluetooth: l2cap: defer conn param update to avoid conn->lock/hdev->lock inversion Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 079/703] dm cache: validate the discard block size before narrowing Greg Kroah-Hartman
` (59 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit d73f79d1a2c26a8cdf0558d9a0203ee64d9b4f51.
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/hugetlb_vmemmap.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
index efe4bcc85da2c..a39f9793df69a 100644
--- a/mm/hugetlb_vmemmap.c
+++ b/mm/hugetlb_vmemmap.c
@@ -207,8 +207,6 @@ static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,
/* Remapping the head page requires r/w */
if (unlikely(walk->nr_walked == 0 && walk->vmemmap_head)) {
- VM_WARN_ON_ONCE(!PageHead((const struct page *)addr));
-
list_del(&walk->vmemmap_head->lru);
/*
@@ -220,8 +218,6 @@ static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,
entry = mk_pte(walk->vmemmap_head, PAGE_KERNEL);
} else {
- VM_WARN_ON_ONCE(!PageTail((const struct page *)addr));
-
/*
* Remap the tail pages as read-only to catch illegal write
* operation to the tail pages.
@@ -236,28 +232,33 @@ static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,
static void vmemmap_restore_pte(pte_t *pte, unsigned long addr,
struct vmemmap_remap_walk *walk)
{
- struct page *src = pte_page(ptep_get(pte)), *dst;
+ struct page *page;
+ struct page *from, *to;
+
+ page = list_first_entry(walk->vmemmap_pages, struct page, lru);
+ list_del(&page->lru);
/*
- * When rolling back vmemmap_remap_free(), keep the copied head page
- * mapping and restore only PTEs currently pointing at the shared tail
- * page.
+ * Initialize tail pages in the newly allocated vmemmap page.
+ *
+ * There is folio-scope metadata that is encoded in the first few
+ * tail pages.
+ *
+ * Use the value last tail page in the page with the head page
+ * to initialize the rest of tail pages.
*/
- if (walk->vmemmap_tail && walk->vmemmap_tail != src)
- return;
-
- VM_WARN_ON_ONCE(PageHead((const struct page *)addr));
-
- dst = list_first_entry(walk->vmemmap_pages, struct page, lru);
- list_del(&dst->lru);
- copy_page(page_to_virt(dst), page_to_virt(src));
+ from = compound_head((struct page *)addr) +
+ PAGE_SIZE / sizeof(struct page) - 1;
+ to = page_to_virt(page);
+ for (int i = 0; i < PAGE_SIZE / sizeof(struct page); i++, to++)
+ *to = *from;
/*
* Makes sure that preceding stores to the page contents become visible
* before the set_pte_at() write.
*/
smp_wmb();
- set_pte_at(&init_mm, addr, pte, mk_pte(dst, PAGE_KERNEL));
+ set_pte_at(&init_mm, addr, pte, mk_pte(page, PAGE_KERNEL));
}
/**
@@ -323,7 +324,6 @@ static int vmemmap_remap_free(unsigned long start, unsigned long end,
*/
walk = (struct vmemmap_remap_walk) {
.remap_pte = vmemmap_restore_pte,
- .vmemmap_tail = vmemmap_tail,
.vmemmap_pages = vmemmap_pages,
.flags = 0,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 079/703] dm cache: validate the discard block size before narrowing
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 078/703] Revert "mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback" Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 080/703] dm: fix use-after-free when dm_get_device() widens the open mode Greg Kroah-Hartman
` (58 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+c8564fc0a96e3ecbe4d4,
Kirtikumar Anandrao Ramchandani, Mikulas Patocka, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
[ Upstream commit df8daa4d916c88ef7888c738e0eb3b6f11714a6f ]
The discard block size doubles until the origin fits within the discard
bitset limit. too_many_discard_blocks() passes this sector_t size to
sector_div(), whose divisor is only 32 bits. Once the size exceeds that
range, the division uses a truncated divisor, which can become zero.
Use a 64-bit divisor when checking the block count. The selected size is
stored in a u32, so reject sizes that cannot be represented before the
assignment and before calculating the bitset size. This prevents a
truncated zero size from reaching dm_sector_div_up().
An earlier proposal checks whether the mapped length exceeds the origin
device. This fix also covers an origin device whose valid size requires a
discard block size beyond the field's range.
Reported-by: syzbot+c8564fc0a96e3ecbe4d4@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c8564fc0a96e3ecbe4d4
Cc: stable@vger.kernel.org
Fixes: 08b184514f65 ("dm cache: revert 'prevent corruption caused by discard_block_size > cache_block_size'")
Signed-off-by: Kirtikumar Anandrao Ramchandani <kirtiar15502@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
[ sashal: Adjusted the include context: added only #include <linux/math64.h> between init.h and mempool.h, since kstrtox.h isn't present in this tree. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-cache-target.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index 663b1c0fa41d1..a7cb5bdbd5da1 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -16,6 +16,7 @@
#include <linux/dm-kcopyd.h>
#include <linux/jiffies.h>
#include <linux/init.h>
+#include <linux/math64.h>
#include <linux/mempool.h>
#include <linux/module.h>
#include <linux/rwsem.h>
@@ -2389,9 +2390,7 @@ static int create_cache_policy(struct cache *cache, struct cache_args *ca,
static bool too_many_discard_blocks(sector_t discard_block_size,
sector_t origin_size)
{
- (void) sector_div(origin_size, discard_block_size);
-
- return origin_size > MAX_DISCARD_BLOCKS;
+ return div64_u64(origin_size, discard_block_size) > MAX_DISCARD_BLOCKS;
}
static sector_t calculate_discard_block_size(sector_t cache_block_size,
@@ -2428,6 +2427,7 @@ static int cache_create(struct cache_args *ca, struct cache **result)
struct cache *cache;
struct dm_target *ti = ca->ti;
dm_block_t origin_blocks;
+ sector_t discard_block_size;
struct dm_cache_metadata *cmd;
bool may_format = ca->features.mode == CM_WRITE;
@@ -2527,9 +2527,15 @@ static int cache_create(struct cache_args *ca, struct cache **result)
}
clear_bitset(cache->dirty_bitset, from_cblock(cache->cache_size));
- cache->discard_block_size =
+ discard_block_size =
calculate_discard_block_size(cache->sectors_per_block,
cache->origin_sectors);
+ if (discard_block_size > U32_MAX) {
+ *error = "Discard block size exceeds 32 bits";
+ r = -EOVERFLOW;
+ goto bad;
+ }
+ cache->discard_block_size = discard_block_size;
cache->discard_nr_blocks = to_dblock(dm_sector_div_up(cache->origin_sectors,
cache->discard_block_size));
cache->discard_bitset = alloc_bitset(from_dblock(cache->discard_nr_blocks));
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 080/703] dm: fix use-after-free when dm_get_device() widens the open mode
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 079/703] dm cache: validate the discard block size before narrowing Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 081/703] iio: adc: ad7923: add the AD7927 to the SPI ID table Greg Kroah-Hartman
` (57 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ming Hung Tsai, Mikulas Patocka,
Sasha Levin, Claude Opus 5
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming-Hung Tsai <mtsai@redhat.com>
[ Upstream commit c834161ded1a141a58d5f03b24f6894291222c96 ]
There's an UAF bug in dm_get_device(): when a table construction calls
dm_get_device() on the same device twice with widen access mode (e.g.,
read-only first then read-write), the second dm_get_device() calls
upgrade_mode(), which reopens the device in upgraded mode, making
previously returned dm_dev* a stale pointer.
Fixing approaches:
- Add per-mode views (dm_dev_ref) from a per-device dm_dev_internal to
multiple table_devices.
- Keep reusing the dm_dev_ref when the requested mode is included, i.e.,
a read-only reference can reuse the read-write opened device within a
table.
- Maintain a canonical block_device pointer in dm_dev_internal for
handling the DM_TABLE_DEPS ioctl.
Also tweak the way of mode sharing check in find_ref() to
"(x & mask) == mask". The result stays the same to the previous
upgrade_mode() guard "(x | mask) == x".
Pros: keep the relationship between dm_dev_internal and table_device:
one dm_dev_internal per device, regardless the mode, so the output of
DMM_TABLE_DEPS ioctl unchanged.
Cons: extra dm_dev_ref allocation.
Note that now the table_device's count not necessarily mean the number
tables referecing this <dev, mode> pair, since we're allowing multiple
references within a table.
Signed-off-by: Ming Hung Tsai <mtsai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fixes: 86f1152b117a ("dm: allow active and inactive tables to share dm_devs")
Cc: stable@vger.kernel.org
[ sashal: Adapted upstream's plain returns in dm_get_device() and dm_put_device() to this tree's devices_lock rwsem handling, using goto unlock_ret_r and goto unlock_ret. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-ioctl.c | 2 +-
drivers/md/dm-table.c | 142 +++++++++++++++++++++++-------------------
drivers/md/dm.c | 2 +-
drivers/md/dm.h | 18 +++++-
4 files changed, 97 insertions(+), 67 deletions(-)
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 4495489c488d5..ade31c4a0ead3 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1685,7 +1685,7 @@ static void retrieve_deps(struct dm_table *table,
deps->count = count;
count = 0;
list_for_each_entry(dd, dm_table_get_devices(table), list)
- deps->dev[count++] = huge_encode_dev(dd->dm_dev->bdev->bd_dev);
+ deps->dev[count++] = huge_encode_dev(dd->bdev->bd_dev);
param->data_size = param->data_start + needed;
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 81265ed204b54..4f3973e76ed47 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -166,14 +166,16 @@ int dm_table_create(struct dm_table **result, blk_mode_t mode,
static void free_devices(struct list_head *devices, struct mapped_device *md)
{
- struct list_head *tmp, *next;
-
- list_for_each_safe(tmp, next, devices) {
- struct dm_dev_internal *dd =
- list_entry(tmp, struct dm_dev_internal, list);
- DMWARN("%s: dm_table_destroy: dm_put_device call missing for %s",
- dm_device_name(md), dd->dm_dev->name);
- dm_put_table_device(md, dd->dm_dev);
+ struct dm_dev_internal *dd, *dd_next;
+ struct dm_dev_ref *ref, *ref_next;
+
+ list_for_each_entry_safe(dd, dd_next, devices, list) {
+ list_for_each_entry_safe(ref, ref_next, &dd->refs, list) {
+ DMWARN("%s: dm_table_destroy: dm_put_device call missing for %s",
+ dm_device_name(md), ref->dm_dev->name);
+ dm_put_table_device(md, ref->dm_dev);
+ kfree(ref);
+ }
kfree(dd);
}
}
@@ -219,12 +221,27 @@ static struct dm_dev_internal *find_device(struct list_head *l, dev_t dev)
struct dm_dev_internal *dd;
list_for_each_entry(dd, l, list)
- if (dd->dm_dev->bdev->bd_dev == dev)
+ if (dd->bdev->bd_dev == dev)
return dd;
return NULL;
}
+/*
+ * See if the device is already open with a mode that covers the
+ * requested one.
+ */
+static struct dm_dev_ref *find_ref(struct dm_dev_internal *dd, blk_mode_t mode)
+{
+ struct dm_dev_ref *ref;
+
+ list_for_each_entry(ref, &dd->refs, list)
+ if ((ref->dm_dev->mode & mode) == mode)
+ return ref;
+
+ return NULL;
+}
+
/*
* If possible, this checks an area of a destination device is invalid.
*/
@@ -304,31 +321,6 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
return 0;
}
-/*
- * This upgrades the mode on an already open dm_dev, being
- * careful to leave things as they were if we fail to reopen the
- * device and not to touch the existing bdev field in case
- * it is accessed concurrently.
- */
-static int upgrade_mode(struct dm_dev_internal *dd, blk_mode_t new_mode,
- struct mapped_device *md)
-{
- int r;
- struct dm_dev *old_dev, *new_dev;
-
- old_dev = dd->dm_dev;
-
- r = dm_get_table_device(md, dd->dm_dev->bdev->bd_dev,
- dd->dm_dev->mode | new_mode, &new_dev);
- if (r)
- return r;
-
- dd->dm_dev = new_dev;
- dm_put_table_device(md, old_dev);
-
- return 0;
-}
-
/*
* Note: the __ref annotation is because this function can call the __init
* marked early_lookup_bdev when called during early boot code from dm-init.c.
@@ -361,7 +353,9 @@ EXPORT_SYMBOL(dm_devt_from_path);
/*
* Add a device to the list, or just increment the usage count if
- * it's already present.
+ * it's already present with a mode that covers the requested one.
+ * Otherwise open the device again with the requested mode, so the
+ * dm_devs returned earlier stay valid.
*/
int dm_get_device(struct dm_target *ti, const char *path, blk_mode_t mode,
struct dm_dev **result)
@@ -369,6 +363,7 @@ int dm_get_device(struct dm_target *ti, const char *path, blk_mode_t mode,
int r;
dev_t dev;
struct dm_dev_internal *dd;
+ struct dm_dev_ref *ref;
struct dm_table *t = ti->table;
BUG_ON(!t);
@@ -383,34 +378,48 @@ int dm_get_device(struct dm_target *ti, const char *path, blk_mode_t mode,
down_write(&t->devices_lock);
dd = find_device(&t->devices, dev);
- if (!dd) {
- dd = kmalloc(sizeof(*dd), GFP_KERNEL);
+ if (dd) {
+ ref = find_ref(dd, mode);
+ if (ref) {
+ refcount_inc(&ref->count);
+ goto out;
+ }
+ } else {
+ dd = kmalloc_obj(*dd);
if (!dd) {
r = -ENOMEM;
goto unlock_ret_r;
}
+ INIT_LIST_HEAD(&dd->refs);
+ }
- r = dm_get_table_device(t->md, dev, mode, &dd->dm_dev);
- if (r) {
- kfree(dd);
- goto unlock_ret_r;
- }
+ ref = kmalloc_obj(*ref);
+ if (!ref) {
+ r = -ENOMEM;
+ goto bad;
+ }
- refcount_set(&dd->count, 1);
- list_add(&dd->list, &t->devices);
- goto out;
+ r = dm_get_table_device(t->md, dev, mode, &ref->dm_dev);
+ if (r) {
+ kfree(ref);
+ goto bad;
+ }
+ refcount_set(&ref->count, 1);
- } else if (dd->dm_dev->mode != (mode | dd->dm_dev->mode)) {
- r = upgrade_mode(dd, mode, t->md);
- if (r)
- goto unlock_ret_r;
+ /* A device in the list always has at least one ref */
+ if (list_empty(&dd->refs)) {
+ dd->bdev = ref->dm_dev->bdev;
+ list_add(&dd->list, &t->devices);
}
- refcount_inc(&dd->count);
+ list_add_tail(&ref->list, &dd->refs);
out:
up_write(&t->devices_lock);
- *result = dd->dm_dev;
+ *result = ref->dm_dev;
return 0;
+bad:
+ if (list_empty(&dd->refs))
+ kfree(dd);
unlock_ret_r:
up_write(&t->devices_lock);
return r;
@@ -463,26 +472,31 @@ static int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev,
*/
void dm_put_device(struct dm_target *ti, struct dm_dev *d)
{
- int found = 0;
struct dm_table *t = ti->table;
struct list_head *devices = &t->devices;
struct dm_dev_internal *dd;
+ struct dm_dev_ref *ref;
down_write(&t->devices_lock);
- list_for_each_entry(dd, devices, list) {
- if (dd->dm_dev == d) {
- found = 1;
- break;
- }
- }
- if (!found) {
- DMERR("%s: device %s not in table devices list",
- dm_device_name(t->md), d->name);
+ list_for_each_entry(dd, devices, list)
+ list_for_each_entry(ref, &dd->refs, list)
+ if (ref->dm_dev == d)
+ goto found;
+
+ DMERR("%s: device %s not in table devices list",
+ dm_device_name(t->md), d->name);
+ goto unlock_ret;
+
+found:
+ if (!refcount_dec_and_test(&ref->count))
goto unlock_ret;
- }
- if (refcount_dec_and_test(&dd->count)) {
- dm_put_table_device(t->md, d);
+
+ dm_put_table_device(t->md, d);
+ list_del(&ref->list);
+ kfree(ref);
+
+ if (list_empty(&dd->refs)) {
list_del(&dd->list);
kfree(dd);
}
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index bc5c501a294cf..3d8a073de9c70 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1587,7 +1587,7 @@ static void __send_empty_flush(struct clone_info *ci)
*/
clone = alloc_tio(ci, NULL, 0, &len, GFP_NOIO);
atomic_add(1, &ci->io->io_count);
- bio_set_dev(clone, dd->dm_dev->bdev);
+ bio_set_dev(clone, dd->bdev);
clone->bi_end_io = clone_endio;
dm_submit_bio_remap(clone, NULL);
}
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index 7a795979ec729..34f58060243fb 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -37,10 +37,26 @@
/*
* List of devices that a metadevice uses and should open/close.
+ * There is one dm_dev_internal per device. It holds one dm_dev_ref
+ * for each mode that the targets opened the device with.
*/
struct dm_dev_internal {
struct list_head list;
- refcount_t count;
+ struct block_device *bdev;
+ struct list_head refs;
+};
+
+/*
+ * One open of a device with one mode, shared by the targets of a table.
+ * dm_get_device() reuses a dm_dev_ref whose mode covers the requested
+ * mode, and adds a new one only when none does. So the dm_dev_refs of
+ * a device have different modes, and a table holds each table_device
+ * at most once. table_device->count is still the number of tables that
+ * use the table_device.
+ */
+struct dm_dev_ref {
+ struct list_head list;
+ refcount_t count; /* dm_get_device() calls that returned dm_dev */
struct dm_dev *dm_dev;
};
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 081/703] iio: adc: ad7923: add the AD7927 to the SPI ID table
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 080/703] dm: fix use-after-free when dm_get_device() widens the open mode Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 082/703] iio: temperature: hid-sensor-temperature: Use per-instance callbacks Greg Kroah-Hartman
` (56 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik, Nuno Sá,
Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 594157b4f3f64db5833dee679194c33a5968f92e ]
The binding describes the AD7927 as
compatible = "adi,ad7927", "adi,ad7928";
The OF match takes the second string. The modalias of the SPI device is
made from the first one, "ad7927", which is not in the spi_device_id table:
spi_get_device_id() returns NULL and ad7923_probe() dereferences it for
the chip information. The module is not loaded automatically either, as the
uevent of an SPI device says "spi:ad7927".
Add the name, with the data of the AD7928.
Fixes: 1140f96cd4af ("dt-bindings: iio: adc: ad7923: adjust documentation")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
[ sashal: Adapted the new ad7927 entry to the older positional initializer style of the ID table, since the designated-initializer context lines from upstream are not present. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/adc/ad7923.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
index 0369151c7db1e..241dc91647688 100644
--- a/drivers/iio/adc/ad7923.c
+++ b/drivers/iio/adc/ad7923.c
@@ -366,6 +366,7 @@ static const struct spi_device_id ad7923_id[] = {
{ "ad7924", AD7924 },
{ "ad7908", AD7908 },
{ "ad7918", AD7918 },
+ { "ad7927", AD7928 },
{ "ad7928", AD7928 },
{ }
};
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 082/703] iio: temperature: hid-sensor-temperature: Use per-instance callbacks
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 081/703] iio: adc: ad7923: add the AD7927 to the SPI ID table Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 083/703] ACPI: PM: Avoid initializing power management for absent devices Greg Kroah-Hartman
` (55 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christopher Hoover, Joshua Crofts,
Srinivas Pandruvada, Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christopher Hoover <ch@murgatroid.com>
[ Upstream commit 36eeb26031e90eeb81bbac3d3acad61d23fcbdf3 ]
hid-sensor-temperature keeps a single static struct
hid_sensor_hub_callbacks for all instances and overwrites its pdev in
every probe. With two temperature sensors, input reports for one are
delivered with the other's platform device; once that device is
removed, platform_get_drvdata() returns NULL and
temperature_capture_sample() dereferences it:
BUG: kernel NULL pointer dereference, address: 00000000000003a8
RIP: 0010:temperature_capture_sample+0xd/0x50 [hid_sensor_temperature]
The oops happens in sensor_hub_raw_event() with the hub's spinlock
held, so the hub's removal then hangs. It reproduces with two uhid
devices that each declare a temperature sensor, one destroyed while
the other still sends input reports.
Keep the callbacks in struct temperature_state, as the other HID
sensor drivers (accel, gyro, als, ...) do.
Fixes: 59d0f2da3569 ("iio: hid: Add temperature sensor support")
Cc: stable@vger.kernel.org
Signed-off-by: Christopher Hoover <ch@murgatroid.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
[ sashal: Applied cleanly with only line offsets and a re-indented removed context line (&temperature_callbacks);) because the base file differs; the resulting code matches upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/temperature/hid-sensor-temperature.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/iio/temperature/hid-sensor-temperature.c b/drivers/iio/temperature/hid-sensor-temperature.c
index 34bff7e9f3a33..2b3478c6902cc 100644
--- a/drivers/iio/temperature/hid-sensor-temperature.c
+++ b/drivers/iio/temperature/hid-sensor-temperature.c
@@ -16,6 +16,7 @@
struct temperature_state {
struct hid_sensor_common common_attributes;
struct hid_sensor_hub_attribute_info temperature_attr;
+ struct hid_sensor_hub_callbacks callbacks;
struct {
s32 temperature_data;
aligned_s64 timestamp;
@@ -182,11 +183,6 @@ static int temperature_parse_report(struct platform_device *pdev,
return ret;
}
-static struct hid_sensor_hub_callbacks temperature_callbacks = {
- .send_event = &temperature_proc_event,
- .capture_sample = &temperature_capture_sample,
-};
-
/* Function to initialize the processing for usage id */
static int hid_temperature_probe(struct platform_device *pdev)
{
@@ -238,9 +234,13 @@ static int hid_temperature_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, indio_dev);
- temperature_callbacks.pdev = pdev;
+ temp_st->callbacks = (struct hid_sensor_hub_callbacks) {
+ .send_event = temperature_proc_event,
+ .capture_sample = temperature_capture_sample,
+ .pdev = pdev,
+ };
ret = sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_TEMPERATURE,
- &temperature_callbacks);
+ &temp_st->callbacks);
if (ret)
goto error_remove_trigger;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 083/703] ACPI: PM: Avoid initializing power management for absent devices
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 082/703] iio: temperature: hid-sensor-temperature: Use per-instance callbacks Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 084/703] Revert "ALSA: hda/realtek: Fix silent speaker on Higole F9B" Greg Kroah-Hartman
` (54 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alan Borzeszkowski,
Rafael J. Wysocki, Mika Westerberg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Upstream commit b91ad39f29ceeee3e3d37eedff6b7c912855623c ]
Commit 2f4ddf2bd1ba ("ACPI: scan: Stop calling acpi_bus_init_power()
early") removed a device presence check from acpi_bus_init_power() which
in some cases causes power management to be initialized for an ACPI
device object and never used going forward. That in turn may prevent
power management from working as expected for other devices.
Namely, if a given ACPI device object is not enabled according to its
_STA, find_child_checks() will return an error for it which will prevent
it from being used as an ACPI companion for a PCI device. Thus if
acpi_device_init_power() initializes power management for it and its
initial power state turns out to be different from D3cold, it may stay
in that power state forever. If it has power resources and they are
"on" during the initialization, they may be reference-counted and never
turned off. If they are shared with other devices, they will prevent
power from going down after attempting to put the other devices into
low-power states.
To prevent that from happening, restore the device presence check in
acpi_bus_init_power(), but also adjust find_child_checks() to return
an error for absent devices (instead of doing that for disabled devices)
in accordance with acpi_bus_init_power() and the existing check in
acpi_bus_attach().
Fixes: 2f4ddf2bd1ba ("ACPI: scan: Stop calling acpi_bus_init_power() early")
Reported-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>
Tested-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://patch.msgid.link/13013440.O9o76ZdvQC@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/device_pm.c | 15 +++++++++++++--
drivers/acpi/glue.c | 8 ++------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 62bce1ae8c1d6..b54a4c540344a 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -365,14 +365,25 @@ int acpi_bus_init_power(struct acpi_device *device)
* fails, ACPI power management will not be used for the device going
* forward.
*/
+ if (!acpi_device_is_present(device)) {
+ acpi_handle_debug(device->handle,
+ "Device not present, ACPI PM disabled\n");
+ result = -ENXIO;
+ goto fail;
+ }
+
result = acpi_device_init_power(device);
if (result) {
- device->flags.power_manageable = 0;
- device->power.state = ACPI_D_STATE_INVALID;
acpi_handle_info(device->handle,
"Initial power state undetermined, ACPI PM disabled\n");
+ goto fail;
}
+ return 0;
+
+fail:
+ device->flags.power_manageable = 0;
+ device->power.state = ACPI_D_STATE_INVALID;
return result;
}
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index f915a7c0e7cca..d2c1f969cef27 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -105,14 +105,10 @@ static bool acpi_dev_has_children(struct acpi_device *adev)
static int find_child_checks(struct acpi_device *adev, bool check_children)
{
- unsigned long long sta;
- acpi_status status;
-
if (check_children && !acpi_dev_has_children(adev))
return -ENODEV;
- status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta);
- if (status == AE_NOT_FOUND) {
+ if (!acpi_has_method(adev->handle, METHOD_NAME__STA)) {
/*
* Special case: backlight device objects without _STA are
* preferred to other objects with the same _ADR value, because
@@ -124,7 +120,7 @@ static int find_child_checks(struct acpi_device *adev, bool check_children)
return FIND_CHILD_MIN_SCORE;
}
- if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_ENABLED))
+ if (!acpi_device_is_present(adev))
return -ENODEV;
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 084/703] Revert "ALSA: hda/realtek: Fix silent speaker on Higole F9B"
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 083/703] ACPI: PM: Avoid initializing power management for absent devices Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 085/703] ovl: refactor ovl_lookup() Greg Kroah-Hartman
` (53 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cristian-Marian Fotache,
Takashi Iwai, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit b9fd2f07df77076f83a58fe7a5640cbcbc5a61ff ]
This reverts commit 2a8ee6897302ca12ff39e8eb180503956797c60c.
We've received a regression report due to this commit, and it turned
out that the PCI SSID for this quirk entry is too generic (10ec:111e)
that may match with several different models.
Usually a workaround would be to apply the quirk for a more unique ID
such as codec SSID, but in this case, unfortunately, the codec SSID is
also 10ec:111e, so BIOS is in a premature state.
For addressing the regression, revert the change for now.
Fixes: 2a8ee6897302 ("ALSA: hda/realtek: Fix silent speaker on Higole F9B")
Reported-by: Cristian-Marian Fotache <cristianmarianfotache@gmail.com>
Closes: https://lore.kernel.org/CACGjpbf73XdwrG34ffjmYU3ZYuStPpFNXf9w+AGYcTmLyHCN_w@mail.gmail.com
Link: https://patch.msgid.link/20261123093436.48511-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/hda/codecs/realtek/alc269.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index dbc7b56f4d42b..5f5b5b2a43530 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -7431,7 +7431,6 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
- SND_PCI_QUIRK(0x10ec, 0x111e, "Higole F9B", ALC290_FIXUP_MONO_SPEAKERS),
SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
SND_PCI_QUIRK(0x10ec, 0x119e, "Positivo SU C1400", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
SND_PCI_QUIRK(0x10ec, 0x11bc, "VAIO VJFE-IL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 085/703] ovl: refactor ovl_lookup()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 084/703] Revert "ALSA: hda/realtek: Fix silent speaker on Higole F9B" Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 086/703] ovl: do not read the flags of a put upper dentry in lookup Greg Kroah-Hartman
` (52 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Amir Goldstein, Christian Brauner,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit 15da486ad3bde6119d9b6353bebc2ffb6e9165c1 ]
Split the core into a separate helper in preparation of converting the
caller to the scoped ovl cred guard.
Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-37-b31603935724@kernel.org
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Stable-dep-of: 7031366be218 ("ovl: do not read the flags of a put upper dentry in lookup")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/namei.c | 316 ++++++++++++++++++++++---------------------
1 file changed, 162 insertions(+), 154 deletions(-)
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 6a8c977d6e5c3..0ec6b9b3c4baa 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1094,57 +1094,44 @@ static bool ovl_check_follow_redirect(struct ovl_lookup_data *d)
return true;
}
-struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
- unsigned int flags)
+struct ovl_lookup_ctx {
+ struct dentry *dentry;
+ struct ovl_entry *oe;
+ struct ovl_path *stack;
+ struct ovl_path *origin_path;
+ struct dentry *upperdentry;
+ struct dentry *index;
+ struct inode *inode;
+ unsigned int ctr;
+};
+
+static int ovl_lookup_layers(struct ovl_lookup_ctx *ctx, struct ovl_lookup_data *d)
{
- struct ovl_entry *oe = NULL;
- const struct cred *old_cred;
+ struct dentry *dentry = ctx->dentry;
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct ovl_entry *poe = OVL_E(dentry->d_parent);
struct ovl_entry *roe = OVL_E(dentry->d_sb->s_root);
- struct ovl_path *stack = NULL, *origin_path = NULL;
- struct dentry *upperdir, *upperdentry = NULL;
- struct dentry *origin = NULL;
- struct dentry *index = NULL;
- unsigned int ctr = 0;
- struct inode *inode = NULL;
- bool upperopaque = false;
bool check_redirect = (ovl_redirect_follow(ofs) || ofs->numdatalayer);
+ struct dentry *upperdir;
struct dentry *this;
- unsigned int i;
- int err;
+ struct dentry *origin = NULL;
+ bool upperopaque = false;
bool uppermetacopy = false;
int metacopy_size = 0;
- struct ovl_lookup_data d = {
- .sb = dentry->d_sb,
- .dentry = dentry,
- .name = dentry->d_name,
- .is_dir = false,
- .opaque = false,
- .stop = false,
- .last = check_redirect ? false : !ovl_numlower(poe),
- .redirect = NULL,
- .upperredirect = NULL,
- .metacopy = 0,
- };
-
- if (dentry->d_name.len > ofs->namelen)
- return ERR_PTR(-ENAMETOOLONG);
+ unsigned int i;
+ int err;
- old_cred = ovl_override_creds(dentry->d_sb);
upperdir = ovl_dentry_upper(dentry->d_parent);
if (upperdir) {
- d.layer = &ofs->layers[0];
- err = ovl_lookup_layer(upperdir, &d, &upperdentry, true);
+ d->layer = &ofs->layers[0];
+ err = ovl_lookup_layer(upperdir, d, &ctx->upperdentry, true);
if (err)
- goto out;
+ return err;
- if (upperdentry && upperdentry->d_flags & DCACHE_OP_REAL) {
- dput(upperdentry);
- err = -EREMOTE;
- goto out;
- }
- if (upperdentry && !d.is_dir) {
+ if (ctx->upperdentry && ctx->upperdentry->d_flags & DCACHE_OP_REAL)
+ return -EREMOTE;
+
+ if (ctx->upperdentry && !d->is_dir) {
/*
* Lookup copy up origin by decoding origin file handle.
* We may get a disconnected dentry, which is fine,
@@ -1155,50 +1142,50 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
* number - it's the same as if we held a reference
* to a dentry in lower layer that was moved under us.
*/
- err = ovl_check_origin(ofs, upperdentry, &origin_path);
+ err = ovl_check_origin(ofs, ctx->upperdentry, &ctx->origin_path);
if (err)
- goto out_put_upper;
+ return err;
- if (d.metacopy)
+ if (d->metacopy)
uppermetacopy = true;
- metacopy_size = d.metacopy;
+ metacopy_size = d->metacopy;
}
- if (d.redirect) {
+ if (d->redirect) {
err = -ENOMEM;
- d.upperredirect = kstrdup(d.redirect, GFP_KERNEL);
- if (!d.upperredirect)
- goto out_put_upper;
- if (d.redirect[0] == '/')
+ d->upperredirect = kstrdup(d->redirect, GFP_KERNEL);
+ if (!d->upperredirect)
+ return err;
+ if (d->redirect[0] == '/')
poe = roe;
}
- upperopaque = d.opaque;
+ upperopaque = d->opaque;
}
- if (!d.stop && ovl_numlower(poe)) {
+ if (!d->stop && ovl_numlower(poe)) {
err = -ENOMEM;
- stack = ovl_stack_alloc(ofs->numlayer - 1);
- if (!stack)
- goto out_put_upper;
+ ctx->stack = ovl_stack_alloc(ofs->numlayer - 1);
+ if (!ctx->stack)
+ return err;
}
- for (i = 0; !d.stop && i < ovl_numlower(poe); i++) {
+ for (i = 0; !d->stop && i < ovl_numlower(poe); i++) {
struct ovl_path lower = ovl_lowerstack(poe)[i];
- if (!ovl_check_follow_redirect(&d)) {
+ if (!ovl_check_follow_redirect(d)) {
err = -EPERM;
- goto out_put;
+ return err;
}
if (!check_redirect)
- d.last = i == ovl_numlower(poe) - 1;
- else if (d.is_dir || !ofs->numdatalayer)
- d.last = lower.layer->idx == ovl_numlower(roe);
+ d->last = i == ovl_numlower(poe) - 1;
+ else if (d->is_dir || !ofs->numdatalayer)
+ d->last = lower.layer->idx == ovl_numlower(roe);
- d.layer = lower.layer;
- err = ovl_lookup_layer(lower.dentry, &d, &this, false);
+ d->layer = lower.layer;
+ err = ovl_lookup_layer(lower.dentry, d, &this, false);
if (err)
- goto out_put;
+ return err;
if (!this)
continue;
@@ -1207,11 +1194,11 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
* If no origin fh is stored in upper of a merge dir, store fh
* of lower dir and set upper parent "impure".
*/
- if (upperdentry && !ctr && !ofs->noxattr && d.is_dir) {
- err = ovl_fix_origin(ofs, dentry, this, upperdentry);
+ if (ctx->upperdentry && !ctx->ctr && !ofs->noxattr && d->is_dir) {
+ err = ovl_fix_origin(ofs, dentry, this, ctx->upperdentry);
if (err) {
dput(this);
- goto out_put;
+ return err;
}
}
@@ -1224,23 +1211,23 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
* matches the dentry found using path based lookup,
* otherwise error out.
*/
- if (upperdentry && !ctr &&
- ((d.is_dir && ovl_verify_lower(dentry->d_sb)) ||
- (!d.is_dir && ofs->config.index && origin_path))) {
- err = ovl_verify_origin(ofs, upperdentry, this, false);
+ if (ctx->upperdentry && !ctx->ctr &&
+ ((d->is_dir && ovl_verify_lower(dentry->d_sb)) ||
+ (!d->is_dir && ofs->config.index && ctx->origin_path))) {
+ err = ovl_verify_origin(ofs, ctx->upperdentry, this, false);
if (err) {
dput(this);
- if (d.is_dir)
+ if (d->is_dir)
break;
- goto out_put;
+ return err;
}
origin = this;
}
- if (!upperdentry && !d.is_dir && !ctr && d.metacopy)
- metacopy_size = d.metacopy;
+ if (!ctx->upperdentry && !d->is_dir && !ctx->ctr && d->metacopy)
+ metacopy_size = d->metacopy;
- if (d.metacopy && ctr) {
+ if (d->metacopy && ctx->ctr) {
/*
* Do not store intermediate metacopy dentries in
* lower chain, except top most lower metacopy dentry.
@@ -1250,15 +1237,15 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
dput(this);
this = NULL;
} else {
- stack[ctr].dentry = this;
- stack[ctr].layer = lower.layer;
- ctr++;
+ ctx->stack[ctx->ctr].dentry = this;
+ ctx->stack[ctx->ctr].layer = lower.layer;
+ ctx->ctr++;
}
- if (d.stop)
+ if (d->stop)
break;
- if (d.redirect && d.redirect[0] == '/' && poe != roe) {
+ if (d->redirect && d->redirect[0] == '/' && poe != roe) {
poe = roe;
/* Find the current layer on the root dentry */
i = lower.layer->idx - 1;
@@ -1269,12 +1256,12 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
* Defer lookup of lowerdata in data-only layers to first access.
* Don't require redirect=follow and metacopy=on in this case.
*/
- if (d.metacopy && ctr && ofs->numdatalayer && d.absolute_redirect) {
- d.metacopy = 0;
- ctr++;
- } else if (!ovl_check_follow_redirect(&d)) {
+ if (d->metacopy && ctx->ctr && ofs->numdatalayer && d->absolute_redirect) {
+ d->metacopy = 0;
+ ctx->ctr++;
+ } else if (!ovl_check_follow_redirect(d)) {
err = -EPERM;
- goto out_put;
+ return err;
}
/*
@@ -1285,20 +1272,20 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
* For metacopy dentry, path based lookup will find lower dentries.
* Just make sure a corresponding data dentry has been found.
*/
- if (d.metacopy || (uppermetacopy && !ctr)) {
+ if (d->metacopy || (uppermetacopy && !ctx->ctr)) {
pr_warn_ratelimited("metacopy with no lower data found - abort lookup (%pd2)\n",
dentry);
err = -EIO;
- goto out_put;
- } else if (!d.is_dir && upperdentry && !ctr && origin_path) {
- if (WARN_ON(stack != NULL)) {
+ return err;
+ } else if (!d->is_dir && ctx->upperdentry && !ctx->ctr && ctx->origin_path) {
+ if (WARN_ON(ctx->stack != NULL)) {
err = -EIO;
- goto out_put;
+ return err;
}
- stack = origin_path;
- ctr = 1;
- origin = origin_path->dentry;
- origin_path = NULL;
+ ctx->stack = ctx->origin_path;
+ ctx->ctr = 1;
+ origin = ctx->origin_path->dentry;
+ ctx->origin_path = NULL;
}
/*
@@ -1320,38 +1307,39 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
* is enabled and if upper had an ORIGIN xattr.
*
*/
- if (!upperdentry && ctr)
- origin = stack[0].dentry;
+ if (!ctx->upperdentry && ctx->ctr)
+ origin = ctx->stack[0].dentry;
if (origin && ovl_indexdir(dentry->d_sb) &&
- (!d.is_dir || ovl_index_all(dentry->d_sb))) {
- index = ovl_lookup_index(ofs, upperdentry, origin, true);
- if (IS_ERR(index)) {
- err = PTR_ERR(index);
- index = NULL;
- goto out_put;
+ (!d->is_dir || ovl_index_all(dentry->d_sb))) {
+ ctx->index = ovl_lookup_index(ofs, ctx->upperdentry, origin, true);
+ if (IS_ERR(ctx->index)) {
+ err = PTR_ERR(ctx->index);
+ ctx->index = NULL;
+ return err;
}
}
- if (ctr) {
- oe = ovl_alloc_entry(ctr);
+ if (ctx->ctr) {
+ ctx->oe = ovl_alloc_entry(ctx->ctr);
err = -ENOMEM;
- if (!oe)
- goto out_put;
+ if (!ctx->oe)
+ return err;
- ovl_stack_cpy(ovl_lowerstack(oe), stack, ctr);
+ ovl_stack_cpy(ovl_lowerstack(ctx->oe), ctx->stack, ctx->ctr);
}
if (upperopaque)
ovl_dentry_set_opaque(dentry);
- if (d.xwhiteouts)
+ if (d->xwhiteouts)
ovl_dentry_set_xwhiteouts(dentry);
- if (upperdentry)
+ if (ctx->upperdentry)
ovl_dentry_set_upper_alias(dentry);
- else if (index) {
+ else if (ctx->index) {
+ char *upperredirect;
struct path upperpath = {
- .dentry = upperdentry = dget(index),
+ .dentry = ctx->upperdentry = dget(ctx->index),
.mnt = ovl_upper_mnt(ofs),
};
@@ -1360,77 +1348,97 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
* assignment happens only if upperdentry is non-NULL, and
* this one only if upperdentry is NULL.
*/
- d.upperredirect = ovl_get_redirect_xattr(ofs, &upperpath, 0);
- if (IS_ERR(d.upperredirect)) {
- err = PTR_ERR(d.upperredirect);
- d.upperredirect = NULL;
- goto out_free_oe;
- }
+ upperredirect = ovl_get_redirect_xattr(ofs, &upperpath, 0);
+ if (IS_ERR(upperredirect))
+ return PTR_ERR(upperredirect);
+ d->upperredirect = upperredirect;
err = ovl_check_metacopy_xattr(ofs, &upperpath, NULL);
if (err < 0)
- goto out_free_oe;
- d.metacopy = uppermetacopy = err;
+ return err;
+ d->metacopy = uppermetacopy = err;
metacopy_size = err;
- if (!ovl_check_follow_redirect(&d)) {
+ if (!ovl_check_follow_redirect(d)) {
err = -EPERM;
- goto out_free_oe;
+ return err;
}
}
- if (upperdentry || ctr) {
+ if (ctx->upperdentry || ctx->ctr) {
+ struct inode *inode;
struct ovl_inode_params oip = {
- .upperdentry = upperdentry,
- .oe = oe,
- .index = index,
- .redirect = d.upperredirect,
+ .upperdentry = ctx->upperdentry,
+ .oe = ctx->oe,
+ .index = ctx->index,
+ .redirect = d->upperredirect,
};
/* Store lowerdata redirect for lazy lookup */
- if (ctr > 1 && !d.is_dir && !stack[ctr - 1].dentry) {
- oip.lowerdata_redirect = d.redirect;
- d.redirect = NULL;
+ if (ctx->ctr > 1 && !d->is_dir && !ctx->stack[ctx->ctr - 1].dentry) {
+ oip.lowerdata_redirect = d->redirect;
+ d->redirect = NULL;
}
+
inode = ovl_get_inode(dentry->d_sb, &oip);
- err = PTR_ERR(inode);
if (IS_ERR(inode))
- goto out_free_oe;
- if (upperdentry && !uppermetacopy)
- ovl_set_flag(OVL_UPPERDATA, inode);
+ return PTR_ERR(inode);
+
+ ctx->inode = inode;
+ if (ctx->upperdentry && !uppermetacopy)
+ ovl_set_flag(OVL_UPPERDATA, ctx->inode);
if (metacopy_size > OVL_METACOPY_MIN_SIZE)
- ovl_set_flag(OVL_HAS_DIGEST, inode);
+ ovl_set_flag(OVL_HAS_DIGEST, ctx->inode);
}
- ovl_dentry_init_reval(dentry, upperdentry, OVL_I_E(inode));
+ ovl_dentry_init_reval(dentry, ctx->upperdentry, OVL_I_E(ctx->inode));
+
+ return 0;
+}
+
+struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
+ unsigned int flags)
+{
+ const struct cred *old_cred;
+ struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
+ struct ovl_entry *poe = OVL_E(dentry->d_parent);
+ bool check_redirect = (ovl_redirect_follow(ofs) || ofs->numdatalayer);
+ int err;
+ struct ovl_lookup_ctx ctx = {
+ .dentry = dentry,
+ };
+ struct ovl_lookup_data d = {
+ .sb = dentry->d_sb,
+ .dentry = dentry,
+ .name = dentry->d_name,
+ .last = check_redirect ? false : !ovl_numlower(poe),
+ };
+
+ if (dentry->d_name.len > ofs->namelen)
+ return ERR_PTR(-ENAMETOOLONG);
+
+ old_cred = ovl_override_creds(dentry->d_sb);
+
+ err = ovl_lookup_layers(&ctx, &d);
ovl_revert_creds(old_cred);
- if (origin_path) {
- dput(origin_path->dentry);
- kfree(origin_path);
+ if (ctx.origin_path) {
+ dput(ctx.origin_path->dentry);
+ kfree(ctx.origin_path);
}
- dput(index);
- ovl_stack_free(stack, ctr);
+ dput(ctx.index);
+ ovl_stack_free(ctx.stack, ctx.ctr);
kfree(d.redirect);
- return d_splice_alias(inode, dentry);
-out_free_oe:
- ovl_free_entry(oe);
-out_put:
- dput(index);
- ovl_stack_free(stack, ctr);
-out_put_upper:
- if (origin_path) {
- dput(origin_path->dentry);
- kfree(origin_path);
+ if (err) {
+ ovl_free_entry(ctx.oe);
+ dput(ctx.upperdentry);
+ kfree(d.upperredirect);
+ return ERR_PTR(err);
}
- dput(upperdentry);
- kfree(d.upperredirect);
-out:
- kfree(d.redirect);
- ovl_revert_creds(old_cred);
- return ERR_PTR(err);
+
+ return d_splice_alias(ctx.inode, dentry);
}
bool ovl_lower_positive(struct dentry *dentry)
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 086/703] ovl: do not read the flags of a put upper dentry in lookup
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 085/703] ovl: refactor ovl_lookup() Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 087/703] ovl: fix leak of lowerdata redirect on ovl_get_inode() failure Greg Kroah-Hartman
` (51 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Amir Goldstein, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
[ Upstream commit 7031366be218f291592a7ad38bc34a7cd1459737 ]
ovl_lookup_layers() passes ctx->upperdentry to ovl_get_inode(), which
takes over the reference. If an overlay inode for the upper inode is
already cached, as for a second hard link, ovl_get_inode() puts the
dentry and returns the cached inode. ovl_lookup_layers() then passes
the put dentry to ovl_dentry_init_reval(), which reads its d_flags.
With a local upper fs the put dentry usually stays in the dcache, but
with a FUSE upper whose entry has timed out, dput() kills it, so this
is a use-after-free.
Fix this by taking the revalidate flags from the upper dentry of the
overlay inode, which is the one that ovl_dentry_revalidate_common()
revalidates.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-986db859-840c-479d-944c-b9c43b93377e
Fixes: bccece1ead36 ("ovl: allow remote upper")
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/namei.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 0ec6b9b3c4baa..2c962a53cc59e 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1390,9 +1390,17 @@ static int ovl_lookup_layers(struct ovl_lookup_ctx *ctx, struct ovl_lookup_data
if (metacopy_size > OVL_METACOPY_MIN_SIZE)
ovl_set_flag(OVL_HAS_DIGEST, ctx->inode);
- }
- ovl_dentry_init_reval(dentry, ctx->upperdentry, OVL_I_E(ctx->inode));
+ /*
+ * ovl_get_inode() puts ctx->upperdentry if it finds a cached
+ * inode, e.g. for another hard link, so use the upper dentry
+ * of the inode.
+ */
+ ovl_dentry_init_reval(dentry, ovl_i_dentry_upper(inode),
+ OVL_I_E(inode));
+ } else {
+ ovl_dentry_init_reval(dentry, NULL, NULL);
+ }
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 087/703] ovl: fix leak of lowerdata redirect on ovl_get_inode() failure
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 086/703] ovl: do not read the flags of a put upper dentry in lookup Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 088/703] ovl: do not check the deferred lowerdata redirect on index lookup Greg Kroah-Hartman
` (50 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Amir Goldstein, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
[ Upstream commit f1b7e5534854043077bb72afc8d87ad1e0b283e0 ]
ovl_lookup_layers() moves d->redirect into oip.lowerdata_redirect and
clears d->redirect before calling ovl_get_inode(). When ovl_get_inode()
fails, it does not free oip.lowerdata_redirect, and ovl_lookup() frees
the already cleared d->redirect, so the lowerdata redirect string is
leaked.
Clear d->redirect only after ovl_get_inode() has succeeded, like
d->upperredirect, so that ovl_lookup() frees it on failure.
Fixes: 2b21da920866 ("ovl: prepare to store lowerdata redirect for lazy lowerdata lookup")
Closes: https://sashiko.dev/#/bug/linux-dabbd363-9c71-4915-af72-e2b5e75fa58e
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/namei.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 2c962a53cc59e..2903f17cfdf91 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1375,15 +1375,16 @@ static int ovl_lookup_layers(struct ovl_lookup_ctx *ctx, struct ovl_lookup_data
};
/* Store lowerdata redirect for lazy lookup */
- if (ctx->ctr > 1 && !d->is_dir && !ctx->stack[ctx->ctr - 1].dentry) {
+ if (ctx->ctr > 1 && !d->is_dir && !ctx->stack[ctx->ctr - 1].dentry)
oip.lowerdata_redirect = d->redirect;
- d->redirect = NULL;
- }
inode = ovl_get_inode(dentry->d_sb, &oip);
if (IS_ERR(inode))
return PTR_ERR(inode);
+ if (oip.lowerdata_redirect)
+ d->redirect = NULL;
+
ctx->inode = inode;
if (ctx->upperdentry && !uppermetacopy)
ovl_set_flag(OVL_UPPERDATA, ctx->inode);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 088/703] ovl: do not check the deferred lowerdata redirect on index lookup
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 087/703] ovl: fix leak of lowerdata redirect on ovl_get_inode() failure Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 089/703] ovl: follow lower to lowerdata redirects from any lower layer Greg Kroah-Hartman
` (49 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Amir Goldstein, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Goldstein <amir73il@gmail.com>
[ Upstream commit 011f67b2b5c366679af023261ee02e284d534a96 ]
When a lower metacopy has an absolute redirect into a data-only layer,
ovl_lookup_layers() defers the data lookup and skips
ovl_check_follow_redirect(), but leaves the redirect in d->redirect.
If there is no upper dentry and a sibling hardlink was already copied
up to the index dir, the index branch calls ovl_check_follow_redirect()
again and, with redirect_dir=nofollow (e.g. forced by userxattr), fails
the lookup with -EPERM because of the lower data redirect.
Take the lowerdata redirect out of d->redirect at the point where the
data lookup is deferred, so that the index check only validates the
redirect and metacopy state of the index entry.
Fixes: 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect")
Closes: https://sashiko.dev/#/bug/linux-29bea9ea-5376-4e54-88f6-04dabce4db70
Cc: stable@vger.kernel.org
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/namei.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 2903f17cfdf91..313ffc2d51da1 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -26,6 +26,7 @@ struct ovl_lookup_data {
bool last;
char *redirect;
char *upperredirect;
+ char *lowerdata_redirect;
int metacopy;
/* Referring to last redirect xattr */
bool absolute_redirect;
@@ -1259,6 +1260,8 @@ static int ovl_lookup_layers(struct ovl_lookup_ctx *ctx, struct ovl_lookup_data
if (d->metacopy && ctx->ctr && ofs->numdatalayer && d->absolute_redirect) {
d->metacopy = 0;
ctx->ctr++;
+ d->lowerdata_redirect = d->redirect;
+ d->redirect = NULL;
} else if (!ovl_check_follow_redirect(d)) {
err = -EPERM;
return err;
@@ -1375,15 +1378,14 @@ static int ovl_lookup_layers(struct ovl_lookup_ctx *ctx, struct ovl_lookup_data
};
/* Store lowerdata redirect for lazy lookup */
- if (ctx->ctr > 1 && !d->is_dir && !ctx->stack[ctx->ctr - 1].dentry)
- oip.lowerdata_redirect = d->redirect;
+ if (d->lowerdata_redirect)
+ oip.lowerdata_redirect = d->lowerdata_redirect;
inode = ovl_get_inode(dentry->d_sb, &oip);
if (IS_ERR(inode))
return PTR_ERR(inode);
- if (oip.lowerdata_redirect)
- d->redirect = NULL;
+ d->lowerdata_redirect = NULL;
ctx->inode = inode;
if (ctx->upperdentry && !uppermetacopy)
@@ -1439,6 +1441,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
dput(ctx.index);
ovl_stack_free(ctx.stack, ctx.ctr);
kfree(d.redirect);
+ kfree(d.lowerdata_redirect);
if (err) {
ovl_free_entry(ctx.oe);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 089/703] ovl: follow lower to lowerdata redirects from any lower layer
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 088/703] ovl: do not check the deferred lowerdata redirect on index lookup Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 090/703] ovl: bump the impure dir version when linking a file with origin Greg Kroah-Hartman
` (48 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Giuseppe Scrivano, Amir Goldstein,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Giuseppe Scrivano <giuseppe@scrivano.org>
[ Upstream commit cbf4ccabcbfdda3da70c10b37e21e99cd2ee0946 ]
Commit 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower
-> data redirect") allowed following redirects from a lower layer to a
data-only layer without redirect_dir=follow and metacopy=on, so that
data-only layers can be used with userxattr.
That fix was incomplete. Without metacopy=on, a metacopy file with an
absolute redirect into a data-only layer is followed only from the lowest
lower layer. From any other lower layer, the lookup fails with EPERM.
That commit also changed the behavior of redirect_dir=nofollow without
making it visible to users. With data-only layers, some redirects are
followed, although the mount options show redirect_dir=nofollow, or
show nothing when that is the default.
Add redirect_dir=followdata, which follows only redirects from lower to
lowerdata, and select it when there are data-only layers, unless
redirect_dir=follow or redirect_dir=on is in effect, so the redirect
follow mode in effect is shown in /proc/self/mountinfo.
Without metacopy=on, the absolute redirect of a lower metacopy file stops
the lookup in the lower layers and the data is looked up in the data-only
layers. Data-only layers cannot be used without following redirects,
so reject an explicit redirect_dir=nofollow with data-only layers.
Fixes: 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect")
Cc: stable@vger.kernel.org
Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/filesystems/overlayfs.rst | 24 ++++++++-----
fs/overlayfs/namei.c | 24 +++++++++++--
fs/overlayfs/overlayfs.h | 15 +++++++--
fs/overlayfs/params.c | 45 ++++++++++++++++++++-----
fs/overlayfs/params.h | 2 ++
fs/overlayfs/super.c | 17 ++++++----
6 files changed, 97 insertions(+), 30 deletions(-)
diff --git a/Documentation/filesystems/overlayfs.rst b/Documentation/filesystems/overlayfs.rst
index 2d6202807fd1d..a478f6915b875 100644
--- a/Documentation/filesystems/overlayfs.rst
+++ b/Documentation/filesystems/overlayfs.rst
@@ -237,14 +237,19 @@ Module options (can also be changed through /sys/module/overlay/parameters/):
Mount options:
- "redirect_dir=on":
- Redirects are enabled.
+ Redirects are created and followed.
- "redirect_dir=follow":
Redirects are not created, but followed.
+- "redirect_dir=followdata":
+ Redirects are not created.
+ Only redirects from lower to lowerdata are followed.
- "redirect_dir=nofollow":
Redirects are not created and not followed.
- "redirect_dir=off":
- If "redirect_always_follow" is enabled in the kernel/module config,
- this "off" translates to "follow", otherwise it translates to "nofollow".
+ Redirects are not created.
+ Which redirects are followed depends on "redirect_always_follow" in the
+ kernel/module config, on data-only lower layers and on the "userxattr"
+ mount option.
When the NFS export feature is enabled, every copied up directory is
indexed by the file handle of the lower inode and a file handle of the
@@ -403,8 +408,8 @@ pointed by REDIRECT. This should not be possible on local system as setting
"trusted." xattrs will require CAP_SYS_ADMIN. But it should be possible
for untrusted layers like from a pen drive.
-Note: redirect_dir={off|nofollow|follow[*]} and nfs_export=on mount options
-conflict with metacopy=on, and will result in an error.
+Note: redirect_dir={off|nofollow|followdata|follow[*]} and nfs_export=on
+mount options conflict with metacopy=on, and will result in an error.
[*] redirect_dir=follow only conflicts with metacopy=on if upperdir=... is
given.
@@ -445,10 +450,11 @@ to the absolute path of the "lower data" file in the "data-only" lower layer.
Instead of explicitly enabling "metacopy=on" it is sufficient to specify at
least one data-only layer to enable redirection of data to a data-only layer.
-In this case other forms of metacopy are rejected. Note: this way, data-only
-layers may be used together with "userxattr", in which case careful attention
-must be given to privileges needed to change the "user.overlay.redirect" xattr
-to prevent misuse.
+In this case other forms of metacopy are rejected. A data-only layer selects
+"redirect_dir=followdata", unless "redirect_dir=follow" or "redirect_dir=on" is
+in effect. Note: this way, data-only layers may be used together with
+"userxattr", in which case careful attention must be given to privileges needed
+to change the "user.overlay.redirect" xattr to prevent misuse.
Since kernel version v6.8, "data-only" lower layers can also be added using
the "datadir+" mount options and the fsconfig syscall from new mount api.
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 313ffc2d51da1..a101fa18465b6 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1088,7 +1088,8 @@ static bool ovl_check_follow_redirect(struct ovl_lookup_data *d)
pr_warn_ratelimited("refusing to follow metacopy origin for (%pd2)\n", d->dentry);
return false;
}
- if ((d->redirect || d->upperredirect) && !ovl_redirect_follow(ofs)) {
+ /* Check follow to lower layer, redirects to lowerdata are not checked here */
+ if ((d->redirect || d->upperredirect) && !ovl_redirect_follow_lower(ofs)) {
pr_warn_ratelimited("refusing to follow redirect for (%pd2)\n", d->dentry);
return false;
}
@@ -1106,13 +1107,26 @@ struct ovl_lookup_ctx {
unsigned int ctr;
};
+/*
+ * Without metacopy=on, the absolute redirect of a lower metacopy file is
+ * followed only into the data-only layers.
+ */
+static bool ovl_is_lowerdata_redirect(struct ovl_lookup_ctx *ctx,
+ struct ovl_lookup_data *d)
+{
+ struct ovl_fs *ofs = OVL_FS(d->sb);
+
+ return ofs->numdatalayer && !ofs->config.metacopy && ctx->ctr &&
+ d->metacopy && d->absolute_redirect;
+}
+
static int ovl_lookup_layers(struct ovl_lookup_ctx *ctx, struct ovl_lookup_data *d)
{
struct dentry *dentry = ctx->dentry;
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct ovl_entry *poe = OVL_E(dentry->d_parent);
struct ovl_entry *roe = OVL_E(dentry->d_sb->s_root);
- bool check_redirect = (ovl_redirect_follow(ofs) || ofs->numdatalayer);
+ bool check_redirect = ovl_redirect_follow(ofs);
struct dentry *upperdir;
struct dentry *this;
struct dentry *origin = NULL;
@@ -1243,6 +1257,10 @@ static int ovl_lookup_layers(struct ovl_lookup_ctx *ctx, struct ovl_lookup_data
ctx->ctr++;
}
+ /* Lookup of lowerdata in the data-only layers only */
+ if (ovl_is_lowerdata_redirect(ctx, d))
+ d->stop = true;
+
if (d->stop)
break;
@@ -1414,7 +1432,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
const struct cred *old_cred;
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct ovl_entry *poe = OVL_E(dentry->d_parent);
- bool check_redirect = (ovl_redirect_follow(ofs) || ofs->numdatalayer);
+ bool check_redirect = ovl_redirect_follow(ofs);
int err;
struct ovl_lookup_ctx ctx = {
.dentry = dentry,
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index c3a0eb0bfd1f0..f0a61663ce169 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -75,11 +75,13 @@ enum ovl_entry_flag {
enum {
/*
- * "off" mode is never used after mount options are verified. In effect
- * it translates to either "follow" or "nofollow".
+ * "off" mode is never used after mount options are verified.
+ * In effect it translates to either "follow", "nofollow" or
+ * "followdata" (with data-only layers).
*/
OVL_REDIRECT_OFF,
OVL_REDIRECT_FOLLOW,
+ OVL_REDIRECT_FOLLOWDATA,
OVL_REDIRECT_NOFOLLOW,
OVL_REDIRECT_ON,
};
@@ -632,11 +634,20 @@ static inline char ovl_get_opaquedir_val(struct ovl_fs *ofs,
return ovl_get_dir_xattr_val(ofs, path, OVL_XATTR_OPAQUE);
}
+/* Are redirects followed into lower layers? */
+static inline bool ovl_redirect_follow_lower(struct ovl_fs *ofs)
+{
+ return ofs->config.redirect_mode == OVL_REDIRECT_FOLLOW ||
+ ofs->config.redirect_mode == OVL_REDIRECT_ON;
+}
+
+/* Are redirects followed into lower or lowerdata layers? */
static inline bool ovl_redirect_follow(struct ovl_fs *ofs)
{
return ofs->config.redirect_mode != OVL_REDIRECT_NOFOLLOW;
}
+/* Are redirects created in upper dir? */
static inline bool ovl_redirect_dir(struct ovl_fs *ofs)
{
return ofs->config.redirect_mode == OVL_REDIRECT_ON;
diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c
index 588a50e333404..486e10cec31fb 100644
--- a/fs/overlayfs/params.c
+++ b/fs/overlayfs/params.c
@@ -107,6 +107,7 @@ static int ovl_xino_def(void)
const struct constant_table ovl_parameter_redirect_dir[] = {
{ "off", OVL_REDIRECT_OFF },
{ "follow", OVL_REDIRECT_FOLLOW },
+ { "followdata", OVL_REDIRECT_FOLLOWDATA },
{ "nofollow", OVL_REDIRECT_NOFOLLOW },
{ "on", OVL_REDIRECT_ON },
{}
@@ -117,21 +118,29 @@ static const char *ovl_redirect_mode_name(int redirect_mode)
return ovl_parameter_redirect_dir[redirect_mode].name;
}
-static const char *ovl_redirect_mode(struct ovl_config *config)
+const char *ovl_redirect_mode(struct ovl_config *config)
{
return ovl_redirect_mode_name(config->redirect_mode);
}
-static int ovl_redirect_follow_mode(void)
+int ovl_redirect_follow_mode(bool follow_lower, size_t nr_data)
{
- return ovl_redirect_always_follow ? OVL_REDIRECT_FOLLOW :
- OVL_REDIRECT_NOFOLLOW;
+ if (ovl_redirect_always_follow && follow_lower)
+ return OVL_REDIRECT_FOLLOW;
+
+ /* Data-only layers cannot be used without following redirects to them */
+ return nr_data ? OVL_REDIRECT_FOLLOWDATA : OVL_REDIRECT_NOFOLLOW;
}
+/*
+ * The default for show_options() is resolved as if there are no data-only layers,
+ * so that redirect_dir=followdata, which is auto selected with data-only layers,
+ * is displayed in mount options.
+ */
static int ovl_redirect_mode_def(void)
{
return ovl_redirect_dir_def ? OVL_REDIRECT_ON :
- ovl_redirect_follow_mode();
+ ovl_redirect_follow_mode(true, 0);
}
static const struct constant_table ovl_parameter_verity[] = {
@@ -887,6 +896,9 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx,
struct ovl_opt_set set = ctx->set;
/* The requested redirect_dir=, for reporting conflicts with it */
int redirect_opt = config->redirect_mode;
+ /* The redirect follow mode for redirect_dir=off and for the default */
+ int follow_mode = ovl_redirect_follow_mode(!config->userxattr,
+ ctx->nr_data);
/* Workdir/index are useless in non-upper mount */
if (!config->upperdir) {
@@ -913,9 +925,12 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx,
config->uuid = OVL_UUID_NULL;
}
- /* Resolve redirect_dir=off to the default redirect follow mode */
+ /*
+ * Resolve redirect_dir=off to the default redirect follow mode.
+ * With userxattr, redirects are not followed to lower by default.
+ */
if (config->redirect_mode == OVL_REDIRECT_OFF)
- config->redirect_mode = ovl_redirect_follow_mode();
+ config->redirect_mode = follow_mode;
/*
* This is to make the logic below simpler. It doesn't make any other
@@ -1012,7 +1027,8 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx,
/* Resolve userxattr -> !redirect && !metacopy dependency */
if (config->userxattr) {
if (set.redirect &&
- config->redirect_mode != OVL_REDIRECT_NOFOLLOW) {
+ config->redirect_mode != OVL_REDIRECT_NOFOLLOW &&
+ config->redirect_mode != OVL_REDIRECT_FOLLOWDATA) {
pr_err("conflicting options: userxattr,redirect_dir=%s\n",
ovl_redirect_mode_name(redirect_opt));
return -EINVAL;
@@ -1027,10 +1043,21 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx,
* options must be explicitly enabled if used together with
* userxattr.
*/
- config->redirect_mode = OVL_REDIRECT_NOFOLLOW;
+ if (!set.redirect)
+ config->redirect_mode = follow_mode;
config->metacopy = false;
}
+ /* Data-only layers are reached through redirects */
+ if (ctx->nr_data && config->redirect_mode == OVL_REDIRECT_NOFOLLOW) {
+ pr_err("redirect_dir=nofollow is not supported with data-only layers\n");
+ return -EINVAL;
+ }
+ if (!ctx->nr_data && config->redirect_mode == OVL_REDIRECT_FOLLOWDATA) {
+ pr_err("redirect_dir=followdata requires data-only layers\n");
+ return -EINVAL;
+ }
+
/*
* Fail if we don't have trusted xattr capability and a feature was
* explicitly requested that requires them.
diff --git a/fs/overlayfs/params.h b/fs/overlayfs/params.h
index ffd53cdd84827..3a514a21b14c4 100644
--- a/fs/overlayfs/params.h
+++ b/fs/overlayfs/params.h
@@ -42,3 +42,5 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx,
struct ovl_config *config);
int ovl_show_options(struct seq_file *m, struct dentry *dentry);
const char *ovl_xino_mode(struct ovl_config *config);
+const char *ovl_redirect_mode(struct ovl_config *config);
+int ovl_redirect_follow_mode(bool follow_lower, size_t nr_data);
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 4c19b204e53da..be78cb804b65c 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -684,7 +684,7 @@ static int ovl_create_volatile_dirty(struct ovl_fs *ofs)
}
static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs,
- const struct path *workpath)
+ const struct path *workpath, size_t nr_data)
{
struct vfsmount *mnt = ovl_upper_mnt(ofs);
struct dentry *workdir;
@@ -748,9 +748,11 @@ static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs,
if (err) {
pr_warn("failed to set xattr on upper\n");
ofs->noxattr = true;
- if (ovl_redirect_follow(ofs)) {
- ofs->config.redirect_mode = OVL_REDIRECT_NOFOLLOW;
- pr_warn("...falling back to redirect_dir=nofollow.\n");
+ if (ovl_redirect_follow_lower(ofs)) {
+ ofs->config.redirect_mode =
+ ovl_redirect_follow_mode(false, nr_data);
+ pr_warn("...falling back to redirect_dir=%s.\n",
+ ovl_redirect_mode(&ofs->config));
}
if (ofs->config.metacopy) {
ofs->config.metacopy = false;
@@ -827,7 +829,7 @@ static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs,
static int ovl_get_workdir(struct super_block *sb, struct ovl_fs *ofs,
const struct path *upperpath,
- const struct path *workpath)
+ const struct path *workpath, size_t nr_data)
{
int err;
@@ -856,7 +858,7 @@ static int ovl_get_workdir(struct super_block *sb, struct ovl_fs *ofs,
if (err)
return err;
- return ovl_make_workdir(sb, ofs, workpath);
+ return ovl_make_workdir(sb, ofs, workpath, nr_data);
}
static int ovl_get_indexdir(struct super_block *sb, struct ovl_fs *ofs,
@@ -1510,7 +1512,8 @@ int ovl_fill_super(struct super_block *sb, struct fs_context *fc)
}
}
- err = ovl_get_workdir(sb, ofs, &ctx->upper, &ctx->work);
+ err = ovl_get_workdir(sb, ofs, &ctx->upper, &ctx->work,
+ ctx->nr_data);
if (err)
goto out_err;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 090/703] ovl: bump the impure dir version when linking a file with origin
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 089/703] ovl: follow lower to lowerdata redirects from any lower layer Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 091/703] smb: client: hold server ref while queueing reconnect work Greg Kroah-Hartman
` (47 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Daejun Park, Amir Goldstein,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daejun Park <daejun7.park@samsung.com>
[ Upstream commit 86e2facd8630cc2fdec6ea80c53e370b26b441d9 ]
Linking a file with copy up origin into a non-merge impure dir does
not bump the dir version. readdir then reuses the impure dir cache
built before the link. It reports the upper inode number as d_ino of
the new link, not st_ino.
Pass whether the linked file has an origin to ovl_dir_modified(), as
rename and unlink do.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-98f207b6-3936-48e9-a40f-88f20be4db7b
Fixes: 4edb83bb1041 ("ovl: constant d_ino for non-merge dirs")
Cc: stable@vger.kernel.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
[ sashal: Added a bool origin parameter to ovl_create_upper() and ovl_create_over_whiteout() and passed it from the direct calls in ovl_create_or_link(), since the upstream ovl_create_handle_whiteouts() wrapper doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/overlayfs/dir.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
index 8377f112feca3..b9f0eb5e7dd78 100644
--- a/fs/overlayfs/dir.c
+++ b/fs/overlayfs/dir.c
@@ -355,7 +355,7 @@ static bool ovl_type_origin(struct dentry *dentry)
}
static int ovl_create_upper(struct dentry *dentry, struct inode *inode,
- struct ovl_cattr *attr)
+ struct ovl_cattr *attr, bool origin)
{
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct dentry *upperdir = ovl_dentry_upper(dentry->d_parent);
@@ -378,7 +378,7 @@ static int ovl_create_upper(struct dentry *dentry, struct inode *inode,
ovl_set_opaque(dentry, newdentry);
}
- ovl_dir_modified(dentry->d_parent, false);
+ ovl_dir_modified(dentry->d_parent, origin);
err = ovl_instantiate(dentry, inode, newdentry, !!attr->hardlink, NULL);
if (err)
goto out_cleanup;
@@ -471,7 +471,7 @@ static int ovl_set_upper_acl(struct ovl_fs *ofs, struct dentry *upperdentry,
}
static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
- struct ovl_cattr *cattr)
+ struct ovl_cattr *cattr, bool origin)
{
struct ovl_fs *ofs = OVL_FS(dentry->d_sb);
struct dentry *workdir = ovl_workdir(dentry);
@@ -557,7 +557,7 @@ static int ovl_create_over_whiteout(struct dentry *dentry, struct inode *inode,
if (err)
goto out_cleanup_unlocked;
}
- ovl_dir_modified(dentry->d_parent, false);
+ ovl_dir_modified(dentry->d_parent, origin);
err = ovl_instantiate(dentry, inode, newdentry, hardlink, NULL);
if (err) {
ovl_cleanup(ofs, upperdir, newdentry);
@@ -656,9 +656,9 @@ static int ovl_create_or_link(struct dentry *dentry, struct inode *inode,
}
if (!ovl_dentry_is_whiteout(dentry))
- err = ovl_create_upper(dentry, inode, attr);
+ err = ovl_create_upper(dentry, inode, attr, origin);
else
- err = ovl_create_over_whiteout(dentry, inode, attr);
+ err = ovl_create_over_whiteout(dentry, inode, attr, origin);
out_revert_creds:
ovl_revert_creds(old_cred);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 091/703] smb: client: hold server ref while queueing reconnect work
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 090/703] ovl: bump the impure dir version when linking a file with origin Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 092/703] smb: client: dont write back through O_DIRECT handles Greg Kroah-Hartman
` (46 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Joseph Qi, Paulo Alcantara,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joseph Qi <joseph.qi@linux.alibaba.com>
[ Upstream commit f02d249e9756b78990aaaa1635e47e06deb2cb51 ]
When query_server_interfaces() returns -EOPNOTSUPP on a secondary
channel, smb2_reconnect() calls smb3_update_ses_channels() which for a
channel runs cifs_chan_skip_or_disable(). That clears the channel's
slot in the session and calls cifs_put_tcp_session(), which can drop
the last reference of the channel and tear it down.
smb2_reconnect() then falls through to skip_add_channels and queues
reconnect work on that server, using a server that may already be
freed. The send path obtained the channel from cifs_pick_channel(),
which does not take a reference, so the session's channel reference is
the only one.
Take our own reference on the channel before calling
smb3_update_ses_channels() and drop it after the reconnect work has
been queued, so the channel cannot be freed while it is still used.
Fixes: f591062bdbf4 ("cifs: handle servers that still advertise multichannel after disabling")
Cc: stable@vger.kernel.org
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
[ sashal: Used cifs_chan_skip_or_disable() in place of smb3_update_ses_channels(), which doesn't exist in this tree, while keeping the same extra-reference locking and put as upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/smb2pdu.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index 7b95493b94642..17230f94eea3b 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -219,9 +219,10 @@ static int
smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
struct TCP_Server_Info *server, bool from_reconnect)
{
+ bool hold_server_ref = false;
struct cifs_ses *ses;
- int xid;
int rc = 0;
+ int xid;
/*
* SMB2s NegProt, SessSetup, Logoff do not have tcon yet so
@@ -439,6 +440,20 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
* treat this as server not supporting multichannel
*/
+ /*
+ * If server is a secondary channel,
+ * cifs_chan_skip_or_disable() called below may
+ * drop its last reference, so hold our own
+ * reference until the reconnect work below has
+ * been queued.
+ */
+ spin_lock(&cifs_tcp_ses_lock);
+ if (server->srv_count) {
+ server->srv_count++;
+ hold_server_ref = true;
+ }
+ spin_unlock(&cifs_tcp_ses_lock);
+
rc = cifs_chan_skip_or_disable(ses, server,
from_reconnect);
goto skip_add_channels;
@@ -465,6 +480,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
if (smb2_command != SMB2_INTERNAL_CMD)
mod_delayed_work(cifsiod_wq, &server->reconnect, 0);
+ if (hold_server_ref)
+ cifs_put_tcp_session(server, from_reconnect);
atomic_inc(&tconInfoReconnectCount);
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 092/703] smb: client: dont write back through O_DIRECT handles
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 091/703] smb: client: hold server ref while queueing reconnect work Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 093/703] smb: client: dont fail writeback preparation if the task is dying Greg Kroah-Hartman
` (45 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Paulo Alcantara,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
[ Upstream commit 0e85145af984f7cae2aadaa694cb8612009027ac ]
Writeback uses the first writable handle of the inode, which may have
been opened with O_DIRECT. Such handles are opened with
FILE_NO_INTERMEDIATE_BUFFERING, for which Windows rejects any unaligned
I/O with STATUS_INVALID_PARAMETER. Writeback of partly dirty pages and
of the unaligned tail of a file through one of them fails, so netfs ends
it with the folios clean and the data never reaches the server.
xfstests generic/051, where fsstress mixes both kinds of opens, loses
about 1% of its writes this way:
smb3_write_err: ... offset=0xde90d7 len=0xbd0b rc=-22
All the rejected writes in a network capture were unaligned writes on a
no-buffering handle; none of the aligned ones, and none of the unaligned
ones on regular handles, were.
Prefer a handle that was not opened with O_DIRECT, and use one that was
only if there is no other.
Fixes: 1013e760d10e ("SMB3: Don't ignore O_SYNC/O_DSYNC and O_DIRECT flags")
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
[ sashal: Renamed FIND_* flags to this tree's FIND_WR_* names, used bit 3 for the new flag, and dropped the tmpfile hunk because that code is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/cifsglob.h | 1 +
fs/smb/client/file.c | 13 +++++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h
index ea6533d057acf..2660a3a0f51cb 100644
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -1868,6 +1868,7 @@ enum cifs_writable_file_flags {
FIND_WR_FSUID_ONLY = (1U << 0),
FIND_WR_WITH_DELETE = (1U << 1),
FIND_WR_NO_PENDING_DELETE = (1U << 2),
+ FIND_WR_NO_DIRECT = (1U << 3),
};
#define MID_FREE 0
diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c
index 652206fead33c..e11662f2a903c 100644
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -282,9 +282,15 @@ static void cifs_begin_writeback(struct netfs_io_request *wreq)
struct cifs_io_request *req = container_of(wreq, struct cifs_io_request, rreq);
int ret;
- ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_WR_ANY, &req->cfile);
+ ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_WR_NO_DIRECT,
+ &req->cfile);
if (ret) {
- cifs_dbg(VFS, "No writable handle in writepages ret=%d\n", ret);
+ ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_WR_ANY,
+ &req->cfile);
+ }
+ if (ret) {
+ cifs_dbg(VFS, "%s: couldn't find writable handle: %d\n",
+ __func__, ret);
return;
}
@@ -2669,6 +2675,9 @@ cifs_get_writable_file(struct cifsInodeInfo *cifs_inode, int flags,
if ((flags & FIND_WR_NO_PENDING_DELETE) &&
open_file->status_file_deleted)
continue;
+ if ((flags & FIND_WR_NO_DIRECT) &&
+ (open_file->f_flags & O_DIRECT))
+ continue;
if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) {
if (!open_file->invalidHandle) {
/* found a good writable file */
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 093/703] smb: client: dont fail writeback preparation if the task is dying
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 092/703] smb: client: dont write back through O_DIRECT handles Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 094/703] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14 Greg Kroah-Hartman
` (44 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Howells, Paulo Alcantara,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
[ Upstream commit 29ead886deaa1344a43ab68b1ea305ea2c86c378 ]
cifs_prepare_write() may need to reopen an invalidated handle and to wait
for credits, both from the context of the task doing writeback. A dying
task gets the reopen refused at send time and the killable credit wait
interrupted, so the subrequest is failed and, as with refused sends, its
folios end writeback clean and the data is lost.
For writeback in a dying task, skip both and prepare a credit-less
subrequest capped at SMB2_MAX_BUFFER_SIZE, as already done when the
server is low on credits. It gets issued from cifswritebackd, which
reopens the handle if needed and takes a single credit when sending,
neither of which can be interrupted there. Do the same when the reopen
or credit wait fails because a fatal signal arrived meanwhile.
cifs_begin_writeback() reopens the handle too when all the writable ones
got invalidated, e.g. by a reconnect. If that fails, there is no
upload stream, so netfs ends writeback of every folio clean with no
error recorded. Take an invalidated handle as is there and leave
reopening it to cifs_prepare_write(). If there is no writable handle at
all, record -EIO for the mapping, so that the loss gets reported.
Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib")
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: stable@vger.kernel.org
[ sashal: Used this tree's FIND_WR_* flag names with FIND_WR_NO_REOPEN on the next free bit, and dropped the TMPFILE find_flags mask that doesn't exist here. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/cifsglob.h | 1 +
fs/smb/client/file.c | 47 ++++++++++++++++++++++++++++++----------
2 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h
index 2660a3a0f51cb..09a711268b6e2 100644
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -1869,6 +1869,7 @@ enum cifs_writable_file_flags {
FIND_WR_WITH_DELETE = (1U << 1),
FIND_WR_NO_PENDING_DELETE = (1U << 2),
FIND_WR_NO_DIRECT = (1U << 3),
+ FIND_WR_NO_REOPEN = (1U << 4),
};
#define MID_FREE 0
diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c
index e11662f2a903c..0ede5a94d93cf 100644
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -40,6 +40,12 @@
static int cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush);
+static bool cifs_writeback_dying(struct netfs_io_subrequest *subreq)
+{
+ return subreq->rreq->origin == NETFS_WRITEBACK &&
+ fatal_signal_pending(current);
+}
+
/*
* Prepare a subrequest to upload to the server. We need to allocate credits
* so that we know the maximum amount of data that we can include in it.
@@ -68,12 +74,17 @@ static void cifs_prepare_write(struct netfs_io_subrequest *subreq)
cifs_negotiate_wsize(server, cifs_sb->ctx,
tlink_tcon(req->cfile->tlink));
+ if (cifs_writeback_dying(subreq))
+ goto defer;
+
retry:
if (open_file->invalidHandle) {
rc = cifs_reopen_file(open_file, false);
if (rc < 0) {
if (rc == -EAGAIN)
goto retry;
+ if (cifs_writeback_dying(subreq))
+ goto defer;
subreq->error = rc;
return netfs_prepare_write_failed(subreq);
}
@@ -82,10 +93,17 @@ static void cifs_prepare_write(struct netfs_io_subrequest *subreq)
rc = server->ops->wait_mtu_credits(server, wsize, &stream->sreq_max_len,
&wdata->credits);
if (rc < 0) {
+ if (cifs_writeback_dying(subreq))
+ goto defer;
subreq->error = rc;
return netfs_prepare_write_failed(subreq);
}
+ goto out;
+defer:
+ wdata->credits = (struct cifs_credits){};
+ stream->sreq_max_len = min_t(size_t, wsize, SMB2_MAX_BUFFER_SIZE);
+out:
wdata->credits.rreq_debug_id = subreq->rreq->debug_id;
wdata->credits.rreq_debug_index = subreq->debug_index;
wdata->credits.in_flight_check = 1;
@@ -106,12 +124,6 @@ static void cifs_prepare_write(struct netfs_io_subrequest *subreq)
#endif
}
-static bool cifs_writeback_dying(struct netfs_io_subrequest *subreq)
-{
- return subreq->rreq->origin == NETFS_WRITEBACK &&
- fatal_signal_pending(current);
-}
-
/*
* Issue a subrequest to upload to the server.
*/
@@ -153,10 +165,15 @@ static void __cifs_issue_write(struct netfs_io_subrequest *subreq)
static void cifs_issue_write_worker(struct work_struct *work)
{
- struct netfs_io_subrequest *subreq;
+ struct cifs_io_subrequest *wdata;
+ struct cifsFileInfo *cfile;
- subreq = container_of(work, struct netfs_io_subrequest, work);
- __cifs_issue_write(subreq);
+ wdata = container_of(work, struct cifs_io_subrequest, subreq.work);
+ cfile = wdata->req->cfile;
+ while (cfile->invalidHandle &&
+ cifs_reopen_file(cfile, false) == -EAGAIN)
+ ;
+ __cifs_issue_write(&wdata->subreq);
}
static void cifs_issue_write(struct netfs_io_subrequest *subreq)
@@ -282,15 +299,17 @@ static void cifs_begin_writeback(struct netfs_io_request *wreq)
struct cifs_io_request *req = container_of(wreq, struct cifs_io_request, rreq);
int ret;
- ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_WR_NO_DIRECT,
+ ret = cifs_get_writable_file(CIFS_I(wreq->inode),
+ FIND_WR_NO_REOPEN | FIND_WR_NO_DIRECT,
&req->cfile);
if (ret) {
- ret = cifs_get_writable_file(CIFS_I(wreq->inode), FIND_WR_ANY,
- &req->cfile);
+ ret = cifs_get_writable_file(CIFS_I(wreq->inode),
+ FIND_WR_NO_REOPEN, &req->cfile);
}
if (ret) {
cifs_dbg(VFS, "%s: couldn't find writable handle: %d\n",
__func__, ret);
+ mapping_set_error(wreq->mapping, -EIO);
return;
}
@@ -2705,6 +2724,10 @@ cifs_get_writable_file(struct cifsInodeInfo *cifs_inode, int flags,
spin_unlock(&cifs_inode->open_file_lock);
if (inv_file) {
+ if (flags & FIND_WR_NO_REOPEN) {
+ *ret_file = inv_file;
+ return 0;
+ }
rc = cifs_reopen_file(inv_file, false);
if (!rc) {
*ret_file = inv_file;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 094/703] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 093/703] smb: client: dont fail writeback preparation if the task is dying Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 095/703] usb: dwc3: Always deassert xilinx resets Greg Kroah-Hartman
` (43 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Francesco Orro, Ihor Urazov,
Heikki Krogerus, Huang Wei, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ihor Urazov <z0rc3r@gmail.com>
[ Upstream commit 3ee1e1c3fca6fb5d0abbe0fc91539951ffa60aa7 ]
The HP ZBook 8 G2i 14 (board 8ED9) exposes a working UCSI ACPI PPM, but
its UCSI VERSION field reads zero until the first command completes.
ucsi_register() rejects a zero version with -ENODEV, so no Type-C ports
are registered.
The firmware's _DSM READ function (2) is a stub. The mailbox VERSION
field is written only by the EC response handler, after a command
completes, after which it reads 0x0100 (UCSI 1.0). The mailbox is
48 bytes with 16-byte MESSAGE_IN/MESSAGE_OUT fields, the UCSI 1.x
layout, and _DSM function 5 is not implemented.
Add a DMI-specific read_version for this board that substitutes the
version the firmware itself reports, UCSI 1.0, only when VERSION reads
zero. A non-zero firmware version is used as is.
The same firmware defect on the HP ZBook Fury G1i 16 was discussed in
"[RFC PATCH] usb: typec: ucsi: acpi: bootstrap PPM on HP systems with
empty _DSM func 2" [1]. The defect was reported to HP as case
5166176673.
Tested on an HP ZBook 8 G2i 14 with BIOS Y70 01.02.08, from a fresh
boot where VERSION reads zero: three connectors register, the PD
contract and alternate modes of a Thunderbolt dock are reported, and
its DisplayPort output stays up across the PPM reset in ucsi_init().
Dock unplug/replug and s2idle suspend/resume update the connector
state without errors.
Link: https://lore.kernel.org/linux-usb/f3M_fpjtt8FxDqGKcA84vqXmRbKzCBfpCrIK4-jCWvIscER51zkD8qD8FYpz75qZw51rMDRSkUyYlrBvLvdM8CGRY2l8TFVvr4MC1LdTzbc=@interstellar.eu/ [1]
Fixes: c1b0bc2dabfa ("usb: typec: Add support for UCSI interface")
Cc: stable <stable@kernel.org>
Cc: Francesco Orro <ncesco@interstellar.eu>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ihor Urazov <z0rc3r@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Huang Wei <huangwei@kylinos.cn>
Link: https://patch.msgid.link/20261026-ucsi-hp-zbook-8-g2i-v1-1-91002e9ef073@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ sashal: Dropped the .write_message_out line from the new ucsi_hp_ops table, since this tree's ucsi_operations has no such member or helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/typec/ucsi/ucsi_acpi.c | 34 ++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
index c3f6856032c20..0fbc13ce79237 100644
--- a/drivers/usb/typec/ucsi/ucsi_acpi.c
+++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
@@ -131,6 +131,33 @@ static const struct ucsi_operations ucsi_acer_ops = {
.async_control = ucsi_acpi_async_control
};
+static int ucsi_hp_read_version(struct ucsi *ucsi, u16 *version)
+{
+ struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
+ int ret;
+
+ ret = ucsi_acpi_read_version(ucsi, version);
+ if (ret)
+ return ret;
+
+ /* Firmware fills in VERSION (1.0) only after the first command completes */
+ if (!*version) {
+ dev_warn(ua->dev, "UCSI version is zero, assuming 1.0\n");
+ *version = UCSI_VERSION_1_0;
+ }
+
+ return 0;
+}
+
+static const struct ucsi_operations ucsi_hp_ops = {
+ .read_version = ucsi_hp_read_version,
+ .read_cci = ucsi_acpi_read_cci,
+ .poll_cci = ucsi_acpi_poll_cci,
+ .read_message_in = ucsi_acpi_read_message_in,
+ .sync_control = ucsi_sync_control_common,
+ .async_control = ucsi_acpi_async_control
+};
+
static int ucsi_gram_sync_control(struct ucsi *ucsi, u64 command, u32 *cci,
void *val, size_t len)
{
@@ -177,6 +204,13 @@ static const struct dmi_system_id ucsi_acpi_quirks[] = {
},
.driver_data = (void *)&ucsi_acer_ops,
},
+ {
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+ DMI_MATCH(DMI_BOARD_NAME, "8ED9"),
+ },
+ .driver_data = (void *)&ucsi_hp_ops,
+ },
{
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 095/703] usb: dwc3: Always deassert xilinx resets
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 094/703] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14 Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 096/703] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths Greg Kroah-Hartman
` (42 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sean Anderson, Thinh Nguyen,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sean Anderson <sean.anderson@linux.dev>
[ Upstream commit ec06c8039d396a1b558cc138f5c5aba17698e175 ]
If we don't have a usb3 phy we don't need to assert the core resets.
Deassert them even if we didn't assert them to support booting when the
bootloader never released the core from reset.
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260106171018.501612-1-sean.anderson@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: f33f0dd2eb01 ("usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/dwc3/dwc3-xilinx.c | 71 ++++++++++++++++------------------
1 file changed, 34 insertions(+), 37 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index 8897fbe554745..449c03223c7f3 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -132,21 +132,6 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
goto err;
}
- /*
- * The following core resets are not required unless a USB3 PHY
- * is used, and the subsequent register settings are not required
- * unless a core reset is performed (they should be set properly
- * by the first-stage boot loader, but may be reverted by a core
- * reset). They may also break the configuration if USB3 is actually
- * in use but the usb3-phy entry is missing from the device tree.
- * Therefore, skip these operations in this case.
- */
- if (!priv_data->usb3_phy) {
- /* Deselect the PIPE Clock Select bit in FPD PIPE Clock register */
- writel(PIPE_CLK_DESELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
- goto skip_usb3_phy;
- }
-
crst = devm_reset_control_get_exclusive(dev, "usb_crst");
if (IS_ERR(crst)) {
ret = PTR_ERR(crst);
@@ -171,22 +156,31 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
goto err;
}
- ret = reset_control_assert(crst);
- if (ret < 0) {
- dev_err(dev, "Failed to assert core reset\n");
- goto err;
- }
-
- ret = reset_control_assert(hibrst);
- if (ret < 0) {
- dev_err(dev, "Failed to assert hibernation reset\n");
- goto err;
- }
-
- ret = reset_control_assert(apbrst);
- if (ret < 0) {
- dev_err(dev, "Failed to assert APB reset\n");
- goto err;
+ /*
+ * Asserting the core resets is not required unless a USB3 PHY is used.
+ * They may also break the configuration if USB3 is actually in use but
+ * the usb3-phy entry is missing from the device tree. Therefore, skip
+ * a full reset cycle and just deassert the resets if the phy is
+ * absent.
+ */
+ if (priv_data->usb3_phy) {
+ ret = reset_control_assert(crst);
+ if (ret < 0) {
+ dev_err(dev, "Failed to assert core reset\n");
+ goto err;
+ }
+
+ ret = reset_control_assert(hibrst);
+ if (ret < 0) {
+ dev_err(dev, "Failed to assert hibernation reset\n");
+ goto err;
+ }
+
+ ret = reset_control_assert(apbrst);
+ if (ret < 0) {
+ dev_err(dev, "Failed to assert APB reset\n");
+ goto err;
+ }
}
ret = phy_init(priv_data->usb3_phy);
@@ -199,11 +193,15 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
goto err_phy_exit;
}
- /* Set PIPE Power Present signal in FPD Power Present Register*/
- writel(FPD_POWER_PRSNT_OPTION, priv_data->regs + XLNX_USB_FPD_POWER_PRSNT);
-
- /* Set the PIPE Clock Select bit in FPD PIPE Clock register */
- writel(PIPE_CLK_SELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
+ if (priv_data->usb3_phy) {
+ /* Set PIPE Power Present signal in FPD Power Present Register*/
+ writel(FPD_POWER_PRSNT_OPTION, priv_data->regs + XLNX_USB_FPD_POWER_PRSNT);
+ /* Set the PIPE Clock Select bit in FPD PIPE Clock register */
+ writel(PIPE_CLK_SELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
+ } else {
+ /* Deselect the PIPE Clock Select bit in FPD PIPE Clock register */
+ writel(PIPE_CLK_DESELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
+ }
ret = reset_control_deassert(crst);
if (ret < 0) {
@@ -221,7 +219,6 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
if (ret < 0)
goto err_phy_exit;
-skip_usb3_phy:
/* ulpi reset via gpio-modepin or gpio-framework driver */
reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(reset_gpio)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 096/703] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 095/703] usb: dwc3: Always deassert xilinx resets Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 097/703] w1: w1_therm: lock the list of slaves for the bulk read Greg Kroah-Hartman
` (41 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Radhey Shyam Pandey,
Thinh Nguyen, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
[ Upstream commit f33f0dd2eb014bffda02ecfd182de3ddab058596 ]
If reset deassert or PHY setup fails partway through
dwc3_xlnx_init_zynqmp(), re-assert the resets that were already
released before unwinding the PHY.
Only undo the reset cycle the function actually performed. The cycle is
skipped when no usb3-phy is present, because asserting the core resets
can break a USB3 configuration that is live but missing from the device
tree, so the error path skips it for the same reason. Asserting an
already asserted reset is harmless, so one block covers however far the
deasserts progressed.
Save the ZynqMP reset handles in driver private data so later probe
teardown can re-assert released resets.
Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms")
Cc: stable <stable@kernel.org>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260928120015.3152461-3-radhey.shyam.pandey@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/dwc3/dwc3-xilinx.c | 55 ++++++++++++++++++++++------------
1 file changed, 36 insertions(+), 19 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index 449c03223c7f3..7e25ccd42be4f 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -48,6 +48,9 @@ struct dwc3_xlnx {
void __iomem *regs;
int (*pltfm_init)(struct dwc3_xlnx *data);
struct phy *usb3_phy;
+ struct reset_control *usb_crst;
+ struct reset_control *usb_hibrst;
+ struct reset_control *usb_apbrst;
};
static void dwc3_xlnx_mask_phy_rst(struct dwc3_xlnx *priv_data, bool mask)
@@ -120,7 +123,6 @@ static int dwc3_xlnx_init_versal(struct dwc3_xlnx *priv_data)
static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
{
struct device *dev = priv_data->dev;
- struct reset_control *crst, *hibrst, *apbrst;
struct gpio_desc *reset_gpio;
int ret = 0;
@@ -132,25 +134,25 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
goto err;
}
- crst = devm_reset_control_get_exclusive(dev, "usb_crst");
- if (IS_ERR(crst)) {
- ret = PTR_ERR(crst);
+ priv_data->usb_crst = devm_reset_control_get_exclusive(dev, "usb_crst");
+ if (IS_ERR(priv_data->usb_crst)) {
+ ret = PTR_ERR(priv_data->usb_crst);
dev_err_probe(dev, ret,
"failed to get core reset signal\n");
goto err;
}
- hibrst = devm_reset_control_get_exclusive(dev, "usb_hibrst");
- if (IS_ERR(hibrst)) {
- ret = PTR_ERR(hibrst);
+ priv_data->usb_hibrst = devm_reset_control_get_exclusive(dev, "usb_hibrst");
+ if (IS_ERR(priv_data->usb_hibrst)) {
+ ret = PTR_ERR(priv_data->usb_hibrst);
dev_err_probe(dev, ret,
"failed to get hibernation reset signal\n");
goto err;
}
- apbrst = devm_reset_control_get_exclusive(dev, "usb_apbrst");
- if (IS_ERR(apbrst)) {
- ret = PTR_ERR(apbrst);
+ priv_data->usb_apbrst = devm_reset_control_get_exclusive(dev, "usb_apbrst");
+ if (IS_ERR(priv_data->usb_apbrst)) {
+ ret = PTR_ERR(priv_data->usb_apbrst);
dev_err_probe(dev, ret,
"failed to get APB reset signal\n");
goto err;
@@ -164,19 +166,19 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
* absent.
*/
if (priv_data->usb3_phy) {
- ret = reset_control_assert(crst);
+ ret = reset_control_assert(priv_data->usb_crst);
if (ret < 0) {
dev_err(dev, "Failed to assert core reset\n");
goto err;
}
- ret = reset_control_assert(hibrst);
+ ret = reset_control_assert(priv_data->usb_hibrst);
if (ret < 0) {
dev_err(dev, "Failed to assert hibernation reset\n");
goto err;
}
- ret = reset_control_assert(apbrst);
+ ret = reset_control_assert(priv_data->usb_apbrst);
if (ret < 0) {
dev_err(dev, "Failed to assert APB reset\n");
goto err;
@@ -187,7 +189,7 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
if (ret < 0)
goto err;
- ret = reset_control_deassert(apbrst);
+ ret = reset_control_deassert(priv_data->usb_apbrst);
if (ret < 0) {
dev_err(dev, "Failed to release APB reset\n");
goto err_phy_exit;
@@ -203,21 +205,21 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
writel(PIPE_CLK_DESELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK);
}
- ret = reset_control_deassert(crst);
+ ret = reset_control_deassert(priv_data->usb_crst);
if (ret < 0) {
dev_err(dev, "Failed to release core reset\n");
- goto err_phy_exit;
+ goto err_reset_assert;
}
- ret = reset_control_deassert(hibrst);
+ ret = reset_control_deassert(priv_data->usb_hibrst);
if (ret < 0) {
dev_err(dev, "Failed to release hibernation reset\n");
- goto err_phy_exit;
+ goto err_reset_assert;
}
ret = phy_power_on(priv_data->usb3_phy);
if (ret < 0)
- goto err_phy_exit;
+ goto err_reset_assert;
/* ulpi reset via gpio-modepin or gpio-framework driver */
reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
@@ -238,6 +240,21 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
err_phy_power_off:
phy_power_off(priv_data->usb3_phy);
+err_reset_assert:
+ /*
+ * Undo only the reset cycle performed above. That cycle is skipped
+ * when there is no usb3-phy. The deasserts stay unconditional so a
+ * core the bootloader left in reset still comes up, but they are
+ * deliberately not paired with an assert here: resetting a USB3
+ * configuration that is live but missing from the device tree could
+ * break it. Asserting an already asserted reset is harmless, so one
+ * block covers however far the cycle's deasserts got.
+ */
+ if (priv_data->usb3_phy) {
+ reset_control_assert(priv_data->usb_hibrst);
+ reset_control_assert(priv_data->usb_crst);
+ reset_control_assert(priv_data->usb_apbrst);
+ }
err_phy_exit:
phy_exit(priv_data->usb3_phy);
err:
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 097/703] w1: w1_therm: lock the list of slaves for the bulk read
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 096/703] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 098/703] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove Greg Kroah-Hartman
` (40 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Josef Bacik,
Krzysztof Kozlowski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <josef@toxicpanda.com>
[ Upstream commit 1e46334d38e0217f5d255dc6fd63243593052f8e ]
The callbacks of the file therm_bulk_read walk the list of the slaves of
the master, trigger_bulk_read() three times and therm_bulk_read_show()
once, without the list_mutex which protects it. In the meantime the
thread of the master may find out that a sensor has gone:
write to therm_bulk_read w1_process()
trigger_bulk_read() w1_slave_detach()
list_for_each_entry(sl, ...) w1_unref_slave()
bulk_read_slave(sl) list_del()
w1_therm_remove_slave()
kfree(sl->family_data)
kfree(sl)
SLAVE_CONVERT_TRIGGERED(sl) = 1
The walk reads, and writes to, memory which has been freed, and follows
the poisoned list pointers.
Take list_mutex around each of the four walks. No pointer to a slave is
kept from one walk to the next.
This could not be done as long as w1_unref_slave() held the mutex while
it waited, in w1_therm_remove_slave(), for these very callbacks and for
the readers of the sensor, who need the bus_mutex which
trigger_bulk_read() holds around its second walk. Now nothing is waited
for with list_mutex held, and none of the other mutexes of the subsystem
is taken under it, so it can be nested inside bus_mutex.
Fixes: 57c76221d5af ("w1_therm: adding bulk read support to trigger multiple conversion on bus")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-8-d2e6bfafb6a4@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/w1/slaves/w1_therm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 8e0e6f122b08c..f06f87bf976da 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -1509,6 +1509,7 @@ static int trigger_bulk_read(struct w1_master *dev_master)
* and compute duration of conversion for these devices
* so we can apply a strong pullup if required
*/
+ mutex_lock(&dev_master->list_mutex);
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
if (bulk_read_slave(sl)) {
int t_cur = conversion_time(sl);
@@ -1520,6 +1521,7 @@ static int trigger_bulk_read(struct w1_master *dev_master)
w1_strong_pullup));
}
}
+ mutex_unlock(&dev_master->list_mutex);
/*
* t_conv is the max conversion time required on the bus
@@ -1546,11 +1548,13 @@ static int trigger_bulk_read(struct w1_master *dev_master)
w1_write_8(dev_master, W1_CONVERT_TEMP);
/* set a flag to instruct that converT pending */
+ mutex_lock(&dev_master->list_mutex);
list_for_each_entry(sl,
&dev_master->slist, w1_slave_entry) {
if (bulk_read_slave(sl))
SLAVE_CONVERT_TRIGGERED(sl) = -1;
}
+ mutex_unlock(&dev_master->list_mutex);
if (strong_pullup) { /* some device need pullup */
sleep_rem = msleep_interruptible(t_conv);
@@ -1576,10 +1580,12 @@ static int trigger_bulk_read(struct w1_master *dev_master)
mutex_unlock(&dev_master->bus_mutex);
set_flag:
/* set a flag to register convsersion is done */
+ mutex_lock(&dev_master->list_mutex);
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
if (bulk_read_slave(sl))
SLAVE_CONVERT_TRIGGERED(sl) = 1;
}
+ mutex_unlock(&dev_master->list_mutex);
error:
return ret;
}
@@ -1944,6 +1950,7 @@ static ssize_t therm_bulk_read_show(struct device *device,
struct w1_slave *sl = NULL;
int ret = 0;
+ mutex_lock(&dev_master->list_mutex);
list_for_each_entry(sl, &dev_master->slist, w1_slave_entry) {
if (bulk_read_slave(sl)) {
if (SLAVE_CONVERT_TRIGGERED(sl) == -1) {
@@ -1956,6 +1963,7 @@ static ssize_t therm_bulk_read_show(struct device *device,
}
}
show_result:
+ mutex_unlock(&dev_master->list_mutex);
return sprintf(buf, "%d\n", ret);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 098/703] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 097/703] w1: w1_therm: lock the list of slaves for the bulk read Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 099/703] iio: humidity: hid-sensor-humidity: Use per-instance callbacks Greg Kroah-Hartman
` (39 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, stable, Philipp Zabel,
Radhey Shyam Pandey, Thinh Nguyen, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
[ Upstream commit 6c6508e742b47539224eb18cb23f7ed5d401dcb6 ]
dwc3_xlnx_init_zynqmp() leaves the controller out of reset with the PHY
powered on, but nothing undoes that if probe fails later or when the
driver is removed. The resets stay deasserted and the PHY stays on with
no driver bound.
Register the teardown with devm_add_action_or_reset() once init has
completed, so it runs on probe failure without the driver having to
track how far init progressed. The teardown only undoes the reset cycle
init performed, so it carries the same usb3-phy guard: with no PHY the
resets were never asserted, and asserting them could break a USB3
configuration that is live but missing from the device tree.
The resets have to be asserted while the clocks are still running, so
both the probe error path and remove() run the teardown explicitly
before gating the clocks rather than leaving it to devres, which would
otherwise run it afterwards. devm_release_action() unlinks the action
before calling it, so devres cannot run it a second time.
Running it from remove() also covers .shutdown, which shares
dwc3_xlnx_remove(): device_shutdown() does not call
devres_release_all(), so a teardown left to devres would never run
there.
Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms")
Cc: stable <stable@kernel.org>
Suggested-by: Philipp Zabel <p.zabel@pengutronix.de>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20260928120015.3152461-4-radhey.shyam.pandey@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/dwc3/dwc3-xilinx.c | 44 +++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index 7e25ccd42be4f..05fc5d3ab8899 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -120,6 +120,39 @@ static int dwc3_xlnx_init_versal(struct dwc3_xlnx *priv_data)
return 0;
}
+static void dwc3_xlnx_zynqmp_teardown(void *data)
+{
+ struct dwc3_xlnx *priv_data = data;
+
+ phy_power_off(priv_data->usb3_phy);
+
+ /*
+ * Undo only the reset cycle init performed. As on the init error
+ * path, the unconditional deasserts are not paired with an assert
+ * here: with no usb3-phy, resetting the core could break a USB3
+ * configuration that is live but missing from the device tree.
+ */
+ if (priv_data->usb3_phy) {
+ reset_control_assert(priv_data->usb_hibrst);
+ reset_control_assert(priv_data->usb_crst);
+ reset_control_assert(priv_data->usb_apbrst);
+ }
+
+ phy_exit(priv_data->usb3_phy);
+}
+
+/*
+ * Run the platform teardown explicitly, so the resets are asserted while the
+ * clocks are still running. devm_release_action() unlinks the action before
+ * calling it, so devres will not run it a second time.
+ */
+static void dwc3_xlnx_release_teardown(struct device *dev,
+ struct dwc3_xlnx *priv_data)
+{
+ if (devm_is_action_added(dev, dwc3_xlnx_zynqmp_teardown, priv_data))
+ devm_release_action(dev, dwc3_xlnx_zynqmp_teardown, priv_data);
+}
+
static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
{
struct device *dev = priv_data->dev;
@@ -236,7 +269,8 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
dwc3_xlnx_set_coherency(priv_data, XLNX_USB_TRAFFIC_ROUTE_CONFIG);
- return 0;
+ return devm_add_action_or_reset(dev, dwc3_xlnx_zynqmp_teardown,
+ priv_data);
err_phy_power_off:
phy_power_off(priv_data->usb3_phy);
@@ -363,6 +397,7 @@ static int dwc3_xlnx_probe(struct platform_device *pdev)
pm_runtime_set_suspended(dev);
err_clk_put:
+ dwc3_xlnx_release_teardown(dev, priv_data);
clk_bulk_disable_unprepare(priv_data->num_clocks, priv_data->clks);
return ret;
@@ -375,6 +410,13 @@ static void dwc3_xlnx_remove(struct platform_device *pdev)
of_platform_depopulate(dev);
+ /*
+ * This is also what makes .shutdown behave the same as .remove:
+ * device_shutdown() does not call devres_release_all(), so a teardown
+ * left to devres would never run on the shutdown path.
+ */
+ dwc3_xlnx_release_teardown(dev, priv_data);
+
clk_bulk_disable_unprepare(priv_data->num_clocks, priv_data->clks);
priv_data->num_clocks = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 099/703] iio: humidity: hid-sensor-humidity: Use per-instance callbacks
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 098/703] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 100/703] iio: proximity: Remove redundant dev_err()/dev_err_probe() Greg Kroah-Hartman
` (38 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christopher Hoover, Joshua Crofts,
Srinivas Pandruvada, Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christopher Hoover <ch@murgatroid.com>
[ Upstream commit bbe4f3f668babc9443fc1f075695e43e17ca7976 ]
hid-sensor-humidity keeps a single static struct
hid_sensor_hub_callbacks for all instances and overwrites its pdev in
every probe, so with two humidity sensors, input reports for one are
delivered with the other's platform device, and a NULL dereference
follows once that device is removed. The same bug was found in
hid-sensor-temperature, which shares this code.
Keep the callbacks in struct hid_humidity_state, as the other HID
sensor drivers (accel, gyro, als, ...) do.
Fixes: d7ed89d5aadf ("iio: hid: Add humidity sensor support")
Cc: stable@vger.kernel.org
Signed-off-by: Christopher Hoover <ch@murgatroid.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
[ sashal: Context lines differed only in whitespace and offset, so the hunk was adjusted to match the existing continuation-line indentation; the change itself is otherwise identical to upstream. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/humidity/hid-sensor-humidity.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humidity/hid-sensor-humidity.c
index be2338d5f4070..1286e6f5dba3f 100644
--- a/drivers/iio/humidity/hid-sensor-humidity.c
+++ b/drivers/iio/humidity/hid-sensor-humidity.c
@@ -16,6 +16,7 @@
struct hid_humidity_state {
struct hid_sensor_common common_attributes;
struct hid_sensor_hub_attribute_info humidity_attr;
+ struct hid_sensor_hub_callbacks callbacks;
struct {
s32 humidity_data;
aligned_s64 timestamp;
@@ -184,11 +185,6 @@ static int humidity_parse_report(struct platform_device *pdev,
return ret;
}
-static struct hid_sensor_hub_callbacks humidity_callbacks = {
- .send_event = &humidity_proc_event,
- .capture_sample = &humidity_capture_sample,
-};
-
/* Function to initialize the processing for usage id */
static int hid_humidity_probe(struct platform_device *pdev)
{
@@ -240,9 +236,13 @@ static int hid_humidity_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, indio_dev);
- humidity_callbacks.pdev = pdev;
+ humid_st->callbacks = (struct hid_sensor_hub_callbacks) {
+ .send_event = humidity_proc_event,
+ .capture_sample = humidity_capture_sample,
+ .pdev = pdev,
+ };
ret = sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY,
- &humidity_callbacks);
+ &humid_st->callbacks);
if (ret)
goto error_remove_trigger;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 100/703] iio: proximity: Remove redundant dev_err()/dev_err_probe()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (98 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 099/703] iio: humidity: hid-sensor-humidity: Use per-instance callbacks Greg Kroah-Hartman
@ 2026-12-04 9:59 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 101/703] iio: proximity: hx9023s: Allocate trigger before requesting IRQ Greg Kroah-Hartman
` (37 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 9:59 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pan Chuang, Andy Shevchenko,
Joshua Crofts, Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pan Chuang <panchuang@vivo.com>
[ Upstream commit 7963090626a5de900d2404e451234ea098012ba2 ]
Since commit
55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"),
devm_request_irq() and devm_request_threaded_irq() automatically log
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() and dev_err_probe() calls.
Standardize error check on if (ret) rather than if (ret < 0)
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Stable-dep-of: bfa3b177d839 ("iio: proximity: hx9023s: Allocate trigger before requesting IRQ")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/proximity/as3935.c | 4 +---
drivers/iio/proximity/d3323aa.c | 2 +-
drivers/iio/proximity/hx9023s.c | 2 +-
drivers/iio/proximity/irsd200.c | 2 +-
drivers/iio/proximity/mb1232.c | 4 +---
drivers/iio/proximity/srf04.c | 4 +---
drivers/iio/proximity/sx_common.c | 2 +-
drivers/iio/proximity/vcnl3020.c | 6 +-----
drivers/iio/proximity/vl53l0x-i2c.c | 4 +---
9 files changed, 9 insertions(+), 21 deletions(-)
diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
index f1018b14aecfd..e063bd99af8f3 100644
--- a/drivers/iio/proximity/as3935.c
+++ b/drivers/iio/proximity/as3935.c
@@ -429,10 +429,8 @@ static int as3935_probe(struct spi_device *spi)
dev_name(dev),
indio_dev);
- if (ret) {
- dev_err(dev, "unable to request irq\n");
+ if (ret)
return ret;
- }
ret = devm_iio_device_register(dev, indio_dev);
if (ret < 0) {
diff --git a/drivers/iio/proximity/d3323aa.c b/drivers/iio/proximity/d3323aa.c
index 30821f5834547..7ac230b342ffd 100644
--- a/drivers/iio/proximity/d3323aa.c
+++ b/drivers/iio/proximity/d3323aa.c
@@ -772,7 +772,7 @@ static int d3323aa_probe(struct platform_device *pdev)
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
dev_name(dev), indio_dev);
if (ret)
- return dev_err_probe(dev, ret, "Could not request IRQ\n");
+ return ret;
ret = d3323aa_setup(indio_dev, D3323AA_LP_FILTER_FREQ_DEFAULT_IDX,
D3323AA_FILTER_GAIN_DEFAULT_IDX,
diff --git a/drivers/iio/proximity/hx9023s.c b/drivers/iio/proximity/hx9023s.c
index 17e00ee2b6f84..8488b9a751f2c 100644
--- a/drivers/iio/proximity/hx9023s.c
+++ b/drivers/iio/proximity/hx9023s.c
@@ -1137,7 +1137,7 @@ static int hx9023s_probe(struct i2c_client *client)
IRQF_ONESHOT,
"hx9023s_event", indio_dev);
if (ret)
- return dev_err_probe(dev, ret, "irq request failed\n");
+ return ret;
data->trig = devm_iio_trigger_alloc(dev, "%s-dev%d",
indio_dev->name,
diff --git a/drivers/iio/proximity/irsd200.c b/drivers/iio/proximity/irsd200.c
index 65af31d434531..b3db7f3a49f6d 100644
--- a/drivers/iio/proximity/irsd200.c
+++ b/drivers/iio/proximity/irsd200.c
@@ -910,7 +910,7 @@ static int irsd200_probe(struct i2c_client *client)
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
NULL, indio_dev);
if (ret)
- return dev_err_probe(data->dev, ret, "Could not request irq\n");
+ return ret;
trigger = devm_iio_trigger_alloc(data->dev, "%s-dev%d", indio_dev->name,
iio_device_id(indio_dev));
diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c
index 34b49c54e68b0..c4fc840e11fb5 100644
--- a/drivers/iio/proximity/mb1232.c
+++ b/drivers/iio/proximity/mb1232.c
@@ -214,10 +214,8 @@ static int mb1232_probe(struct i2c_client *client)
if (data->irqnr > 0) {
ret = devm_request_irq(dev, data->irqnr, mb1232_handle_irq,
IRQF_TRIGGER_FALLING, id->name, indio_dev);
- if (ret < 0) {
- dev_err(dev, "request_irq: %d\n", ret);
+ if (ret)
return ret;
- }
}
ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
diff --git a/drivers/iio/proximity/srf04.c b/drivers/iio/proximity/srf04.c
index 337938657449d..884f8578d7fe0 100644
--- a/drivers/iio/proximity/srf04.c
+++ b/drivers/iio/proximity/srf04.c
@@ -304,10 +304,8 @@ static int srf04_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, data->irqnr, srf04_handle_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
pdev->name, indio_dev);
- if (ret < 0) {
- dev_err(data->dev, "request_irq: %d\n", ret);
+ if (ret)
return ret;
- }
platform_set_drvdata(pdev, indio_dev);
diff --git a/drivers/iio/proximity/sx_common.c b/drivers/iio/proximity/sx_common.c
index 59b35e40739b0..4d4937395d9a5 100644
--- a/drivers/iio/proximity/sx_common.c
+++ b/drivers/iio/proximity/sx_common.c
@@ -517,7 +517,7 @@ int sx_common_probe(struct i2c_client *client,
IRQF_ONESHOT,
"sx_event", indio_dev);
if (ret)
- return dev_err_probe(dev, ret, "No IRQ\n");
+ return ret;
data->trig = devm_iio_trigger_alloc(dev, "%s-dev%d",
indio_dev->name,
diff --git a/drivers/iio/proximity/vcnl3020.c b/drivers/iio/proximity/vcnl3020.c
index d0b8f429999f9..768870127ff87 100644
--- a/drivers/iio/proximity/vcnl3020.c
+++ b/drivers/iio/proximity/vcnl3020.c
@@ -648,12 +648,8 @@ static int vcnl3020_probe(struct i2c_client *client)
NULL, vcnl3020_handle_irq_thread,
IRQF_ONESHOT, indio_dev->name,
indio_dev);
- if (rc) {
- dev_err(&client->dev,
- "Error (%d) irq request failed (%u)\n", rc,
- client->irq);
+ if (rc)
return rc;
- }
}
return devm_iio_device_register(&client->dev, indio_dev);
diff --git a/drivers/iio/proximity/vl53l0x-i2c.c b/drivers/iio/proximity/vl53l0x-i2c.c
index 913ac191a187e..1dc18b978298d 100644
--- a/drivers/iio/proximity/vl53l0x-i2c.c
+++ b/drivers/iio/proximity/vl53l0x-i2c.c
@@ -127,10 +127,8 @@ static int vl53l0x_configure_irq(struct i2c_client *client,
ret = devm_request_threaded_irq(&client->dev, client->irq,
NULL, vl53l0x_threaded_irq,
irq_flags | IRQF_ONESHOT, indio_dev->name, indio_dev);
- if (ret) {
- dev_err(&client->dev, "devm_request_irq error: %d\n", ret);
+ if (ret)
return ret;
- }
ret = i2c_smbus_write_byte_data(data->client,
VL_REG_SYSTEM_INTERRUPT_CONFIG_GPIO,
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 101/703] iio: proximity: hx9023s: Allocate trigger before requesting IRQ
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (99 preceding siblings ...)
2026-12-04 9:59 ` [PATCH 6.18 100/703] iio: proximity: Remove redundant dev_err()/dev_err_probe() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 102/703] ipvs: read flags and seqs in master atomically Greg Kroah-Hartman
` (36 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak,
Joshua Crofts, Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit bfa3b177d839bb303d0187335115b572a2644920 ]
An IRQ handler that already read trigger_enabled can poll data->trig
after buffer disable. Detaching the virtual IRQ does not join this
physical IRQ, and trigger deselection can drop the consumer reference.
Devres may then free the trigger before joining the handler.
Allocate the trigger before requesting the IRQ so devres joins the
handler before dropping the allocation reference.
This issue was identified as part of our ongoing research while
reviewing kernel code.
Fixes: 60df548277b7 ("iio: proximity: Add driver support for TYHX's HX9023S capacitive proximity sensor")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/proximity/hx9023s.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/proximity/hx9023s.c b/drivers/iio/proximity/hx9023s.c
index 8488b9a751f2c..1fba29265bfd5 100644
--- a/drivers/iio/proximity/hx9023s.c
+++ b/drivers/iio/proximity/hx9023s.c
@@ -1131,14 +1131,6 @@ static int hx9023s_probe(struct i2c_client *client)
return dev_err_probe(dev, ret, "reg config failed\n");
if (client->irq) {
- ret = devm_request_threaded_irq(dev, client->irq,
- hx9023s_irq_handler,
- hx9023s_irq_thread_handler,
- IRQF_ONESHOT,
- "hx9023s_event", indio_dev);
- if (ret)
- return ret;
-
data->trig = devm_iio_trigger_alloc(dev, "%s-dev%d",
indio_dev->name,
iio_device_id(indio_dev));
@@ -1148,6 +1140,14 @@ static int hx9023s_probe(struct i2c_client *client)
data->trig->ops = &hx9023s_trigger_ops;
iio_trigger_set_drvdata(data->trig, indio_dev);
+ ret = devm_request_threaded_irq(dev, client->irq,
+ hx9023s_irq_handler,
+ hx9023s_irq_thread_handler,
+ IRQF_ONESHOT,
+ "hx9023s_event", indio_dev);
+ if (ret)
+ return ret;
+
ret = devm_iio_trigger_register(dev, data->trig);
if (ret)
return dev_err_probe(dev, ret,
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 102/703] ipvs: read flags and seqs in master atomically
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (100 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 101/703] iio: proximity: hx9023s: Allocate trigger before requesting IRQ Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 103/703] ipvs: honor the overload state and do not enter it forever Greg Kroah-Hartman
` (35 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Julian Anastasov, Pablo Neira Ayuso,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Anastasov <ja@ssi.bg>
[ Upstream commit aa9afc79f57ba5ef4385aa85cfb7dd50d5c484f6 ]
After we fixed the double read of cp->flags in the master with
commit 3e3fe49e8678 ("ipvs: fix buffer overflow when sending sync messages")
Sashiko reports that we should also read the cp->flags and the seqs
atomically. So if the SEQ_MASK is set, re-read the flags and the
seqs under cp->lock to provide a snapshot when sending the sync
message.
Fixes: 3e3fe49e8678 ("ipvs: fix buffer overflow when sending sync messages")
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260927220816.268206-1-pablo%40netfilter.org
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/ipvs/ip_vs_sync.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 0036008fee65f..2f18c2b0b3e85 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -540,6 +540,7 @@ static int ip_vs_sync_conn_needed(struct netns_ipvs *ipvs,
static void ip_vs_sync_conn_v0(struct netns_ipvs *ipvs, struct ip_vs_conn *cp,
int pkts)
{
+ struct ip_vs_sync_conn_options opts;
struct ip_vs_sync_mesg_v0 *m;
struct ip_vs_sync_conn_v0 *s;
struct ip_vs_sync_buff *buff;
@@ -558,6 +559,14 @@ static void ip_vs_sync_conn_v0(struct netns_ipvs *ipvs, struct ip_vs_conn *cp,
if (!ip_vs_sync_conn_needed(ipvs, cp, pkts))
return;
+ if (flags & IP_VS_CONN_F_SEQ_MASK) {
+ /* Take atomic snapshot of flags and seqs */
+ spin_lock_bh(&cp->lock);
+ flags = cp->flags;
+ memcpy(&opts, &cp->sync_conn_opt, sizeof(opts));
+ spin_unlock_bh(&cp->lock);
+ }
+
spin_lock_bh(&ipvs->sync_buff_lock);
if (!(ipvs->sync_state & IP_VS_STATE_MASTER)) {
spin_unlock_bh(&ipvs->sync_buff_lock);
@@ -605,7 +614,7 @@ static void ip_vs_sync_conn_v0(struct netns_ipvs *ipvs, struct ip_vs_conn *cp,
if (seq_mask) {
struct ip_vs_sync_conn_options *opt =
(struct ip_vs_sync_conn_options *)&s[1];
- memcpy(opt, &cp->sync_conn_opt, sizeof(*opt));
+ memcpy(opt, &opts, sizeof(*opt));
}
m->nr_conns++;
@@ -631,6 +640,7 @@ static void ip_vs_sync_conn_v0(struct netns_ipvs *ipvs, struct ip_vs_conn *cp,
*/
void ip_vs_sync_conn(struct netns_ipvs *ipvs, struct ip_vs_conn *cp, int pkts)
{
+ struct ip_vs_sync_conn_options opts;
struct ip_vs_sync_mesg *m;
union ip_vs_sync_conn *s;
struct ip_vs_sync_buff *buff;
@@ -652,6 +662,13 @@ void ip_vs_sync_conn(struct netns_ipvs *ipvs, struct ip_vs_conn *cp, int pkts)
if (!ip_vs_sync_conn_needed(ipvs, cp, pkts))
goto control;
flags = READ_ONCE(cp->flags);
+ if (flags & IP_VS_CONN_F_SEQ_MASK) {
+ /* Take atomic snapshot of flags and seqs */
+ spin_lock_bh(&cp->lock);
+ flags = cp->flags;
+ memcpy(&opts, &cp->sync_conn_opt, sizeof(opts));
+ spin_unlock_bh(&cp->lock);
+ }
/* Sanity checks */
pe_name_len = 0;
@@ -753,9 +770,9 @@ void ip_vs_sync_conn(struct netns_ipvs *ipvs, struct ip_vs_conn *cp, int pkts)
if (seq_mask) {
*(p++) = IPVS_OPT_SEQ_DATA;
*(p++) = sizeof(struct ip_vs_sync_conn_options);
- hton_seq(&cp->in_seq, (struct ip_vs_seq *)p);
+ hton_seq(&opts.in_seq, (struct ip_vs_seq *)p);
p += sizeof(struct ip_vs_seq);
- hton_seq(&cp->out_seq, (struct ip_vs_seq *)p);
+ hton_seq(&opts.out_seq, (struct ip_vs_seq *)p);
p += sizeof(struct ip_vs_seq);
}
/* Handle pe data */
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 103/703] ipvs: honor the overload state and do not enter it forever
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (101 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 102/703] ipvs: read flags and seqs in master atomically Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 104/703] drm/ast: Handle framebuffer from dma-buf Greg Kroah-Hartman
` (34 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Julian Anastasov, Pablo Neira Ayuso,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Anastasov <ja@ssi.bg>
[ Upstream commit 567ca80d77baf4c9ab635865375956084c8bb52a ]
Sashiko warns that we may enter the dest overload state forever
if setting the u_threshold to 1 races with the ip_vs_unbind_dest()
call for the last connection for dest. The problem is that we
prefer ip_vs_unbind_dest() to avoid using locks while reading the
threshold.
To avoid the race, add a smp_mb() in __ip_vs_dest_update_overload()
that is paired with the atomic_fetch_dec() in ip_vs_unbind_dest()
which allows to re-read the totalconns and to leave the overload
state if we are below l_threshold_val.
Also, remove the overload parameter from ip_vs_dest_update_overload()
because we just need to know the current state while deciding
which threshold ranges to use. This ip_vs_dest_is_overloaded() check
can be in __ip_vs_dest_update_overload() instead.
To avoid ip_vs_bind_dest() to enter lock just to initialize
u_threshold_val to INT_MAX, do it in ip_vs_new_dest().
The LBLC and LBLCR schedulers do not honor the global overload state
for cached dests, so add a ip_vs_dest_is_overloaded() check for
the situations where we may fallback from overloaded dest (LBLC and
LBLCR) or when we hit a cached dest (LBLC).
Also, move the ip_vs_dest_set_min() call in LBLCR after the
ip_vs_dest_set_erase() call that removes the most-loaded
server because due to races we may work with dest that is
in process of removing, i.e. ip_vs_dest_set_min() and
ip_vs_dest_set_max() may return same dest.
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261019150249.1879516-2-pablo%40netfilter.org
Fixes: 3ba20137287f ("ipvs: fix more races around the overload flag")
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/ip_vs.h | 2 +-
net/netfilter/ipvs/ip_vs_conn.c | 4 ++--
net/netfilter/ipvs/ip_vs_ctl.c | 30 ++++++++++++++++++------------
net/netfilter/ipvs/ip_vs_lblc.c | 8 +++++---
net/netfilter/ipvs/ip_vs_lblcr.c | 13 +++++++------
5 files changed, 33 insertions(+), 24 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 7b887e72bc9f9..03279a0b1c1a8 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -1596,7 +1596,7 @@ static inline void ip_vs_dest_put_and_free(struct ip_vs_dest *dest)
kfree(dest);
}
-void ip_vs_dest_update_overload(struct ip_vs_dest *dest, bool overload);
+void ip_vs_dest_update_overload(struct ip_vs_dest *dest);
/* Check if dest is in overloaded state */
static inline bool ip_vs_dest_is_overloaded(const struct ip_vs_dest *dest)
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index b9d83b4d870a0..1985c90c3aef6 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -634,7 +634,7 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
atomic_inc(&dest->activeconns);
tc = atomic_inc_return(&dest->totalconns);
if (tc >= READ_ONCE(dest->u_threshold_val))
- ip_vs_dest_update_overload(dest, true);
+ ip_vs_dest_update_overload(dest);
} else {
/* It is a persistent connection/template, so increase
the persistent connection counter */
@@ -727,7 +727,7 @@ static inline void ip_vs_unbind_dest(struct ip_vs_conn *cp)
atomic_dec(&dest->activeconns);
tc = atomic_fetch_dec(&dest->totalconns);
if (tc <= READ_ONCE(dest->l_threshold_val))
- ip_vs_dest_update_overload(dest, false);
+ ip_vs_dest_update_overload(dest);
} else {
/* It is a persistent connection/template, so decrease
the persistent connection counter */
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 0afb2ebefcabb..5bf70b991cbae 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -960,12 +960,12 @@ void ip_vs_stats_free(struct ip_vs_stats *stats)
}
}
-/* Update overload flag based on number of dest conns and lower/upper
+/* Update overload state based on number of dest conns and lower/upper
* connection thresholds:
- * - conns reach u_threshold and exceed it: set the flag
- * - conns go below l_threshold (or 75% of u_threshold): clear the flag
+ * - conns reach u_threshold and exceed it: set the overload state
+ * - conns go below l_threshold (or 75% of u_threshold): clear the state
*/
-static void __ip_vs_dest_update_overload(struct ip_vs_dest *dest, bool overload)
+static void __ip_vs_dest_update_overload(struct ip_vs_dest *dest)
{
int conns;
u32 l, u;
@@ -976,10 +976,18 @@ static void __ip_vs_dest_update_overload(struct ip_vs_dest *dest, bool overload)
/* Low threshold defaults to 75% of upper threshold */
l = READ_ONCE(dest->l_threshold) ? : (u - (u >> 2));
conns = atomic_read(&dest->totalconns);
- if (conns >= (overload ? l : u)) {
+ if (conns >= (ip_vs_dest_is_overloaded(dest) ? l : u)) {
WRITE_ONCE(dest->u_threshold_val, INT_MAX);
WRITE_ONCE(dest->l_threshold_val, l);
- return;
+ /* Commit thresholds before repeating the check,
+ * it is paired with atomic_fetch_dec() in
+ * ip_vs_unbind_dest() to avoid entering the
+ * overload state forever.
+ */
+ smp_mb();
+ conns = atomic_read(&dest->totalconns);
+ if (conns >= l)
+ return;
}
}
@@ -987,10 +995,10 @@ static void __ip_vs_dest_update_overload(struct ip_vs_dest *dest, bool overload)
WRITE_ONCE(dest->l_threshold_val, 0);
}
-void ip_vs_dest_update_overload(struct ip_vs_dest *dest, bool overload)
+void ip_vs_dest_update_overload(struct ip_vs_dest *dest)
{
spin_lock_bh(&dest->dst_lock);
- __ip_vs_dest_update_overload(dest, overload);
+ __ip_vs_dest_update_overload(dest);
spin_unlock_bh(&dest->dst_lock);
}
@@ -1062,13 +1070,10 @@ __ip_vs_update_dest(struct ip_vs_service *svc, struct ip_vs_dest *dest,
if (READ_ONCE(dest->u_threshold) != udest->u_threshold ||
READ_ONCE(dest->l_threshold) != udest->l_threshold) {
- bool overload;
-
spin_lock_bh(&dest->dst_lock);
WRITE_ONCE(dest->u_threshold, udest->u_threshold);
WRITE_ONCE(dest->l_threshold, udest->l_threshold);
- overload = ip_vs_dest_is_overloaded(dest);
- __ip_vs_dest_update_overload(dest, overload);
+ __ip_vs_dest_update_overload(dest);
spin_unlock_bh(&dest->dst_lock);
}
@@ -1133,6 +1138,7 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest)
if (ret < 0)
goto err_stats;
+ dest->u_threshold_val = INT_MAX;
dest->af = udest->af;
dest->protocol = svc->protocol;
dest->vaddr = svc->addr;
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index ecbb2960e1f96..6eb3afe88ec1e 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -468,10 +468,11 @@ is_overloaded(struct ip_vs_dest *dest, struct ip_vs_service *svc)
struct ip_vs_dest *d;
list_for_each_entry_rcu(d, &svc->destinations, n_list) {
- if (atomic_read(&d->activeconns)*2
- < atomic_read(&d->weight)) {
+ if (ip_vs_dest_is_overloaded(d))
+ continue;
+ if (atomic_read(&d->activeconns) * 2 <
+ atomic_read(&d->weight))
return 1;
- }
}
}
return 0;
@@ -508,6 +509,7 @@ ip_vs_lblc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb,
dest = en->dest;
if ((dest->cflags & IP_VS_DEST_CF_AVAILABLE) &&
+ !ip_vs_dest_is_overloaded(dest) &&
atomic_read(&dest->weight) > 0 && !is_overloaded(dest, svc))
goto out;
}
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index 0639c8510a15a..bdee6e072be71 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -631,10 +631,11 @@ is_overloaded(struct ip_vs_dest *dest, struct ip_vs_service *svc)
struct ip_vs_dest *d;
list_for_each_entry_rcu(d, &svc->destinations, n_list) {
- if (atomic_read(&d->activeconns)*2
- < atomic_read(&d->weight)) {
+ if (ip_vs_dest_is_overloaded(d))
+ continue;
+ if (atomic_read(&d->activeconns) * 2 <
+ atomic_read(&d->weight))
return 1;
- }
}
}
return 0;
@@ -659,9 +660,6 @@ ip_vs_lblcr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb,
if (en) {
en->lastuse = jiffies;
- /* Get the least loaded destination */
- dest = ip_vs_dest_set_min(&en->set);
-
/* More than one destination + enough time passed by, cleanup */
if (atomic_read(&en->set.size) > 1 &&
time_after(jiffies, en->set.lastmod +
@@ -677,6 +675,9 @@ ip_vs_lblcr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb,
spin_unlock_bh(&svc->sched_lock);
}
+ /* Get the least loaded destination */
+ dest = ip_vs_dest_set_min(&en->set);
+
/* If the destination is not overloaded, use it */
if (dest && !is_overloaded(dest, svc))
goto out;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 104/703] drm/ast: Handle framebuffer from dma-buf
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (102 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 103/703] ipvs: honor the overload state and do not enter it forever Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 105/703] iio: common: fix spelling mistakes in comments Greg Kroah-Hartman
` (33 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Zimmermann, Jocelyn Falempe,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jocelyn Falempe <jfalempe@redhat.com>
[ Upstream commit 3dd0be7a301bb0adcca4f7021cfd2e366ca90a0e ]
In the atomic update callback, ast should call
drm_gem_fb_begin_cpu_access() to make sure it can read the
framebuffer from the CPU, otherwise the data might not be there due
to cache, and synchronization.
Tested on a Lenovo SE100, while rendering on the ArrowLake GPU with
i915 driver, and using ast for display.
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20251030091627.340780-1-jfalempe@redhat.com
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/ast/ast_mode.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 30b011ed0a056..0eb6644637b85 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -572,9 +572,14 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
ast_set_vbios_color_reg(ast, fb->format, ast_crtc_state->vmode);
}
- drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state);
- drm_atomic_for_each_plane_damage(&iter, &damage) {
- ast_handle_damage(ast_plane, shadow_plane_state->data, fb, &damage);
+ /* if the buffer comes from another device */
+ if (drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE) == 0) {
+ drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state);
+ drm_atomic_for_each_plane_damage(&iter, &damage) {
+ ast_handle_damage(ast_plane, shadow_plane_state->data, fb, &damage);
+ }
+
+ drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
}
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 105/703] iio: common: fix spelling mistakes in comments
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (103 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 104/703] drm/ast: Handle framebuffer from dma-buf Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 106/703] iio: inv_sensors: convert to kernel types Greg Kroah-Hartman
` (32 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shi Hao, Jonathan Cameron,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shi Hao <i.shihao.999@gmail.com>
[ Upstream commit 96f46405219d9bf62d9fab76e055e3b6059b0bd5 ]
Fix spelling mistakes in comments.
- exepects -> expects
- fuction -> function
- theoritical -> theoretical
- appopriate -> appropriate
- iio -> IIO
Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Stable-dep-of: 3785dffc7c68 ("iio: inv_sensors: prevent timestamps going back in time in transitions")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 +-
drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 2 +-
drivers/iio/common/inv_sensors/inv_sensors_timestamp.c | 4 ++--
drivers/iio/common/ms_sensors/ms_sensors_i2c.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
index 82cef4a124427..f34e2bbba2d1e 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
@@ -106,7 +106,7 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev,
switch (st->core.type) {
case MOTIONSENSE_TYPE_ACCEL:
/*
- * EC returns data in g, iio exepects m/s^2.
+ * EC returns data in g, IIO expects m/s^2.
* Do not use IIO_G_TO_M_S_2 to avoid precision loss.
*/
*val = div_s64(val64 * 980665, 10);
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index 2e3f3f41fdaaa..3fd661b1f42f6 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -356,7 +356,7 @@ int hid_sensor_write_raw_hyst_rel_value(struct hid_sensor_common *st,
EXPORT_SYMBOL_NS(hid_sensor_write_raw_hyst_rel_value, "IIO_HID");
/*
- * This fuction applies the unit exponent to the scale.
+ * This function applies the unit exponent to the scale.
* For example:
* 9.806650000 ->exp:2-> val0[980]val1[665000000]
* 9.000806000 ->exp:2-> val0[900]val1[80600000]
diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
index 97526ba87b934..e0b10366ed2bf 100644
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -154,7 +154,7 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
valid = inv_update_chip_period(ts, period);
}
- /* no previous data, compute theoritical value from interrupt */
+ /* no previous data, compute theoretical value from interrupt */
if (ts->timestamp == 0) {
/* elapsed time: sensor period * sensor samples number */
interval = (int64_t)ts->period * (int64_t)sample_nb;
@@ -185,7 +185,7 @@ void inv_sensors_timestamp_apply_odr(struct inv_sensors_timestamp *ts,
/*
* After ODR change the time interval with the previous sample is
- * undertermined (depends when the change occures). So we compute the
+ * undertermined (depends when the change occurs). So we compute the
* timestamp from the current interrupt using the new FIFO period, the
* total number of samples and the current sample numero.
*/
diff --git a/drivers/iio/common/ms_sensors/ms_sensors_i2c.c b/drivers/iio/common/ms_sensors/ms_sensors_i2c.c
index 5884708636818..1960a2ce82a8b 100644
--- a/drivers/iio/common/ms_sensors/ms_sensors_i2c.c
+++ b/drivers/iio/common/ms_sensors/ms_sensors_i2c.c
@@ -96,7 +96,7 @@ EXPORT_SYMBOL_NS(ms_sensors_read_prom_word, "IIO_MEAS_SPEC_SENSORS");
*
* Generic ADC conversion & read function for Measurement Specialties
* devices.
- * The function will issue conversion command, sleep appopriate delay, and
+ * The function will issue conversion command, sleep appropriate delay, and
* issue command to read ADC.
*
* Return: 0 on success, negative errno otherwise.
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 106/703] iio: inv_sensors: convert to kernel types
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (104 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 105/703] iio: common: fix spelling mistakes in comments Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 107/703] iio: inv_sensors: better timestamp alignment when using watermark Greg Kroah-Hartman
` (31 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andy Shevchenko,
Jean-Baptiste Maneyrol, Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
[ Upstream commit 1330597c7480611334977ff66878fd40b411fa41 ]
Convert standard types (u)intXX_t to kernel type u/sXX.
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Stable-dep-of: 3785dffc7c68 ("iio: inv_sensors: prevent timestamps going back in time in transitions")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../inv_sensors/inv_sensors_timestamp.c | 48 +++++++++----------
.../linux/iio/common/inv_sensors_timestamp.h | 34 ++++++-------
2 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
index e0b10366ed2bf..ecfd54ffe7e92 100644
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -19,9 +19,9 @@
(((_val) * (1000 + (_jitter))) / 1000)
/* Add a new value inside an accumulator and update the estimate value */
-static void inv_update_acc(struct inv_sensors_timestamp_acc *acc, uint32_t val)
+static void inv_update_acc(struct inv_sensors_timestamp_acc *acc, u32 val)
{
- uint64_t sum = 0;
+ u64 sum = 0;
size_t i;
acc->values[acc->idx++] = val;
@@ -58,9 +58,9 @@ void inv_sensors_timestamp_init(struct inv_sensors_timestamp *ts,
EXPORT_SYMBOL_NS_GPL(inv_sensors_timestamp_init, "IIO_INV_SENSORS_TIMESTAMP");
int inv_sensors_timestamp_update_odr(struct inv_sensors_timestamp *ts,
- uint32_t period, bool fifo)
+ u32 period, bool fifo)
{
- uint32_t mult;
+ u32 mult;
/* when FIFO is on, prevent odr change if one is already pending */
if (fifo && ts->new_mult != 0)
@@ -78,9 +78,9 @@ int inv_sensors_timestamp_update_odr(struct inv_sensors_timestamp *ts,
}
EXPORT_SYMBOL_NS_GPL(inv_sensors_timestamp_update_odr, "IIO_INV_SENSORS_TIMESTAMP");
-static bool inv_validate_period(struct inv_sensors_timestamp *ts, uint32_t period)
+static bool inv_validate_period(struct inv_sensors_timestamp *ts, u32 period)
{
- uint32_t period_min, period_max;
+ u32 period_min, period_max;
/* check that period is acceptable */
period_min = ts->min_period * ts->mult;
@@ -92,9 +92,9 @@ static bool inv_validate_period(struct inv_sensors_timestamp *ts, uint32_t perio
}
static bool inv_update_chip_period(struct inv_sensors_timestamp *ts,
- uint32_t period)
+ u32 period)
{
- uint32_t new_chip_period;
+ u32 new_chip_period;
if (!inv_validate_period(ts, period))
return false;
@@ -109,19 +109,19 @@ static bool inv_update_chip_period(struct inv_sensors_timestamp *ts,
static void inv_align_timestamp_it(struct inv_sensors_timestamp *ts)
{
- const int64_t period_min = (int64_t)ts->min_period * ts->mult;
- const int64_t period_max = (int64_t)ts->max_period * ts->mult;
- int64_t add_max, sub_max;
- int64_t delta, jitter;
- int64_t adjust;
+ const s64 period_min = (s64)ts->min_period * ts->mult;
+ const s64 period_max = (s64)ts->max_period * ts->mult;
+ s64 add_max, sub_max;
+ s64 delta, jitter;
+ s64 adjust;
/* delta time between last sample and last interrupt */
delta = ts->it.lo - ts->timestamp;
/* adjust timestamp while respecting jitter */
- add_max = period_max - (int64_t)ts->period;
- sub_max = period_min - (int64_t)ts->period;
- jitter = INV_SENSORS_TIMESTAMP_JITTER((int64_t)ts->period, ts->chip.jitter);
+ add_max = period_max - (s64)ts->period;
+ sub_max = period_min - (s64)ts->period;
+ jitter = INV_SENSORS_TIMESTAMP_JITTER((s64)ts->period, ts->chip.jitter);
if (delta > jitter)
adjust = add_max;
else if (delta < -jitter)
@@ -133,11 +133,11 @@ static void inv_align_timestamp_it(struct inv_sensors_timestamp *ts)
}
void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
- size_t sample_nb, int64_t timestamp)
+ size_t sample_nb, s64 timestamp)
{
struct inv_sensors_timestamp_interval *it;
- int64_t delta, interval;
- uint32_t period;
+ s64 delta, interval;
+ u32 period;
bool valid = false;
if (sample_nb == 0)
@@ -157,7 +157,7 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
/* no previous data, compute theoretical value from interrupt */
if (ts->timestamp == 0) {
/* elapsed time: sensor period * sensor samples number */
- interval = (int64_t)ts->period * (int64_t)sample_nb;
+ interval = (s64)ts->period * (s64)sample_nb;
ts->timestamp = it->up - interval;
return;
}
@@ -169,11 +169,11 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
EXPORT_SYMBOL_NS_GPL(inv_sensors_timestamp_interrupt, "IIO_INV_SENSORS_TIMESTAMP");
void inv_sensors_timestamp_apply_odr(struct inv_sensors_timestamp *ts,
- uint32_t fifo_period, size_t fifo_nb,
+ u32 fifo_period, size_t fifo_nb,
unsigned int fifo_no)
{
- int64_t interval;
- uint32_t fifo_mult;
+ s64 interval;
+ u32 fifo_mult;
if (ts->new_mult == 0)
return;
@@ -194,7 +194,7 @@ void inv_sensors_timestamp_apply_odr(struct inv_sensors_timestamp *ts,
fifo_mult = fifo_period / ts->chip.clock_period;
fifo_period = fifo_mult * ts->chip_period.val;
/* computes time interval between interrupt and this sample */
- interval = (int64_t)(fifo_nb - fifo_no) * (int64_t)fifo_period;
+ interval = (s64)(fifo_nb - fifo_no) * (s64)fifo_period;
ts->timestamp = ts->it.up - interval;
}
}
diff --git a/include/linux/iio/common/inv_sensors_timestamp.h b/include/linux/iio/common/inv_sensors_timestamp.h
index 8d506f1e9df29..e4e720e6f4b72 100644
--- a/include/linux/iio/common/inv_sensors_timestamp.h
+++ b/include/linux/iio/common/inv_sensors_timestamp.h
@@ -13,9 +13,9 @@
* @init_period: chip initial period at reset in ns
*/
struct inv_sensors_timestamp_chip {
- uint32_t clock_period;
- uint32_t jitter;
- uint32_t init_period;
+ u32 clock_period;
+ u32 jitter;
+ u32 init_period;
};
/**
@@ -24,8 +24,8 @@ struct inv_sensors_timestamp_chip {
* @up: interval upper bound
*/
struct inv_sensors_timestamp_interval {
- int64_t lo;
- int64_t up;
+ s64 lo;
+ s64 up;
};
/**
@@ -35,9 +35,9 @@ struct inv_sensors_timestamp_interval {
* @values: table of all measured values, use for computing the mean
*/
struct inv_sensors_timestamp_acc {
- uint32_t val;
+ u32 val;
size_t idx;
- uint32_t values[32];
+ u32 values[32];
};
/**
@@ -54,13 +54,13 @@ struct inv_sensors_timestamp_acc {
*/
struct inv_sensors_timestamp {
struct inv_sensors_timestamp_chip chip;
- uint32_t min_period;
- uint32_t max_period;
+ u32 min_period;
+ u32 max_period;
struct inv_sensors_timestamp_interval it;
- int64_t timestamp;
- uint32_t mult;
- uint32_t new_mult;
- uint32_t period;
+ s64 timestamp;
+ u32 mult;
+ u32 new_mult;
+ u32 period;
struct inv_sensors_timestamp_acc chip_period;
};
@@ -68,19 +68,19 @@ void inv_sensors_timestamp_init(struct inv_sensors_timestamp *ts,
const struct inv_sensors_timestamp_chip *chip);
int inv_sensors_timestamp_update_odr(struct inv_sensors_timestamp *ts,
- uint32_t period, bool fifo);
+ u32 period, bool fifo);
void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
- size_t sample_nb, int64_t timestamp);
+ size_t sample_nb, s64 timestamp);
-static inline int64_t inv_sensors_timestamp_pop(struct inv_sensors_timestamp *ts)
+static inline s64 inv_sensors_timestamp_pop(struct inv_sensors_timestamp *ts)
{
ts->timestamp += ts->period;
return ts->timestamp;
}
void inv_sensors_timestamp_apply_odr(struct inv_sensors_timestamp *ts,
- uint32_t fifo_period, size_t fifo_nb,
+ u32 fifo_period, size_t fifo_nb,
unsigned int fifo_no);
static inline void inv_sensors_timestamp_reset(struct inv_sensors_timestamp *ts)
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 107/703] iio: inv_sensors: better timestamp alignment when using watermark
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (105 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 106/703] iio: inv_sensors: convert to kernel types Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 108/703] iio: inv_sensors: improve period measurement by using a longer delay Greg Kroah-Hartman
` (30 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jean-Baptiste Maneyrol,
Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
[ Upstream commit 8f4b627656fa1767d8337a95849fe7c895b6f68a ]
Current interrupt timestamp alignment only changes the final timestamp.
When the watermark is in use, we have a batch of samples for each
interrupt. The current code doesn't manage to align the timestamp
because the jitter is too high.
Instead modify the estimated inter interrupt period and use that to
adjust the timestamp alignment over the batch in a linear fashion.
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Stable-dep-of: 3785dffc7c68 ("iio: inv_sensors: prevent timestamps going back in time in transitions")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../inv_sensors/inv_sensors_timestamp.c | 51 +++++++------------
1 file changed, 19 insertions(+), 32 deletions(-)
diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
index ecfd54ffe7e92..2aaaa8df6d03b 100644
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -10,9 +10,7 @@
#include <linux/iio/common/inv_sensors_timestamp.h>
-/* compute jitter, min and max following jitter in per mille */
-#define INV_SENSORS_TIMESTAMP_JITTER(_val, _jitter) \
- (div_s64((_val) * (_jitter), 1000))
+/* compute min and max following jitter in per mille */
#define INV_SENSORS_TIMESTAMP_MIN(_val, _jitter) \
(((_val) * (1000 - (_jitter))) / 1000)
#define INV_SENSORS_TIMESTAMP_MAX(_val, _jitter) \
@@ -102,34 +100,22 @@ static bool inv_update_chip_period(struct inv_sensors_timestamp *ts,
/* update chip internal period estimation */
new_chip_period = period / ts->mult;
inv_update_acc(&ts->chip_period, new_chip_period);
- ts->period = ts->mult * ts->chip_period.val;
return true;
}
-static void inv_align_timestamp_it(struct inv_sensors_timestamp *ts)
+static u32 inv_align_timestamp_it(struct inv_sensors_timestamp *ts,
+ unsigned int sample_nb)
{
const s64 period_min = (s64)ts->min_period * ts->mult;
const s64 period_max = (s64)ts->max_period * ts->mult;
- s64 add_max, sub_max;
- s64 delta, jitter;
- s64 adjust;
-
- /* delta time between last sample and last interrupt */
- delta = ts->it.lo - ts->timestamp;
-
- /* adjust timestamp while respecting jitter */
- add_max = period_max - (s64)ts->period;
- sub_max = period_min - (s64)ts->period;
- jitter = INV_SENSORS_TIMESTAMP_JITTER((s64)ts->period, ts->chip.jitter);
- if (delta > jitter)
- adjust = add_max;
- else if (delta < -jitter)
- adjust = sub_max;
- else
- adjust = 0;
+ s64 new_period;
+
+ /* compute new period aligning last timestamp with interrupt timestamp */
+ new_period = div_s64(ts->it.up - ts->timestamp, sample_nb);
- ts->timestamp += adjust;
+ /* ensure that period never overflows the jitter */
+ return clamp(new_period, period_min, period_max);
}
void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
@@ -143,6 +129,13 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
if (sample_nb == 0)
return;
+ /* no previous data, compute theoretical value from interrupt */
+ if (ts->timestamp == 0) {
+ /* elapsed time: sensor period * sensor samples number */
+ interval = (s64)ts->period * (s64)sample_nb;
+ ts->timestamp = timestamp - interval;
+ }
+
/* update interrupt timestamp and compute chip and sensor periods */
it = &ts->it;
it->lo = it->up;
@@ -154,17 +147,11 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
valid = inv_update_chip_period(ts, period);
}
- /* no previous data, compute theoretical value from interrupt */
- if (ts->timestamp == 0) {
- /* elapsed time: sensor period * sensor samples number */
- interval = (s64)ts->period * (s64)sample_nb;
- ts->timestamp = it->up - interval;
- return;
- }
-
/* if interrupt interval is valid, sync with interrupt timestamp */
if (valid)
- inv_align_timestamp_it(ts);
+ ts->period = inv_align_timestamp_it(ts, sample_nb);
+ else
+ ts->period = ts->mult * ts->chip_period.val;
}
EXPORT_SYMBOL_NS_GPL(inv_sensors_timestamp_interrupt, "IIO_INV_SENSORS_TIMESTAMP");
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 108/703] iio: inv_sensors: improve period measurement by using a longer delay
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (106 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 107/703] iio: inv_sensors: better timestamp alignment when using watermark Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 109/703] iio: inv_sensors: prevent timestamps going back in time in transitions Greg Kroah-Hartman
` (29 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jean-Baptiste Maneyrol,
Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
[ Upstream commit 82bd09ce4fd3b15680735eaeafe2e688901e3b00 ]
Period measurement can be difficult when using high sampling
frequency where the jitter criteria is hard to meet because of the
system jitter.
This new version is using the delta time between 2 distant interrupts
to measure an interval of at least 20ms. 20ms is a good compromise
between the mitigation of system jitter and the delay to update
period. This way we decorrelate the period measurement from the
interrupt timestamps syncing using only the 2 last interrupts.
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Stable-dep-of: 3785dffc7c68 ("iio: inv_sensors: prevent timestamps going back in time in transitions")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../inv_sensors/inv_sensors_timestamp.c | 26 ++++++++++++++++---
.../linux/iio/common/inv_sensors_timestamp.h | 6 +++++
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
index 2aaaa8df6d03b..88a82d1370c50 100644
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -16,6 +16,9 @@
#define INV_SENSORS_TIMESTAMP_MAX(_val, _jitter) \
(((_val) * (1000 + (_jitter))) / 1000)
+/* minimum timestamp delta between 2 interrupts for measuring period (20ms) */
+#define INV_SENSORS_MIN_IT_DELTA (20 * NSEC_PER_MSEC)
+
/* Add a new value inside an accumulator and update the estimate value */
static void inv_update_acc(struct inv_sensors_timestamp_acc *acc, u32 val)
{
@@ -122,7 +125,7 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
size_t sample_nb, s64 timestamp)
{
struct inv_sensors_timestamp_interval *it;
- s64 delta, interval;
+ s64 delta, delta_threshold, interval;
u32 period;
bool valid = false;
@@ -136,15 +139,32 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
ts->timestamp = timestamp - interval;
}
+ /* update delta timestamps and estimated period */
+ it = &ts->delta;
+ ts->delta_counter += sample_nb;
+ delta = timestamp - it->up;
+ delta_threshold = INV_SENSORS_TIMESTAMP_MIN(INV_SENSORS_MIN_IT_DELTA, ts->chip.jitter);
+ if (delta >= delta_threshold) {
+ it->lo = it->up;
+ it->up = timestamp;
+ if (it->lo != 0) {
+ /* compute period: delta time divided by number of samples */
+ delta = it->up - it->lo;
+ period = div_s64(delta, ts->delta_counter);
+ inv_update_chip_period(ts, period);
+ }
+ ts->delta_counter = 0;
+ }
+
/* update interrupt timestamp and compute chip and sensor periods */
it = &ts->it;
it->lo = it->up;
it->up = timestamp;
delta = it->up - it->lo;
if (it->lo != 0) {
- /* compute period: delta time divided by number of samples */
+ /* compute period and check validity */
period = div_s64(delta, sample_nb);
- valid = inv_update_chip_period(ts, period);
+ valid = inv_validate_period(ts, period);
}
/* if interrupt interval is valid, sync with interrupt timestamp */
diff --git a/include/linux/iio/common/inv_sensors_timestamp.h b/include/linux/iio/common/inv_sensors_timestamp.h
index e4e720e6f4b72..4f08204ede3b4 100644
--- a/include/linux/iio/common/inv_sensors_timestamp.h
+++ b/include/linux/iio/common/inv_sensors_timestamp.h
@@ -46,6 +46,8 @@ struct inv_sensors_timestamp_acc {
* @min_period: minimal acceptable clock period
* @max_period: maximal acceptable clock period
* @it: interrupts interval timestamps
+ * @delta: interval timestamps between several interrupts
+ * @delta_counter: number of data samples in the delta interval
* @timestamp: store last timestamp for computing next data timestamp
* @mult: current internal period multiplier
* @new_mult: new set internal period multiplier (not yet effective)
@@ -57,6 +59,8 @@ struct inv_sensors_timestamp {
u32 min_period;
u32 max_period;
struct inv_sensors_timestamp_interval it;
+ struct inv_sensors_timestamp_interval delta;
+ u32 delta_counter;
s64 timestamp;
u32 mult;
u32 new_mult;
@@ -88,6 +92,8 @@ static inline void inv_sensors_timestamp_reset(struct inv_sensors_timestamp *ts)
const struct inv_sensors_timestamp_interval interval_init = {0LL, 0LL};
ts->it = interval_init;
+ ts->delta = interval_init;
+ ts->delta_counter = 0;
ts->timestamp = 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 109/703] iio: inv_sensors: prevent timestamps going back in time in transitions
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (107 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 108/703] iio: inv_sensors: improve period measurement by using a longer delay Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 110/703] iio: inv_sensors: fix estimated value larger than interrupt timestamp Greg Kroah-Hartman
` (28 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jean-Baptiste Maneyrol,
Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
[ Upstream commit 3785dffc7c68751a8429ae6dd75804c14a5a7c7a ]
Ensure when computing first timestamp and when applying odr change,
that the next timestamp will not be lower than the previous one.
This way there is no risk to have a timestamp going back in time, meaning
being lower than the previous one. It already can never happen without
a transition because we are generating timestamps by adding the period
to the last timestamp.
Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../common/inv_sensors/inv_sensors_timestamp.c | 16 ++++++++++++----
include/linux/iio/common/inv_sensors_timestamp.h | 3 ++-
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
index 88a82d1370c50..c6699fc9248ae 100644
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -133,10 +133,15 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
return;
/* no previous data, compute theoretical value from interrupt */
- if (ts->timestamp == 0) {
+ if (!ts->init) {
/* elapsed time: sensor period * sensor samples number */
interval = (s64)ts->period * (s64)sample_nb;
- ts->timestamp = timestamp - interval;
+ delta = timestamp - interval;
+ /* prevent next timestamp to be lower than the last one */
+ if ((delta + ts->period) > ts->timestamp)
+ ts->timestamp = delta;
+ ts->init = true;
+
}
/* update delta timestamps and estimated period */
@@ -179,7 +184,7 @@ void inv_sensors_timestamp_apply_odr(struct inv_sensors_timestamp *ts,
u32 fifo_period, size_t fifo_nb,
unsigned int fifo_no)
{
- s64 interval;
+ s64 interval, timestamp;
u32 fifo_mult;
if (ts->new_mult == 0)
@@ -202,7 +207,10 @@ void inv_sensors_timestamp_apply_odr(struct inv_sensors_timestamp *ts,
fifo_period = fifo_mult * ts->chip_period.val;
/* computes time interval between interrupt and this sample */
interval = (s64)(fifo_nb - fifo_no) * (s64)fifo_period;
- ts->timestamp = ts->it.up - interval;
+ timestamp = ts->it.up - interval;
+ /* prevent next timestamp to be lower than current one */
+ if ((timestamp + ts->period) > ts->timestamp)
+ ts->timestamp = timestamp;
}
}
EXPORT_SYMBOL_NS_GPL(inv_sensors_timestamp_apply_odr, "IIO_INV_SENSORS_TIMESTAMP");
diff --git a/include/linux/iio/common/inv_sensors_timestamp.h b/include/linux/iio/common/inv_sensors_timestamp.h
index 4f08204ede3b4..91690778ae88b 100644
--- a/include/linux/iio/common/inv_sensors_timestamp.h
+++ b/include/linux/iio/common/inv_sensors_timestamp.h
@@ -66,6 +66,7 @@ struct inv_sensors_timestamp {
u32 new_mult;
u32 period;
struct inv_sensors_timestamp_acc chip_period;
+ bool init;
};
void inv_sensors_timestamp_init(struct inv_sensors_timestamp *ts,
@@ -94,7 +95,7 @@ static inline void inv_sensors_timestamp_reset(struct inv_sensors_timestamp *ts)
ts->it = interval_init;
ts->delta = interval_init;
ts->delta_counter = 0;
- ts->timestamp = 0;
+ ts->init = false;
}
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 110/703] iio: inv_sensors: fix estimated value larger than interrupt timestamp
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (108 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 109/703] iio: inv_sensors: prevent timestamps going back in time in transitions Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 111/703] iio: inv_sensors: do not compute period estimation when updating odr Greg Kroah-Hartman
` (27 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jean-Baptiste Maneyrol,
Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
[ Upstream commit b1c3c51b0916f7d1b2dceffc0e48abe185958825 ]
When interrupt timestamp interval is not valid, we use an estimated value
that can in rare case be bigger than the interrupt timestamp. This is
obviously wrong, so better use interrupt timestamp in this case.
Fixes: 8f4b627656fa ("iio: inv_sensors: better timestamp alignment when using watermark")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../iio/common/inv_sensors/inv_sensors_timestamp.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
index c6699fc9248ae..9040da80f0c73 100644
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -172,11 +172,16 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
valid = inv_validate_period(ts, period);
}
- /* if interrupt interval is valid, sync with interrupt timestamp */
+ /*
+ * If interrupt interval is valid, sync with interrupt timestamp.
+ * Otherwise, use estimated value while ensuring interrupt timestamp
+ * remains the maximum possible value.
+ */
+ period = inv_align_timestamp_it(ts, sample_nb);
if (valid)
- ts->period = inv_align_timestamp_it(ts, sample_nb);
+ ts->period = period;
else
- ts->period = ts->mult * ts->chip_period.val;
+ ts->period = min(ts->mult * ts->chip_period.val, period);
}
EXPORT_SYMBOL_NS_GPL(inv_sensors_timestamp_interrupt, "IIO_INV_SENSORS_TIMESTAMP");
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 111/703] iio: inv_sensors: do not compute period estimation when updating odr
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (109 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 110/703] iio: inv_sensors: fix estimated value larger than interrupt timestamp Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 112/703] Revert "wifi: ath10k: Stop unanswered temperature reads" Greg Kroah-Hartman
` (26 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jean-Baptiste Maneyrol,
Jonathan Cameron, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
[ Upstream commit 0d695709ed380f1bc9303a91f57525d33766a07e ]
When odr is updated, the delta between the interrupts will change and it
will lead to a bad period estimation.
Avoid this by preventing the period estimation in this case.
Fixes: 82bd09ce4fd3 ("iio: inv_sensors: improve period measurement by using a longer delay")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/common/inv_sensors/inv_sensors_timestamp.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
index 9040da80f0c73..b3a784d3e67d7 100644
--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
+++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
@@ -147,6 +147,12 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
/* update delta timestamps and estimated period */
it = &ts->delta;
ts->delta_counter += sample_nb;
+ /* reset in case of odr change */
+ if (ts->new_mult) {
+ it->lo = 0;
+ it->up = 0;
+ ts->delta_counter = 0;
+ }
delta = timestamp - it->up;
delta_threshold = INV_SENSORS_TIMESTAMP_MIN(INV_SENSORS_MIN_IT_DELTA, ts->chip.jitter);
if (delta >= delta_threshold) {
@@ -166,7 +172,7 @@ void inv_sensors_timestamp_interrupt(struct inv_sensors_timestamp *ts,
it->lo = it->up;
it->up = timestamp;
delta = it->up - it->lo;
- if (it->lo != 0) {
+ if (it->lo != 0 && !ts->new_mult) {
/* compute period and check validity */
period = div_s64(delta, sample_nb);
valid = inv_validate_period(ts, period);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 112/703] Revert "wifi: ath10k: Stop unanswered temperature reads"
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (110 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 111/703] iio: inv_sensors: do not compute period estimation when updating odr Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 113/703] tpm: Call cmd_ready/go_idle for each command transmission Greg Kroah-Hartman
` (25 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jeff Johnson
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
commit b1ed5a45b994a6473ca1cf34f35a1bf87f1d8e2a upstream.
As reported by Nicolas Escande [1] this will break some setups where
temperature reporting is supported but there are occasional requests where
there isn't a response. Revert this implementation where a single
unreported temperature read at any time will stop all future requests.
Alternate solutions are being discussed.
Link: https://lore.kernel.org/all/DMRPC2GCD51O.S4DMHZFDKRFG@gmail.com/ # [1]
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/ath/ath10k/core.c | 1 -
drivers/net/wireless/ath/ath10k/thermal.c | 9 +--------
drivers/net/wireless/ath/ath10k/thermal.h | 2 --
3 files changed, 1 insertion(+), 11 deletions(-)
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2986,7 +2986,6 @@ int ath10k_core_start(struct ath10k *ar,
clear_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags);
ar->running_fw = fw;
- ar->thermal.broken = false;
if (!test_bit(ATH10K_FW_FEATURE_NON_BMI,
ar->running_fw->fw_file.fw_features)) {
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -75,12 +75,6 @@ static ssize_t ath10k_thermal_show_temp(
goto out;
}
- /* Don't stall every read on firmware that never answers */
- if (ar->thermal.broken) {
- ret = -EOPNOTSUPP;
- goto out;
- }
-
reinit_completion(&ar->thermal.wmi_sync);
ret = ath10k_wmi_pdev_get_temperature(ar);
if (ret) {
@@ -96,8 +90,7 @@ static ssize_t ath10k_thermal_show_temp(
time_left = wait_for_completion_timeout(&ar->thermal.wmi_sync,
ATH10K_THERMAL_SYNC_TIMEOUT_HZ);
if (!time_left) {
- ath10k_warn(ar, "failed to synchronize thermal read, not asking again until the firmware restarts\n");
- ar->thermal.broken = true;
+ ath10k_warn(ar, "failed to synchronize thermal read\n");
ret = -ETIMEDOUT;
goto out;
}
--- a/drivers/net/wireless/ath/ath10k/thermal.h
+++ b/drivers/net/wireless/ath/ath10k/thermal.h
@@ -19,8 +19,6 @@ struct ath10k_thermal {
/* protected by conf_mutex */
u32 throttle_state;
u32 quiet_period;
- /* the running firmware did not answer a temperature request */
- bool broken;
/* temperature value in Celsius degree
* protected by data_lock
*/
^ permalink raw reply [flat|nested] 139+ messages in thread
* [PATCH 6.18 113/703] tpm: Call cmd_ready/go_idle for each command transmission
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (111 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 112/703] Revert "wifi: ath10k: Stop unanswered temperature reads" Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 114/703] firmware: arm_scmi: Update ARM_SCMI_HAVE_TRANSPORT rationale Greg Kroah-Hartman
` (24 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Mario Limonciello, Jarkko Sakkinen
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <mario.limonciello@amd.com>
commit 313acd594a799d6b4b3af937eaca7bf4a1803c4a upstream.
Some TPM implementations, particularly fTPM using the CRB interface,
require the TPM to transition through idle and ready states for each
command rather than once per session.
The current implementation calls cmd_ready once during tpm_chip_start()
and go_idle once during tpm_chip_stop(). For fTPM, when multiple commands
are sent without per-command idle transitions, subsequent commands timeout
as the TPM is waiting for the transition.
Fix this by calling cmd_ready before each command and go_idle on all exit
paths in tpm_try_transmit(). For TPM implementations that don't require
per-command transitions, the callbacks return immediately based on the
start method.
Remove the now-redundant per-session calls from tpm_chip_start() and
tpm_chip_stop() along with their helpers.
This resolves timeout errors during TPM initialization on systems where
BIOS has already performed TPM startup.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20260901213723.3017371-1-mario.limonciello@amd.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/tpm/tpm-chip.c | 24 ------------------------
drivers/char/tpm/tpm-interface.c | 22 ++++++++++++++++++++++
2 files changed, 22 insertions(+), 24 deletions(-)
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -66,22 +66,6 @@ static void tpm_relinquish_locality(stru
chip->locality = -1;
}
-static int tpm_cmd_ready(struct tpm_chip *chip)
-{
- if (!chip->ops->cmd_ready)
- return 0;
-
- return chip->ops->cmd_ready(chip);
-}
-
-static int tpm_go_idle(struct tpm_chip *chip)
-{
- if (!chip->ops->go_idle)
- return 0;
-
- return chip->ops->go_idle(chip);
-}
-
static void tpm_clk_enable(struct tpm_chip *chip)
{
if (chip->ops->clk_enable)
@@ -116,13 +100,6 @@ int tpm_chip_start(struct tpm_chip *chip
}
}
- ret = tpm_cmd_ready(chip);
- if (ret) {
- tpm_relinquish_locality(chip);
- tpm_clk_disable(chip);
- return ret;
- }
-
return 0;
}
EXPORT_SYMBOL_GPL(tpm_chip_start);
@@ -137,7 +114,6 @@ EXPORT_SYMBOL_GPL(tpm_chip_start);
*/
void tpm_chip_stop(struct tpm_chip *chip)
{
- tpm_go_idle(chip);
tpm_relinquish_locality(chip);
tpm_clk_disable(chip);
}
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -19,6 +19,7 @@
* calls to msleep.
*/
+#include <linux/cleanup.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/mutex.h>
@@ -89,8 +90,17 @@ static bool tpm_transmit_completed(u8 st
return status_masked == chip->ops->req_complete_val;
}
+static void tpm_go_idle(struct tpm_chip *chip)
+{
+ if (chip->ops->go_idle)
+ chip->ops->go_idle(chip);
+}
+
+DEFINE_FREE(tpm_go_idle, struct tpm_chip *, if (_T) tpm_go_idle(_T))
+
static ssize_t tpm_try_transmit(struct tpm_chip *chip, void *buf, size_t bufsiz)
{
+ struct tpm_chip *chip_idle __free(tpm_go_idle) = NULL;
struct tpm_header *header = buf;
int rc;
ssize_t len = 0;
@@ -113,6 +123,18 @@ static ssize_t tpm_try_transmit(struct t
return -E2BIG;
}
+ if (chip->ops->cmd_ready) {
+ rc = chip->ops->cmd_ready(chip);
+ if (rc) {
+ dev_err(&chip->dev,
+ "%s: cmd_ready(): error %d\n", __func__, rc);
+ return rc;
+ }
+ }
+
+ /* Ensure go_idle() is called on every exit path from here on. */
+ chip_idle = chip;
+
rc = chip->ops->send(chip, buf, bufsiz, count);
if (rc < 0) {
if (rc != -EPIPE)
^ permalink raw reply [flat|nested] 139+ messages in thread
* [PATCH 6.18 114/703] firmware: arm_scmi: Update ARM_SCMI_HAVE_TRANSPORT rationale
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (112 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 113/703] tpm: Call cmd_ready/go_idle for each command transmission Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 115/703] firmware: arm_ffa: Compare notify_id when looking up notifier callbacks Greg Kroah-Hartman
` (23 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Geert Uytterhoeven, Sudeep Holla,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <geert+renesas@glider.be>
[ Upstream commit e637b774416775d09540070ceecf972c59070d90 ]
Not enabling any transports no longer breaks the build.
Fixes: c0397c85b53d0bc6 ("firmware: arm_scmi: Use WARN_ON() to check configured transports")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/48c4bed8036dcb55f554f513ce2ae61807c5677d.1790684637.git.geert+renesas@glider.be
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/arm_scmi/transports/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/arm_scmi/transports/Kconfig b/drivers/firmware/arm_scmi/transports/Kconfig
index 57eccf316e26b..66b10f511827c 100644
--- a/drivers/firmware/arm_scmi/transports/Kconfig
+++ b/drivers/firmware/arm_scmi/transports/Kconfig
@@ -5,7 +5,7 @@ config ARM_SCMI_HAVE_TRANSPORT
bool
help
This declares whether at least one SCMI transport has been configured.
- Used to trigger a build bug when trying to build SCMI without any
+ Used to trigger a runtime warning when enabling SCMI without any
configured transport.
config ARM_SCMI_HAVE_SHMEM
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 115/703] firmware: arm_ffa: Compare notify_id when looking up notifier callbacks
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (113 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 114/703] firmware: arm_scmi: Update ARM_SCMI_HAVE_TRANSPORT rationale Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 116/703] firmware: smccc: Provide stubs for HAVE_ARM_SMCCC_DISCOVERY=n Greg Kroah-Hartman
` (22 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Cemin, Sudeep Holla,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Cemin <dcemin@nvidia.com>
[ Upstream commit 8ab2e426762d199ce8b799d029edafbfb981f5c6 ]
The notifier callbacks are kept in a hash table keyed by notification ID,
but struct notifier_cb_info does not store the ID and none of the lookup
helpers compare it. hash_for_each_possible() walks the whole bucket, so
any two IDs that hash to the same bucket are treated as the same
registration.
With the 64-bucket table, hash_32() maps IDs 2 and 36 to the same
bucket. A driver that requests notifications sequentially therefore
fails at the 37th request:
ARM FF-A: Failed to register callback for 36 - -22
because update_notifier_cb() finds the node registered for ID 2 and
rejects the new registration as a duplicate. The same lookup is used on
the delivery path, so a notification for a colliding ID can also be
dispatched to the callback registered for the other ID.
Store the notification ID in the node and compare it in all three
lookup helpers.
This was found on an arm64 laptop whose embedded controller partition
declares 38 notifications: the EC driver failed to probe and every
EC event (AC, battery, lid, hotkeys) was lost.
Fixes: e0573444edbf ("firmware: arm_ffa: Add interfaces to request notification callbacks")
Fixes: c10debfe7f02 ("firmware: arm_ffa: Add support for {un,}registration of framework notifications")
Signed-off-by: David Cemin <dcemin@nvidia.com>
Link: https://patch.msgid.link/20261020220902.611138-1-dcemin@nvidia.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/arm_ffa/driver.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index 1d0bd586da4d6..e7cc536bdef3a 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -1214,6 +1214,7 @@ struct notifier_cb_info {
ffa_fwk_notifier_cb fwk_cb;
ffa_notifier_cb cb;
void *cb_data;
+ u16 notify_id;
};
static int
@@ -1293,7 +1294,8 @@ notifier_hnode_get_by_vmid(u16 notify_id, int vmid)
struct notifier_cb_info *node;
hash_for_each_possible(drv_info->notifier_hash, node, hnode, notify_id)
- if (node->fwk_cb && vmid == node->dev->vm_id)
+ if (node->notify_id == notify_id && node->fwk_cb &&
+ vmid == node->dev->vm_id)
return node;
return NULL;
@@ -1308,7 +1310,8 @@ notifier_hnode_get_by_vmid_uuid(u16 notify_id, int vmid, const uuid_t *uuid)
return notifier_hnode_get_by_vmid(notify_id, vmid);
hash_for_each_possible(drv_info->notifier_hash, node, hnode, notify_id)
- if (node->fwk_cb && vmid == node->dev->vm_id &&
+ if (node->notify_id == notify_id && node->fwk_cb &&
+ vmid == node->dev->vm_id &&
uuid_equal(&node->dev->uuid, uuid))
return node;
@@ -1321,7 +1324,8 @@ notifier_hnode_get_by_type(u16 notify_id, enum notify_type type)
struct notifier_cb_info *node;
hash_for_each_possible(drv_info->notifier_hash, node, hnode, notify_id)
- if (node->cb && type == ffa_notify_type_get(node->dev->vm_id))
+ if (node->notify_id == notify_id && node->cb &&
+ type == ffa_notify_type_get(node->dev->vm_id))
return node;
return NULL;
@@ -1413,6 +1417,7 @@ static int __ffa_notify_request(struct ffa_device *dev, bool is_per_vcpu,
cb_info->dev = dev;
cb_info->cb_data = cb_data;
+ cb_info->notify_id = notify_id;
if (is_framework)
cb_info->fwk_cb = cb;
else
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 116/703] firmware: smccc: Provide stubs for HAVE_ARM_SMCCC_DISCOVERY=n
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (114 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 115/703] firmware: arm_ffa: Compare notify_id when looking up notifier callbacks Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 117/703] irqchip/gic-v3: Select HAVE_ARM_SMCCC_DISCOVERY only on arm64 Greg Kroah-Hartman
` (21 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marc Zyngier, Julian Braha,
Sudeep Holla, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Braha <julianbraha@gmail.com>
[ Upstream commit 6cc03818814aa98c3584a346b82165f1b561f2b7 ]
Add fallbacks for callers to avoid needing #ifdef guards when
HAVE_ARM_SMCCC_DISCOVERY is disabled (32-bit arm).
Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4")
Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Julian Braha <julianbraha@gmail.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://patch.msgid.link/20261020222817.1231643-2-julianbraha@gmail.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/arm-smccc.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index 976c5f8001ff2..c4551e9a5cf03 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -318,6 +318,7 @@ enum arm_smccc_conduit {
SMCCC_CONDUIT_HVC,
};
+#ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY
/**
* arm_smccc_1_1_get_conduit()
*
@@ -357,6 +358,12 @@ s32 arm_smccc_get_soc_id_version(void);
* When ARM_SMCCC_ARCH_SOC_ID is not present, returns SMCCC_RET_NOT_SUPPORTED.
*/
s32 arm_smccc_get_soc_id_revision(void);
+#else /* CONFIG_HAVE_ARM_SMCCC_DISCOVERY */
+#define arm_smccc_1_1_get_conduit() SMCCC_CONDUIT_NONE
+#define arm_smccc_get_version() 0
+#define arm_smccc_get_soc_id_version() SMCCC_RET_NOT_SUPPORTED
+#define arm_smccc_get_soc_id_revision() SMCCC_RET_NOT_SUPPORTED
+#endif /* CONFIG_HAVE_ARM_SMCCC_DISCOVERY */
#ifndef __ASSEMBLY__
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 117/703] irqchip/gic-v3: Select HAVE_ARM_SMCCC_DISCOVERY only on arm64
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (115 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 116/703] firmware: smccc: Provide stubs for HAVE_ARM_SMCCC_DISCOVERY=n Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 118/703] HID: vivaldi: Extract feature report value directly in vivaldi_feature_mapping() Greg Kroah-Hartman
` (20 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marc Zyngier, Thomas Gleixner,
Julian Braha, Sudeep Holla, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Braha <julianbraha@gmail.com>
[ Upstream commit 40b097fdfd00516ba9a568ccc10e9f166358ddca ]
ARM_PSCI_FW is always enabled for arm64, and the GICv3 driver only
uses HAVE_ARM_SMCCC_DISCOVERY to identify the NVIDIA T241, which is
arm64 anyway.
For ARM_GIC_V3, let's only select HAVE_ARM_SMCCC_DISCOVERY on arm64.
Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4")
Suggested-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Acked-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Julian Braha <julianbraha@gmail.com>
Link: https://patch.msgid.link/20261020222817.1231643-3-julianbraha@gmail.com
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index a61c6dc63c29c..eb09bb04b1750 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -38,7 +38,7 @@ config ARM_GIC_V3
select IRQ_DOMAIN_HIERARCHY
select PARTITION_PERCPU
select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
- select HAVE_ARM_SMCCC_DISCOVERY
+ select HAVE_ARM_SMCCC_DISCOVERY if ARM64
select IRQ_MSI_IOMMU
config ARM_GIC_ITS_PARENT
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 118/703] HID: vivaldi: Extract feature report value directly in vivaldi_feature_mapping()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (116 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 117/703] irqchip/gic-v3: Select HAVE_ARM_SMCCC_DISCOVERY only on arm64 Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 119/703] HID: vivaldi: avoid redundant feature report reads per usage Greg Kroah-Hartman
` (19 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Torokhov, Tzung-Bi Shih,
Sean OBrien, Shashikirana H K, Benjamin Tissoires, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shashikirana H K <shashikiranah@chromium.org>
[ Upstream commit 8dbf66b011135422a28ee32da1d6aacbe08ddd7a ]
Currently vivaldi_feature_mapping() passes the raw buffer returned by
hid_hw_raw_request() to hid_report_raw_event() with the descriptor-declared
report_len just to populate field->value[usage->usage_index].
Since vivaldi_feature_mapping() already has the target report, field, and
usage in hand, and nothing else consumes field->value[] for this report,
verify that hid_hw_raw_request() returns the expected report_len, ensure
usage->usage_index is within field->report_count, and extract the value
directly using hid_field_extract(). Also use __free(kfree) to simplify
buffer cleanup.
Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Fixes: 33bbe04a15f2 ("HID: google: extract Vivaldi hid feature mapping for use in hid-hammer")
Cc: Tzung-Bi Shih <tzungbi@chromium.org>
Cc: Sean O'Brien <seobrien@chromium.org>
Signed-off-by: Shashikirana H K <shashikiranah@chromium.org>
Link: https://patch.msgid.link/20261013-upstream-vivaldi-fix-v2-1-ecc20329d24c@chromium.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/hid-vivaldi-common.c | 72 ++++++++++++--------------------
1 file changed, 26 insertions(+), 46 deletions(-)
diff --git a/drivers/hid/hid-vivaldi-common.c b/drivers/hid/hid-vivaldi-common.c
index b12bb5cc091aa..1359a107e63bd 100644
--- a/drivers/hid/hid-vivaldi-common.c
+++ b/drivers/hid/hid-vivaldi-common.c
@@ -5,11 +5,13 @@
* Copyright (C) 2022 Google, Inc
*/
+#include <linux/cleanup.h>
#include <linux/export.h>
#include <linux/hid.h>
#include <linux/input/vivaldi-fmap.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/slab.h>
#include <linux/types.h>
#include "hid-vivaldi-common.h"
@@ -33,13 +35,14 @@ void vivaldi_feature_mapping(struct hid_device *hdev,
{
struct vivaldi_data *data = hid_get_drvdata(hdev);
struct hid_report *report = field->report;
- u8 *report_data, *buf;
- u32 report_len;
unsigned int fn_key;
+ unsigned int offset;
+ u32 report_len;
int ret;
if (field->logical != HID_USAGE_FN_ROW_PHYSMAP ||
- (usage->hid & HID_USAGE_PAGE) != HID_UP_ORDINAL)
+ (usage->hid & HID_USAGE_PAGE) != HID_UP_ORDINAL ||
+ usage->usage_index >= field->report_count)
return;
fn_key = usage->hid & HID_USAGE;
@@ -49,54 +52,31 @@ void vivaldi_feature_mapping(struct hid_device *hdev,
if (fn_key > data->num_function_row_keys)
data->num_function_row_keys = fn_key;
- report_data = buf = hid_alloc_report_buf(report, GFP_KERNEL);
- if (!report_data)
+ u8 *buf __free(kfree) = hid_alloc_report_buf(report, GFP_KERNEL);
+ if (!buf)
return;
- report_len = hid_report_len(report);
- if (!report->id) {
- /*
- * hid_hw_raw_request() will stuff report ID (which will be 0)
- * into the first byte of the buffer even for unnumbered
- * reports, so we need to account for this to avoid getting
- * -EOVERFLOW in return.
- * Note that hid_alloc_report_buf() adds 7 bytes to the size
- * so we can safely say that we have space for an extra byte.
- */
- report_len++;
- }
-
- ret = hid_hw_raw_request(hdev, report->id, report_data,
- report_len, HID_FEATURE_REPORT,
- HID_REQ_GET_REPORT);
- if (ret < 0) {
- dev_warn(&hdev->dev, "failed to fetch feature %d\n",
- field->report->id);
- goto out;
- }
-
- if (!report->id) {
- /*
- * Undo the damage from hid_hw_raw_request() for unnumbered
- * reports.
- */
- report_data++;
- report_len--;
- }
-
- ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, report_data,
- report_len, report_len, 0);
- if (ret) {
- dev_warn(&hdev->dev, "failed to report feature %d\n",
- field->report->id);
- goto out;
+ /*
+ * hid_hw_raw_request() will stuff report ID (which will be 0)
+ * into the first byte of the buffer even for unnumbered
+ * reports, so we need to account for this to avoid getting
+ * -EOVERFLOW in return.
+ * Note that hid_alloc_report_buf() adds 7 bytes to the size
+ * so we can safely say that we have space for an extra byte.
+ */
+ report_len = hid_report_len(report) + !report->id;
+
+ ret = hid_hw_raw_request(hdev, report->id, buf, report_len,
+ HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
+ if (ret != report_len) {
+ dev_warn(&hdev->dev, "failed to fetch feature %d: %d\n",
+ report->id, ret);
+ return;
}
+ offset = field->report_offset + usage->usage_index * field->report_size;
data->function_row_physmap[fn_key - MIN_FN_ROW_KEY] =
- field->value[usage->usage_index];
-
-out:
- kfree(buf);
+ hid_field_extract(hdev, buf + 1, offset, field->report_size);
}
EXPORT_SYMBOL_GPL(vivaldi_feature_mapping);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 119/703] HID: vivaldi: avoid redundant feature report reads per usage
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (117 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 118/703] HID: vivaldi: Extract feature report value directly in vivaldi_feature_mapping() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 120/703] firmware: arm_scmi: imx: Validate MISC control response size Greg Kroah-Hartman
` (18 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhengping Jiang, Benjamin Tissoires,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhengping Jiang <jiangzp@google.com>
[ Upstream commit 720806515cb6921ab05caaa6f470f7054b56385e ]
vivaldi_feature_mapping() is invoked by report_features() in ascending
usage_index order for each usage in the top-row physical keymap field.
Because fetching the feature report at usage_index == 0 already reads
the entire report from hardware, calling hid_hw_raw_request() again for
subsequent usages redundantly reads the same report N times (e.g., 12
sequential BLE GATT reads taking ~2s on Vivaldi BLE keyboards).
Bail out immediately when usage->usage_index != 0, fetch the feature
report once at usage_index == 0, and iterate over all usages in the
field to populate data->function_row_physmap[].
Fixes: 33bbe04a15f2 ("HID: google: extract Vivaldi hid feature mapping for use in hid-hammer")
Signed-off-by: Zhengping Jiang <jiangzp@google.com>
Link: https://patch.msgid.link/20261015064223.1939367-1-jiangzp@google.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/hid-vivaldi-common.c | 33 +++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/drivers/hid/hid-vivaldi-common.c b/drivers/hid/hid-vivaldi-common.c
index 1359a107e63bd..973393d093561 100644
--- a/drivers/hid/hid-vivaldi-common.c
+++ b/drivers/hid/hid-vivaldi-common.c
@@ -39,19 +39,11 @@ void vivaldi_feature_mapping(struct hid_device *hdev,
unsigned int offset;
u32 report_len;
int ret;
+ int i;
- if (field->logical != HID_USAGE_FN_ROW_PHYSMAP ||
- (usage->hid & HID_USAGE_PAGE) != HID_UP_ORDINAL ||
- usage->usage_index >= field->report_count)
+ if (field->logical != HID_USAGE_FN_ROW_PHYSMAP || usage->usage_index)
return;
- fn_key = usage->hid & HID_USAGE;
- if (fn_key < MIN_FN_ROW_KEY || fn_key > MAX_FN_ROW_KEY)
- return;
-
- if (fn_key > data->num_function_row_keys)
- data->num_function_row_keys = fn_key;
-
u8 *buf __free(kfree) = hid_alloc_report_buf(report, GFP_KERNEL);
if (!buf)
return;
@@ -74,9 +66,24 @@ void vivaldi_feature_mapping(struct hid_device *hdev,
return;
}
- offset = field->report_offset + usage->usage_index * field->report_size;
- data->function_row_physmap[fn_key - MIN_FN_ROW_KEY] =
- hid_field_extract(hdev, buf + 1, offset, field->report_size);
+ for (i = 0; i < field->maxusage && i < field->report_count; i++) {
+ usage = &field->usage[i];
+
+ if ((usage->hid & HID_USAGE_PAGE) != HID_UP_ORDINAL)
+ continue;
+
+ fn_key = usage->hid & HID_USAGE;
+ if (fn_key < MIN_FN_ROW_KEY || fn_key > MAX_FN_ROW_KEY)
+ continue;
+
+ if (fn_key > data->num_function_row_keys)
+ data->num_function_row_keys = fn_key;
+
+ offset = field->report_offset + i * field->report_size;
+ data->function_row_physmap[fn_key - MIN_FN_ROW_KEY] =
+ hid_field_extract(hdev, buf + 1, offset,
+ field->report_size);
+ }
}
EXPORT_SYMBOL_GPL(vivaldi_feature_mapping);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 120/703] firmware: arm_scmi: imx: Validate MISC control response size
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (118 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 119/703] HID: vivaldi: avoid redundant feature report reads per usage Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 121/703] firmware: arm_scmi: Unregister notifier on enable failure Greg Kroah-Hartman
` (17 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Peng Fan, Sudeep Holla,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
[ Upstream commit 4e3652a0ac715ba7387b072b72eaff76e761aaf9 ]
scmi_imx_misc_ctrl_get() uses @num to report the number of
values returned by firmware, but it did not retain the caller's value
as the capacity of @val.
A response with more values than the caller allocated was copied into
@val unchecked. For example, the MQS regmap callback supplies storage
for one value. Retain the input capacity and reject responses exceeding
it before copying, then update @num only after a successful copy.
Document the in/out @num contract of the exported helper.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-6897b44a-57fb-4964-95f8-447d0ce526e4
Fixes: 61c9f03e22fc ("firmware: arm_scmi: Add initial support for i.MX MISC protocol")
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261028130502.2999676-2-sudeep.holla@kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../firmware/arm_scmi/vendors/imx/imx-sm-misc.c | 16 ++++++++++++----
include/linux/firmware/imx/sm.h | 6 ++++++
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
index 700a3f24f4efc..b1050c214d046 100644
--- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
+++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
@@ -228,10 +228,16 @@ static int scmi_imx_misc_ctrl_get(const struct scmi_protocol_handle *ph,
{
struct scmi_imx_misc_ctrl_get_out *out;
struct scmi_xfer *t;
+ u32 num_values, max_values;
int ret, i;
int max_msg_size = ph->hops->get_max_msg_size(ph);
int max_num = (max_msg_size - sizeof(*out)) / sizeof(__le32);
+ if (!num || !val || !*num)
+ return -EINVAL;
+
+ max_values = *num;
+
ret = scmi_imx_misc_ctrl_validate_id(ph, ctrl_id);
if (ret)
return ret;
@@ -245,16 +251,18 @@ static int scmi_imx_misc_ctrl_get(const struct scmi_protocol_handle *ph,
ret = ph->xops->do_xfer(ph, t);
if (!ret) {
out = t->rx.buf;
- *num = le32_to_cpu(out->num);
+ num_values = le32_to_cpu(out->num);
- if (*num >= max_num ||
- *num * sizeof(__le32) > t->rx.len - sizeof(__le32)) {
+ if (num_values > max_values || num_values >= max_num ||
+ num_values * sizeof(__le32) > t->rx.len - sizeof(__le32)) {
ph->xops->xfer_put(ph, t);
return -EINVAL;
}
- for (i = 0; i < *num; i++)
+ for (i = 0; i < num_values; i++)
val[i] = le32_to_cpu(out->val[i]);
+
+ *num = num_values;
}
ph->xops->xfer_put(ph, t);
diff --git a/include/linux/firmware/imx/sm.h b/include/linux/firmware/imx/sm.h
index a33b450273567..c3b99f3d11ed0 100644
--- a/include/linux/firmware/imx/sm.h
+++ b/include/linux/firmware/imx/sm.h
@@ -27,6 +27,12 @@
#define SCMI_IMX94_CTRL_SAI4_MCLK 6U /*!< WAKE SAI4 MCLK */
#if IS_ENABLED(CONFIG_IMX_SCMI_MISC_DRV)
+/**
+ * scmi_imx_misc_ctrl_get() - Read an i.MX MISC control
+ * @id: Control identifier
+ * @num: On entry, capacity of @val in words; on return, words read
+ * @val: Buffer for the control value
+ */
int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val);
int scmi_imx_misc_ctrl_set(u32 id, u32 val);
#else
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 121/703] firmware: arm_scmi: Unregister notifier on enable failure
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (119 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 120/703] firmware: arm_scmi: imx: Validate MISC control response size Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 122/703] firmware: arm_scmi: Free mailbox state on mapping failure Greg Kroah-Hartman
` (16 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Peng Fan, Sudeep Holla,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
[ Upstream commit b9bb2eb88037a3823e7abd096b54d0a07d428f90 ]
scmi_notifier_register() adds the caller's notifier block before
enabling the corresponding event at the platform.
If enablement fails, the caller receives an error and can free its
notifier block. A concurrent registration can retain and later enable
the handler, leaving the failed caller's block in its notification
chain. Event delivery can then dereference the freed block.
Remove the notifier block before dropping the handler reference when
event enablement fails.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-c3c9437c-ba1a-4db6-837f-cb0950d89018
Fixes: e7c215f358a3 ("firmware: arm_scmi: Add notification callbacks-registration")
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261028130502.2999676-3-sudeep.holla@kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/arm_scmi/notify.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
index 672c91197a68a..ee2fc0549508c 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -1399,8 +1399,10 @@ static int scmi_notifier_register(const struct scmi_handle *handle,
/* Enable events for not pending handlers */
if (!IS_HNDL_PENDING(hndl)) {
ret = scmi_event_handler_enable_events(hndl);
- if (ret)
+ if (ret) {
+ blocking_notifier_chain_unregister(&hndl->chain, nb);
scmi_put_handler(ni, hndl);
+ }
}
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 122/703] firmware: arm_scmi: Free mailbox state on mapping failure
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (120 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 121/703] firmware: arm_scmi: Unregister notifier on enable failure Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 123/703] soundwire: qcom: disable the interrupt before gating the clock Greg Kroah-Hartman
` (15 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Sudeep Holla, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <sudeep.holla@kernel.org>
[ Upstream commit 38b6268eae651de1ca31c48b912a55ae3e706b94 ]
mailbox_chan_setup() allocates its private state from the SCMI base
device before mapping the shared-memory area. If mapping fails while
setting up an optional RX channel, the core ignores the RX failure and
keeps the base device bound, retaining that devres allocation.
Release the private mailbox state before returning the mapping error.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-fda9bcb5-8255-4157-bbf7-d720bbd86605
Fixes: 1ebc28e9357c ("firmware: arm_scmi: Introduce setup_shmem_iomap")
Link: https://patch.msgid.link/20261028153203.3305067-1-sudeep.holla@kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firmware/arm_scmi/transports/mailbox.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/arm_scmi/transports/mailbox.c b/drivers/firmware/arm_scmi/transports/mailbox.c
index 308736c3ead9c..237e04c1a0f43 100644
--- a/drivers/firmware/arm_scmi/transports/mailbox.c
+++ b/drivers/firmware/arm_scmi/transports/mailbox.c
@@ -201,8 +201,11 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
smbox->shmem = core->shmem->setup_iomap(cinfo, dev, tx, NULL,
&smbox->io_ops);
- if (IS_ERR(smbox->shmem))
- return PTR_ERR(smbox->shmem);
+ if (IS_ERR(smbox->shmem)) {
+ ret = PTR_ERR(smbox->shmem);
+ devm_kfree(dev, smbox);
+ return ret;
+ }
cl = &smbox->cl;
cl->dev = cdev;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 123/703] soundwire: qcom: disable the interrupt before gating the clock
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (121 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 122/703] firmware: arm_scmi: Free mailbox state on mapping failure Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 124/703] memory: tegra: Shut down Tegra210 EMC timers before teardown Greg Kroah-Hartman
` (14 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Keri, Dmitry Baryshkov,
Vinod Koul, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Keri <okerixx@gmail.com>
[ Upstream commit 6c067677192f054bbfa815caf04f536bb8dcdee2 ]
swrm_runtime_suspend() gates hclk straight after the ClockStopNow
broadcast, while the interrupt thread that completed it is still
clearing the status and CLK_STOP_FINISHED is about to fire. Both touch
registers with the clock going away; on x1e80100 and glymur hclk is the
SoundWire clock itself. The next clock-stop exit then fails at random
(bus clash, parity errors, AUTO_ENUM_FAILED) and one side of the
speakers stays detached until reboot.
Disable the interrupt before gating the clock and enable it again once
the clock is back.
Fixes: 74e79da9fd46 ("soundwire: qcom: add runtime pm support")
Signed-off-by: Oleg Keri <okerixx@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20261009082639.22662-1-okerixx@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soundwire/qcom.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index a4f108fdffddb..8a5e8bc282137 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -1664,6 +1664,7 @@ static int __maybe_unused swrm_runtime_resume(struct device *dev)
}
clk_prepare_enable(ctrl->hclk);
+ enable_irq(ctrl->irq);
if (ctrl->clock_stop_not_supported) {
reinit_completion(&ctrl->enumeration);
@@ -1747,6 +1748,7 @@ static int __maybe_unused swrm_runtime_suspend(struct device *dev)
}
}
+ disable_irq(ctrl->irq);
clk_disable_unprepare(ctrl->hclk);
usleep_range(300, 305);
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 124/703] memory: tegra: Shut down Tegra210 EMC timers before teardown
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (122 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 123/703] soundwire: qcom: disable the interrupt before gating the clock Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 125/703] memory: tegra: fix device_node leak in tegra186_mc_probe_device() Greg Kroah-Hartman
` (13 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ijae Kim, Myeonghun Pak, Sashiko,
Krzysztof Kozlowski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <mhun512@gmail.com>
[ Upstream commit c5f343c189aa30285e7c73dbf2f185720467794b ]
The training and refresh timers can outlive the EMC state on removal
or probe failure after clock attachment, causing use-after-free.
Shut down both timers before detaching the clock provider and releasing
the timing tables to wait for callbacks and prevent rearming. Initialize
them before clock attachment, since set_rate() can start training.
Fixes: 10de21148f7d ("memory: tegra: Add EMC scaling support code for Tegra210")
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-47538f77-fb50-4a06-b49b-92dbee8b538b
Link: https://patch.msgid.link/20261015002852.2159841-1-mhun512@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/memory/tegra/tegra210-emc-core.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegra/tegra210-emc-core.c
index e96ca4157d481..d7939d20dbccf 100644
--- a/drivers/memory/tegra/tegra210-emc-core.c
+++ b/drivers/memory/tegra/tegra210-emc-core.c
@@ -1947,12 +1947,6 @@ static int tegra210_emc_probe(struct platform_device *pdev)
config->same_freq = true;
}
- err = tegra210_clk_emc_attach(emc->clk, &emc->provider);
- if (err < 0) {
- dev_err(&pdev->dev, "failed to attach to EMC clock: %d\n", err);
- goto release;
- }
-
emc->clkchange_delay = 100;
emc->training_interval = 100;
dev_set_drvdata(emc->dev, emc);
@@ -1964,6 +1958,12 @@ static int tegra210_emc_probe(struct platform_device *pdev)
timer_setup(&emc->training, tegra210_emc_train, 0);
+ err = tegra210_clk_emc_attach(emc->clk, &emc->provider);
+ if (err < 0) {
+ dev_err(&pdev->dev, "failed to attach to EMC clock: %d\n", err);
+ goto release;
+ }
+
tegra210_emc_debugfs_init(emc);
cd = devm_thermal_of_cooling_device_register(emc->dev, np, "emc", emc,
@@ -1979,6 +1979,8 @@ static int tegra210_emc_probe(struct platform_device *pdev)
detach:
debugfs_remove_recursive(emc->debugfs.root);
+ timer_shutdown_sync(&emc->training);
+ timer_shutdown_sync(&emc->refresh_timer);
tegra210_clk_emc_detach(emc->clk);
release:
of_reserved_mem_device_release(emc->dev);
@@ -1991,6 +1993,8 @@ static void tegra210_emc_remove(struct platform_device *pdev)
struct tegra210_emc *emc = platform_get_drvdata(pdev);
debugfs_remove_recursive(emc->debugfs.root);
+ timer_shutdown_sync(&emc->training);
+ timer_shutdown_sync(&emc->refresh_timer);
tegra210_clk_emc_detach(emc->clk);
of_reserved_mem_device_release(emc->dev);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 125/703] memory: tegra: fix device_node leak in tegra186_mc_probe_device()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (123 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 124/703] memory: tegra: Shut down Tegra210 EMC timers before teardown Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 126/703] irqchip/gic-v4: Clear the domain and fwnode pointers after freeing them Greg Kroah-Hartman
` (12 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Selby Mashiki, Krzysztof Kozlowski,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selby Mashiki <mashikiselby@gmail.com>
[ Upstream commit 21250426a8469d3bc43c2f0c69ed5497ee9ff7d4 ]
tegra186_mc_probe_device() iterates over the "interconnects" phandles
using of_parse_phandle_with_args(), which increments the reference count
of args.np on each successful call, but never drops the reference with
of_node_put(args.np).
Call of_node_put(args.np) at the end of each loop iteration.
Fixes: fe3b082a6eb8 ("memory: tegra: Add SID override programming for MC clients")
Signed-off-by: Selby Mashiki <mashikiselby@gmail.com>
Link: https://patch.msgid.link/20261025190322.449324-1-mashikiselby@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/memory/tegra/tegra186.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
index aee11457bf8e0..f8849e827978f 100644
--- a/drivers/memory/tegra/tegra186.c
+++ b/drivers/memory/tegra/tegra186.c
@@ -147,6 +147,7 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
}
}
+ of_node_put(args.np);
index++;
}
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 126/703] irqchip/gic-v4: Clear the domain and fwnode pointers after freeing them
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (124 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 125/703] memory: tegra: fix device_node leak in tegra186_mc_probe_device() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 127/703] irqchip/gic-v4: Unwind what its_alloc_vcpu_irqs() allocated on failure Greg Kroah-Hartman
` (11 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Yao, Fuad Tabba, Marc Zyngier,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fuad Tabba <fuad.tabba@linux.dev>
[ Upstream commit 861bebd1fac5f5a25c11e40aec3c3291542045d1 ]
The GICv4 allocation and teardown paths free their irq domains and
fwnodes but leave the pointers set, and the allocation error paths test
those pointers before removing them. struct its_vm and struct its_vpe
are embedded in KVM's per-VM and per-vCPU state, so nothing re-zeroes
them between two attempts, and an error path taken after an earlier one
already freed the domain calls irq_domain_remove() on freed memory.
Reaching this takes two allocation failures, one to leave the stale
pointer behind and one to send the next attempt down the error path.
Fixes: 7de5c0af9c7c ("irqchip/gic-v4: Add per-VM VPE domain creation")
Fixes: 6d31b6ff985d ("irqchip/gic-v4.1: Add VSGI allocation/teardown")
Reviewed-by: Yuan Yao <yaoyuan@linux.alibaba.com>
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Link: https://patch.msgid.link/20260921072958.2918477-2-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-gic-v4.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v4.c b/drivers/irqchip/irq-gic-v4.c
index 8455b4a5fbb0d..754839e409f88 100644
--- a/drivers/irqchip/irq-gic-v4.c
+++ b/drivers/irqchip/irq-gic-v4.c
@@ -147,10 +147,14 @@ static int its_alloc_vcpu_sgis(struct its_vpe *vpe, int idx)
return 0;
err:
- if (vpe->sgi_domain)
+ if (vpe->sgi_domain) {
irq_domain_remove(vpe->sgi_domain);
- if (vpe->fwnode)
+ vpe->sgi_domain = NULL;
+ }
+ if (vpe->fwnode) {
irq_domain_free_fwnode(vpe->fwnode);
+ vpe->fwnode = NULL;
+ }
kfree(name);
return -ENOMEM;
}
@@ -191,10 +195,14 @@ int its_alloc_vcpu_irqs(struct its_vm *vm)
return 0;
err:
- if (vm->domain)
+ if (vm->domain) {
irq_domain_remove(vm->domain);
- if (vm->fwnode)
+ vm->domain = NULL;
+ }
+ if (vm->fwnode) {
irq_domain_free_fwnode(vm->fwnode);
+ vm->fwnode = NULL;
+ }
return -ENOMEM;
}
@@ -215,6 +223,8 @@ static void its_free_sgi_irqs(struct its_vm *vm)
irq_domain_free_irqs(irq, 16);
irq_domain_remove(vm->vpes[i]->sgi_domain);
irq_domain_free_fwnode(vm->vpes[i]->fwnode);
+ vm->vpes[i]->sgi_domain = NULL;
+ vm->vpes[i]->fwnode = NULL;
}
}
@@ -224,6 +234,8 @@ void its_free_vcpu_irqs(struct its_vm *vm)
irq_domain_free_irqs(vm->vpes[0]->irq, vm->nr_vpes);
irq_domain_remove(vm->domain);
irq_domain_free_fwnode(vm->fwnode);
+ vm->domain = NULL;
+ vm->fwnode = NULL;
}
static int its_send_vpe_cmd(struct its_vpe *vpe, struct its_cmd_info *info)
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 127/703] irqchip/gic-v4: Unwind what its_alloc_vcpu_irqs() allocated on failure
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (125 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 126/703] irqchip/gic-v4: Clear the domain and fwnode pointers after freeing them Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 128/703] reset: scmi: Set the device for the reset controller Greg Kroah-Hartman
` (10 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yuan Yao, Fuad Tabba, Marc Zyngier,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fuad Tabba <fuad.tabba@linux.dev>
[ Upstream commit fd86d69c951765e24e89a162c53dfe33a8aba976 ]
A failure in the its_alloc_vcpu_sgis() loop leaves behind both the SGI
domains created for the vPEs below the failing index and the vPE irqs
allocated before the loop, since irq_domain_remove() frees neither. Each
leaked vPE takes its ITS state with it, a vpe_id and an LPI pending
table.
Free both from a second label before the existing unwind. With the
freed pointers now cleared, its_free_sgi_irqs() can skip a vPE with no
SGI domain and be reused there. The check has to precede the lookup:
irq_find_mapping(NULL, 0) falls back to irq_default_domain, and the
live irq it returns would then be freed.
Fixes: 6d31b6ff985d ("irqchip/gic-v4.1: Add VSGI allocation/teardown")
Reviewed-by: Yuan Yao <yaoyuan@linux.alibaba.com>
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Link: https://patch.msgid.link/20260921072958.2918477-3-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-gic-v4.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v4.c b/drivers/irqchip/irq-gic-v4.c
index 754839e409f88..f707a3cb281aa 100644
--- a/drivers/irqchip/irq-gic-v4.c
+++ b/drivers/irqchip/irq-gic-v4.c
@@ -159,6 +159,8 @@ static int its_alloc_vcpu_sgis(struct its_vpe *vpe, int idx)
return -ENOMEM;
}
+static void its_free_sgi_irqs(struct its_vm *vm);
+
int its_alloc_vcpu_irqs(struct its_vm *vm)
{
int vpe_base_irq, i;
@@ -189,11 +191,14 @@ int its_alloc_vcpu_irqs(struct its_vm *vm)
vm->vpes[i]->irq = vpe_base_irq + i;
ret = its_alloc_vcpu_sgis(vm->vpes[i], i);
if (ret)
- goto err;
+ goto err_free_irqs;
}
return 0;
+err_free_irqs:
+ its_free_sgi_irqs(vm);
+ irq_domain_free_irqs(vpe_base_irq, vm->nr_vpes);
err:
if (vm->domain) {
irq_domain_remove(vm->domain);
@@ -215,8 +220,13 @@ static void its_free_sgi_irqs(struct its_vm *vm)
return;
for (i = 0; i < vm->nr_vpes; i++) {
- unsigned int irq = irq_find_mapping(vm->vpes[i]->sgi_domain, 0);
+ unsigned int irq;
+
+ /* irq_find_mapping() falls back to the default domain on NULL. */
+ if (!vm->vpes[i]->sgi_domain)
+ continue;
+ irq = irq_find_mapping(vm->vpes[i]->sgi_domain, 0);
if (WARN_ON(!irq))
continue;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 128/703] reset: scmi: Set the device for the reset controller
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (126 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 127/703] irqchip/gic-v4: Unwind what its_alloc_vcpu_irqs() allocated on failure Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 129/703] irqchip/gic-v4: Use a separate lockdep class for vPE doorbell IRQs Greg Kroah-Hartman
` (9 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kunihiko Hayashi, Sudeep Holla,
Philipp Zabel, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
[ Upstream commit e3e068a457cebe2e475535685c325d5ca305f44a ]
SCMI reset driver does not set rcdev.dev when registering its reset
controller.
If rcdev.of_node is not available, the reset core tries to obtain
the firmware node from rcdev.dev. However, rcdev.dev is also NULL,
causing a NULL pointer dereference.
Set rcdev.dev to the SCMI device.
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org>
Fixes: c8ae9c2da1cc ("reset: Add support for resets provided by SCMI")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/reset/reset-scmi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/reset/reset-scmi.c b/drivers/reset/reset-scmi.c
index 4335811e0cfaa..0fdf593b09e24 100644
--- a/drivers/reset/reset-scmi.c
+++ b/drivers/reset/reset-scmi.c
@@ -107,6 +107,7 @@ static int scmi_reset_probe(struct scmi_device *sdev)
data->rcdev.ops = &scmi_reset_ops;
data->rcdev.owner = THIS_MODULE;
+ data->rcdev.dev = dev;
data->rcdev.of_node = np;
data->rcdev.nr_resets = reset_ops->num_domains_get(ph);
data->ph = ph;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 129/703] irqchip/gic-v4: Use a separate lockdep class for vPE doorbell IRQs
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (127 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 128/703] reset: scmi: Set the device for the reset controller Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 130/703] reset: spacemit: Fix the RCPU2 PWM reset registers Greg Kroah-Hartman
` (8 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Colton Lewis, Marc Zyngier,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colton Lewis <coltonlewis@google.com>
[ Upstream commit 7100185bdc1162eb2eca1dd20a036314e27f1561 ]
By default, init_desc() assigns the shared irq_desc_lock_class lockdep
key to desc->lock for every struct irq_desc. Device drivers that
register an IRQ affinity notifier establish a lock dependency chain of
&irq_desc_lock_class --> &pool->lock --> &p->pi_lock --> &rq->__lock
when irq_set_affinity_locked() calls schedule_work() while holding
desc->lock.
On GICv4 systems, scheduling out a KVM vCPU calls kvm_sched_out() ->
kvm_arch_vcpu_put() -> vgic_v3_put() -> vgic_v4_put() ->
its_make_vpe_non_resident() -> irq_set_vcpu_affinity() while holding the
scheduler runqueue lock (&rq->__lock). Acquiring the vPE doorbell IRQ's
desc->lock establishes &rq->__lock --> &irq_desc_lock_class, triggering
a lockdep circular locking splat:
WARNING: possible circular locking dependency detected
------------------------------------------------------
VCPU-0/109705 is trying to acquire lock:
ffff0001e41e4cc8 (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0x5c/0xb0
but task is already holding lock:
ffff00dad15fd260 (&rq->__lock){-.-.}-{2:2}, at: __schedule+0x23c/0x1850
which lock already depends on the new lock.
Chain exists of:
&irq_desc_lock_class --> &p->pi_lock --> &rq->__lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&rq->__lock);
lock(&p->pi_lock);
lock(&rq->__lock);
lock(&irq_desc_lock_class);
GICv4 vPE doorbell IRQs are internal to KVM and GICv4, set
IRQ_NO_BALANCING, and never register an affinity notifier or queue work
under desc->lock. However, under forced IRQ threading (threadirqs or
CONFIG_PREEMPT_RT), request_irq() creates an IRQ thread for the doorbell
handler, causing irq_set_affinity() -> irq_set_thread_affinity() in
vgic_v4_load() to call wake_up_process() under desc->lock and establish
a real desc->lock --> &p->pi_lock --> &rq->__lock dependency on the vPE
doorbell IRQ itself.
Mark vPE doorbell IRQs with irq_set_nothread() so they are never
force-threaded, and assign them a dedicated lockdep class in
its_alloc_vcpu_irqs() via irq_set_lockdep_class().
Fixes: 8e01d9a396e6 ("KVM: arm64: vgic-v4: Move the GICv4 residency flow to be driven by vcpu_load/put")
Signed-off-by: Colton Lewis <coltonlewis@google.com>
Link: https://patch.msgid.link/20261027180610.2840837-1-coltonlewis@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-gic-v4.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/irqchip/irq-gic-v4.c b/drivers/irqchip/irq-gic-v4.c
index f707a3cb281aa..019aa0ded1bf9 100644
--- a/drivers/irqchip/irq-gic-v4.c
+++ b/drivers/irqchip/irq-gic-v4.c
@@ -163,6 +163,8 @@ static void its_free_sgi_irqs(struct its_vm *vm);
int its_alloc_vcpu_irqs(struct its_vm *vm)
{
+ static struct lock_class_key vpe_irq_lock_class;
+ static struct lock_class_key vpe_irq_request_class;
int vpe_base_irq, i;
vm->fwnode = irq_domain_alloc_named_id_fwnode("GICv4-vpe",
@@ -189,6 +191,9 @@ int its_alloc_vcpu_irqs(struct its_vm *vm)
for (i = 0; i < vm->nr_vpes; i++) {
int ret;
vm->vpes[i]->irq = vpe_base_irq + i;
+ irq_set_lockdep_class(vm->vpes[i]->irq, &vpe_irq_lock_class,
+ &vpe_irq_request_class);
+ irq_set_nothread(vm->vpes[i]->irq);
ret = its_alloc_vcpu_sgis(vm->vpes[i], i);
if (ret)
goto err_free_irqs;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 130/703] reset: spacemit: Fix the RCPU2 PWM reset registers
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (128 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 129/703] irqchip/gic-v4: Use a separate lockdep class for vPE doorbell IRQs Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 131/703] drm/msm/gem: Fix VM_BIND range check Greg Kroah-Hartman
` (7 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hung-Chun Tseng, Yixun Lan,
Troy Mitchell, Philipp Zabel, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
[ Upstream commit 168cae7e87463c34758db2b51537937a29b753f1 ]
Every entry in k1_rcpu2_resets[] uses RCPU2_PWM9_CLK_RST, so asserting
or deasserting the reset of any RCPU2 PWM from 0 to 8 acts on PWM9
instead. Each PWM has its own register, RCPU2_PWMn_CLK_RST at offset
4 * n, as k1-syscon.h already defines.
On a Milk-V Jupiter running the vendor kernel, which uses RCPU2 PWM2
for the fan, the RCPU2 registers read:
0x00: 0x4 0x04: 0x4 0x08: 0x1 0x0c: 0x4 ... 0x24: 0x4
Only PWM2's register has its reset deasserted, which matches one
register per PWM.
Use the matching register for each reset. No in-tree device tree uses
the RCPU2 PWMs yet, so this has no effect on current boards, but it
would break the first one that does.
Build-tested only (riscv defconfig, W=1); the fix could not be tested
at runtime, as mainline has no RCPU2 PWM node to exercise it.
Fixes: c479d7cf06c3 ("reset: spacemit: add support for SpacemiT CCU resets")
Signed-off-by: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
Reviewed-by: Yixun Lan <dlan@kernel.org>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/reset/reset-spacemit.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/reset/reset-spacemit.c b/drivers/reset/reset-spacemit.c
index e1272aff28f74..b2eee02d0ae83 100644
--- a/drivers/reset/reset-spacemit.c
+++ b/drivers/reset/reset-spacemit.c
@@ -182,15 +182,15 @@ static const struct ccu_reset_controller_data k1_rcpu_reset_data = {
};
static const struct ccu_reset_data k1_rcpu2_resets[] = {
- [RESET_RCPU2_PWM0] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
- [RESET_RCPU2_PWM1] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
- [RESET_RCPU2_PWM2] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
- [RESET_RCPU2_PWM3] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
- [RESET_RCPU2_PWM4] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
- [RESET_RCPU2_PWM5] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
- [RESET_RCPU2_PWM6] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
- [RESET_RCPU2_PWM7] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
- [RESET_RCPU2_PWM8] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM0] = RESET_DATA(RCPU2_PWM0_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM1] = RESET_DATA(RCPU2_PWM1_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM2] = RESET_DATA(RCPU2_PWM2_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM3] = RESET_DATA(RCPU2_PWM3_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM4] = RESET_DATA(RCPU2_PWM4_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM5] = RESET_DATA(RCPU2_PWM5_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM6] = RESET_DATA(RCPU2_PWM6_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM7] = RESET_DATA(RCPU2_PWM7_CLK_RST, BIT(2), BIT(0)),
+ [RESET_RCPU2_PWM8] = RESET_DATA(RCPU2_PWM8_CLK_RST, BIT(2), BIT(0)),
[RESET_RCPU2_PWM9] = RESET_DATA(RCPU2_PWM9_CLK_RST, BIT(2), BIT(0)),
};
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 131/703] drm/msm/gem: Fix VM_BIND range check
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (129 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 130/703] reset: spacemit: Fix the RCPU2 PWM reset registers Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 132/703] drm/msm: Remove abuse of drm_exec internals Greg Kroah-Hartman
` (6 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Dmitry Baryshkov,
Rob Clark, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Clark <robin.clark@oss.qualcomm.com>
[ Upstream commit 4f0af27c3aef5a9480712cbac4bee14f7509ae5f ]
Use size_add() to guard against overflow.
Reported-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Fixes: 3a3bef68a6c1 ("drm/msm: Fix missing VM_BIND offset/range validation")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/765329/
Message-ID: <20261102172001.508440-2-robin.clark@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/msm_gem_vma.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c
index faccb9a77fbe6..d00b4ffeb23f6 100644
--- a/drivers/gpu/drm/msm/msm_gem_vma.c
+++ b/drivers/gpu/drm/msm/msm_gem_vma.c
@@ -993,10 +993,10 @@ lookup_op(struct msm_vm_bind_job *job, const struct drm_msm_vm_bind_op *op)
if (invalid_alignment(op->iova))
ret = UERR(EINVAL, dev, "invalid address: %016llx\n", op->iova);
- if (invalid_alignment(op->obj_offset))
+ if (invalid_alignment(op->obj_offset) || (op->obj_offset > SIZE_MAX))
ret = UERR(EINVAL, dev, "invalid bo_offset: %016llx\n", op->obj_offset);
- if (invalid_alignment(op->range))
+ if (invalid_alignment(op->range) || (op->range > SIZE_MAX) || !op->range)
ret = UERR(EINVAL, dev, "invalid range: %016llx\n", op->range);
if (!drm_gpuvm_range_valid(job->vm, op->iova, op->range))
@@ -1099,7 +1099,7 @@ vm_bind_job_lookup_ops(struct msm_vm_bind_job *job, struct drm_msm_vm_bind *args
op->obj = obj;
cnt++;
- if ((op->range + op->obj_offset) > obj->size) {
+ if (size_add(op->range, op->obj_offset) > obj->size) {
ret = UERR(EINVAL, dev, "invalid range: %016llx + %016llx > %016zx\n",
op->range, op->obj_offset, obj->size);
goto out_unlock;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 132/703] drm/msm: Remove abuse of drm_exec internals
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (130 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 131/703] drm/msm/gem: Fix VM_BIND range check Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 133/703] drm/msm/gem: Disallow nr_bos for VM_BIND contexts Greg Kroah-Hartman
` (5 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Hellström,
Christian König, Rob Clark, Rob Clark, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellström <thomas.hellstrom@linux.intel.com>
[ Upstream commit 8c0e0b4628e5fd98bc614378f1aff4c1c8c26310 ]
The code was reading drm_exec internal state to determine whether
the drm_exec structure had been initialized or not, and therefore
needed cleaning up, relying on undocumented behaviour.
Instead add a bool to struct msm_gem_submit to indicate whether
drm_exec cleaning up is needed.
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/715502/
Message-ID: <20260331092023.81616-3-thomas.hellstrom@linux.intel.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Stable-dep-of: b3b44f7508c7 ("drm/msm/gem: Disallow nr_bos for VM_BIND contexts")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/msm_gem.h | 1 +
drivers/gpu/drm/msm/msm_gem_submit.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/msm_gem.h b/drivers/gpu/drm/msm/msm_gem.h
index 1bf228d0f8dab..fb6992353536b 100644
--- a/drivers/gpu/drm/msm/msm_gem.h
+++ b/drivers/gpu/drm/msm/msm_gem.h
@@ -458,6 +458,7 @@ struct msm_gem_submit {
bool bos_pinned : 1;
bool fault_dumped:1;/* Limit devcoredump dumping to one per submit */
bool in_rb : 1; /* "sudo" mode, copy cmds into RB */
+ bool has_exec : 1; /* @exec is initialized. */
struct msm_ringbuffer *ring;
unsigned int nr_cmds;
unsigned int nr_bos;
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index 2b6b5297f0592..d55897c358371 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -281,6 +281,7 @@ static int submit_lock_objects_vmbind(struct msm_gem_submit *submit)
int ret = 0;
drm_exec_init(&submit->exec, flags, submit->nr_bos);
+ submit->has_exec = true;
drm_exec_until_all_locked (&submit->exec) {
ret = drm_gpuvm_prepare_vm(submit->vm, exec, 1);
@@ -307,6 +308,7 @@ static int submit_lock_objects(struct msm_gem_submit *submit)
return submit_lock_objects_vmbind(submit);
drm_exec_init(&submit->exec, flags, submit->nr_bos);
+ submit->has_exec = true;
drm_exec_until_all_locked (&submit->exec) {
ret = drm_exec_lock_obj(&submit->exec,
@@ -526,7 +528,7 @@ static void submit_cleanup(struct msm_gem_submit *submit, bool error)
if (error)
submit_unpin_objects(submit);
- if (submit->exec.objects)
+ if (submit->has_exec)
drm_exec_fini(&submit->exec);
/* if job wasn't enqueued to scheduler, early retirement: */
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 133/703] drm/msm/gem: Disallow nr_bos for VM_BIND contexts
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (131 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 132/703] drm/msm: Remove abuse of drm_exec internals Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 134/703] drm/msm/gem: Decrement loop idx if handle lookup fails Greg Kroah-Hartman
` (4 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Baryshkov, Rob Clark,
Konrad Dybcio, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Clark <robin.clark@oss.qualcomm.com>
[ Upstream commit b3b44f7508c7f01273ba773595b7787883ceb4e0 ]
If using VM_BIND, it is invalid to attach BOs to a GEM_SUBMIT ioctl.
Only the VM_BIND ioctl should be used for binding objects.
Fixes: 2e6a8a1fe2b2 ("drm/msm: Add VM_BIND ioctl")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/765330/
Message-ID: <20261102172001.508440-3-robin.clark@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/msm_gem_submit.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index d55897c358371..2997b98b6f874 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -280,7 +280,7 @@ static int submit_lock_objects_vmbind(struct msm_gem_submit *submit)
struct drm_exec *exec = &submit->exec;
int ret = 0;
- drm_exec_init(&submit->exec, flags, submit->nr_bos);
+ drm_exec_init(&submit->exec, flags, 0);
submit->has_exec = true;
drm_exec_until_all_locked (&submit->exec) {
@@ -593,6 +593,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
return -EINVAL;
}
+ if (msm_context_is_vmbind(ctx) && args->nr_bos)
+ return UERR(EINVAL, dev, "invalid nr_bos, must be zero for VM_BIND contexts");
+
queue = msm_submitqueue_get(ctx, args->queueid);
if (!queue)
return -ENOENT;
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 134/703] drm/msm/gem: Decrement loop idx if handle lookup fails
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (132 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 133/703] drm/msm/gem: Disallow nr_bos for VM_BIND contexts Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 135/703] drm/msm/gem: Clear nr_ops in lookup_ops() failure path Greg Kroah-Hartman
` (3 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rob Clark, Konrad Dybcio,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Clark <robin.clark@oss.qualcomm.com>
[ Upstream commit 31708945d3647ad29f91def9d40dafa149ac66f1 ]
In the out_unlock unlock loop, we should skip the op which still has the
gem handle instead of gem obj ptr.
Fixes: 2e6a8a1fe2b2 ("drm/msm: Add VM_BIND ioctl")
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/765328/
Message-ID: <20261102172001.508440-4-robin.clark@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/msm_gem_vma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c
index d00b4ffeb23f6..c4dc0ad036b66 100644
--- a/drivers/gpu/drm/msm/msm_gem_vma.c
+++ b/drivers/gpu/drm/msm/msm_gem_vma.c
@@ -1091,6 +1091,7 @@ vm_bind_job_lookup_ops(struct msm_vm_bind_job *job, struct drm_msm_vm_bind *args
obj = idr_find(&file->object_idr, op->handle);
if (!obj) {
ret = UERR(EINVAL, dev, "invalid handle %u at index %u\n", op->handle, i);
+ i--;
goto out_unlock;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 135/703] drm/msm/gem: Clear nr_ops in lookup_ops() failure path
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (133 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 134/703] drm/msm/gem: Decrement loop idx if handle lookup fails Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 136/703] drm/msm: Fix a lock leak in msm_ioctl_gem_info_set_metadata() Greg Kroah-Hartman
` (2 subsequent siblings)
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rob Clark, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Clark <robin.clark@oss.qualcomm.com>
[ Upstream commit b22f5d783eadbebe90481db0c48cecf719e71dad ]
We've already dropped the references taken in the handle lookup loop, so
we don't want to drop them again in msm_vma_job_free().
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Fixes: 2e6a8a1fe2b2 ("drm/msm: Add VM_BIND ioctl")
Patchwork: https://patchwork.freedesktop.org/patch/765324/
Message-ID: <20261102172001.508440-5-robin.clark@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/msm_gem_vma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/msm_gem_vma.c b/drivers/gpu/drm/msm/msm_gem_vma.c
index c4dc0ad036b66..bd3408fcb241d 100644
--- a/drivers/gpu/drm/msm/msm_gem_vma.c
+++ b/drivers/gpu/drm/msm/msm_gem_vma.c
@@ -1069,7 +1069,6 @@ vm_bind_job_lookup_ops(struct msm_vm_bind_job *job, struct drm_msm_vm_bind *args
}
if (ret) {
- job->nr_ops = 0;
goto out;
}
@@ -1124,6 +1123,9 @@ vm_bind_job_lookup_ops(struct msm_vm_bind_job *job, struct drm_msm_vm_bind *args
}
}
out:
+ if (ret)
+ job->nr_ops = 0;
+
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 136/703] drm/msm: Fix a lock leak in msm_ioctl_gem_info_set_metadata()
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (134 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 135/703] drm/msm/gem: Clear nr_ops in lookup_ops() failure path Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 137/703] selftests: drivers/s390x: Select uvdevice tests using the target architecture Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 138/703] phy: ingenic: fix unbalanced regulator disable in exit Greg Kroah-Hartman
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bart Van Assche, Rob Clark,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit 1e59855738454b14021b64115f0090eafc7526ae ]
If krealloc() fails, msm_ioctl_gem_info_set_metadata() returns without
unlocking the GEM object. Fix this by jumping to a new label that
unlocks the GEM object before the buffer is freed. This bug has been
detected by the Clang thread-safety analyzer.
Fixes: 1c8c354098ea ("drm/msm: Add error handling for krealloc in metadata setup")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Patchwork: https://patchwork.freedesktop.org/patch/763272/
Message-ID: <9671164f87138a0caf5c69b66129bbd6faf932f8.1793044688.git.bvanassche@acm.org>
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/msm/msm_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 8094e5e7e9a54..2eb5a8520e0eb 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -493,13 +493,14 @@ static int msm_ioctl_gem_info_set_metadata(struct drm_gem_object *obj,
krealloc(msm_obj->metadata, metadata_size, GFP_KERNEL);
if (!new_metadata) {
ret = -ENOMEM;
- goto out;
+ goto unlock;
}
msm_obj->metadata = new_metadata;
msm_obj->metadata_size = metadata_size;
memcpy(msm_obj->metadata, buf, metadata_size);
+unlock:
msm_gem_unlock(obj);
out:
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 137/703] selftests: drivers/s390x: Select uvdevice tests using the target architecture
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (135 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 136/703] drm/msm: Fix a lock leak in msm_ioctl_gem_info_set_metadata() Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 138/703] phy: ingenic: fix unbalanced regulator disable in exit Greg Kroah-Hartman
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sasha Levin, Steffen Eiden,
Christian Borntraeger
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sashal@kernel.org>
[ Upstream commit 62aef2c04e0e69a9b88affa74ff699ce5c4e8652 ]
The uvdevice Makefile decides whether to build its test from uname -m,
which describes the build host. A cross build for s390 on another host
therefore silently omits the test, while the non-s390 branch provides
no-op build and installation targets but no emit_tests target.
Select the test from the target ARCH when it is given and from the
host's SUBARCH otherwise, accepting both the s390 and s390x spellings,
and include lib.mk unconditionally so that other architectures build,
install and emit an empty runlist. ARCH itself is left unset so that a
native LLVM=1 build keeps using the compiler's native target.
Drop the include path derived from tools/arch/$(ARCH): the test only
needs asm/uvdevice.h from the installed kernel headers, and the path
does not exist for the s390x spelling.
Fixes: cbac924200b8 ("selftests: drivers/s390x: Add uvdevice tests")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../selftests/drivers/s390x/uvdevice/Makefile | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/tools/testing/selftests/drivers/s390x/uvdevice/Makefile b/tools/testing/selftests/drivers/s390x/uvdevice/Makefile
index 755d164384c46..586a9aa6fb158 100644
--- a/tools/testing/selftests/drivers/s390x/uvdevice/Makefile
+++ b/tools/testing/selftests/drivers/s390x/uvdevice/Makefile
@@ -1,20 +1,13 @@
include ../../../../../build/Build.include
-UNAME_M := $(shell uname -m)
-
-ifneq ($(UNAME_M),s390x)
-nothing:
-.PHONY: all clean run_tests install
-.SILENT:
-else
+top_srcdir ?= ../../../../../..
+include $(top_srcdir)/scripts/subarch.include
+ARCH_PROCESSED := $(or $(ARCH),$(SUBARCH))
+ifneq (,$(filter s390 s390x,$(ARCH_PROCESSED)))
TEST_GEN_PROGS := test_uvdevice
-top_srcdir ?= ../../../../../..
-LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
-
-CFLAGS += -Wall -Werror -static $(KHDR_INCLUDES) -I$(LINUX_TOOL_ARCH_INCLUDE)
+CFLAGS += -Wall -Werror -static $(KHDR_INCLUDES)
+endif
include ../../../lib.mk
-
-endif
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
* [PATCH 6.18 138/703] phy: ingenic: fix unbalanced regulator disable in exit
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
` (136 preceding siblings ...)
2026-12-04 10:00 ` [PATCH 6.18 137/703] selftests: drivers/s390x: Select uvdevice tests using the target architecture Greg Kroah-Hartman
@ 2026-12-04 10:00 ` Greg Kroah-Hartman
137 siblings, 0 replies; 139+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-04 10:00 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Felix Gu, Manivannan Sadhasivam,
Paul Cercueil, Olivier Louvignes, H. Nikolaus Schaller,
Vinod Koul, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 71c1be5cc4e083852c8437bd6afcb99ee3050e8e ]
exit() and power_off() both disable vcc_supply, so the regulator
gets disabled twice for every power cycle, causing an unbalanced
disable WARN.
Drop the regulator_disable() call from the exit callback and leave
the regulator to the power_on/power_off pair.
Fixes: 31de313dfdcf ("PHY: Ingenic: Add USB PHY driver using generic PHY framework.")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: Olivier Louvignes <olivier@mgcrea.io>
Reviewed-By: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://patch.msgid.link/20260906-ingenic-v1-1-2311f3df8ddc@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/ingenic/phy-ingenic-usb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/phy/ingenic/phy-ingenic-usb.c b/drivers/phy/ingenic/phy-ingenic-usb.c
index 7e62d46850fda..d8e5ef302b748 100644
--- a/drivers/phy/ingenic/phy-ingenic-usb.c
+++ b/drivers/phy/ingenic/phy-ingenic-usb.c
@@ -124,7 +124,6 @@ static int ingenic_usb_phy_exit(struct phy *phy)
struct ingenic_usb_phy *priv = phy_get_drvdata(phy);
clk_disable_unprepare(priv->clk);
- regulator_disable(priv->vcc_supply);
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 139+ messages in thread
end of thread, other threads:[~2026-12-04 10:55 UTC | newest]
Thread overview: 139+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 9:58 [PATCH 6.18 000/703] 6.18.67-rc1 review Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 001/703] drm/gem-dma: Support dedicated DMA device for allocation and mapping Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 002/703] mpls: add seqcount to protect the platform_label{,s} pair Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 003/703] netlink: do not free nlk->groups while lockless readers can use it Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 004/703] net: init shinfo->gso_segs from qdisc_pkt_len_init() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 005/703] net: pull headers in qdisc_pkt_len_segs_init() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 006/703] xfrm: Dont clobber inner headers when already set Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 007/703] net: harden qdisc_pkt_len_segs_init() against malicious GSO packets Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 008/703] net: reject a negative TCP header offset in qdisc_pkt_len_segs_init() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 009/703] sctp: validate cookie AUTH state before use Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 010/703] net/sched: codel: bound the dropping loop per dequeue call Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 011/703] net: flush skb_defer_nodes in dev_cpu_dead() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 012/703] ext4: teach ext4_meta_trans_blocks() about number of allocated extents Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 013/703] ext4: fix transaction overflow during writeback Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 014/703] bpf: Introduce jit_required flag and remove bpf_prog_has_kfunc_call() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 015/703] bpf: Reject programs with inlined helpers if JIT is not available Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 016/703] bpf: Disallow interpreter fallback for arena-related insns Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 017/703] bpf: Disallow interpreter fallback for BPF_ADDR_PERCPU insn Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 018/703] mm/mmzone: read each zoneref slot once when filtering by nodemask Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 019/703] mm/page_alloc: dont increase highatomic reserve after pcp alloc Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 020/703] mm/page_alloc: use existing highatomic reserves on the buddy fastpath Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 021/703] xprtrdma: serialize unmap_sync with xprt_disconnect Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 022/703] gve: Fix race between stats query and queue reconfig Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 023/703] gve: Block invalid ring sizes when device options are 0 Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 024/703] net: wait for in-flight device unregistrations before netns dismantle Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 025/703] ksmbd: pin parent dentries in SMB2 CREATE ACL path Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 026/703] ksmbd: refuse to read a handle that is not open for reading Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 027/703] tracing/probes: Fix BTF bitfield parsing and out-of-bounds buffer write Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 028/703] comedi: comedi_bond: Fix leak of opened device references Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 029/703] rust_binder: push BR_TRANSACTION_COMPLETE before BR_FAILED_REPLY Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 030/703] 8021q: use RCU for egress QoS mappings Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 031/703] 8021q: delete cleared " Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 032/703] Bluetooth: btusb: fix use-after-free in force_poll_sync Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 033/703] tools/bootconfig: Close only opened braces in compact output Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 034/703] ipv6: Remove IPV6_ADDRFORM Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 035/703] sched_ext: Read exit_kind before flushing in scx_flush_disable_work() Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 036/703] iio: proximity: sx9360: fix sampling frequency write and available range Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 037/703] kprobes: Switch ftrace ops when adding probe with post_handler Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 038/703] KEYS: Expand key->{datalen,quotalen} to unsigned int Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 039/703] keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP Greg Kroah-Hartman
2026-12-04 9:58 ` [PATCH 6.18 040/703] KEYS: Protect pkey method checks against type removal Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 041/703] btrfs: reject refs=0 subvolume without DEAD in SUBVOL_SYNC_WAIT Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 042/703] tcp: move __reqsk_free() out of line Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 043/703] tcp: free saved_syn after an RCU grace period Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 044/703] cgroup/cpuset: Correctly set isolated_cpus when switching partition state Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 045/703] arm64: suspend: rely on daif helpers to handle PMR Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 046/703] arm64: suspend: Only track cpuidle context for idle tasks Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 047/703] cpufreq: Avoid redundant target() calls for unchanged limits Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 048/703] cpufreq: Force passing target frequency to driver during resume Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 049/703] pNFS: avoid repeatedly cancelling I/O for the same lseg Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 050/703] watchdog: rz: Discard pm_runtime_put() return values Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 051/703] watchdog: rzv2h: Use pm_runtime_put_sync() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 052/703] watchdog: rzv2h: Drop runtime PM handling from WDTDCR init Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 053/703] hwmon: (nct6775) Handle dual use registers Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 054/703] s390/dasd: Fix typo immediatly -> immediately Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 055/703] s390/dasd: Re-initialize RCD buffer with "V1.0" before every start Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 056/703] sched/core: Do not touch SMT siblings that have not joined the core yet Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 057/703] ksmbd: skip metadata-only opens in sharing checks Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 058/703] wifi: mac80211_hwsim: ignore non-generic netlink releases Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 059/703] gpio: mvebu: name regmaps to fix debugfs collisions Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 060/703] gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 061/703] gpio: keep the chip reference when deferred setup fails Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 062/703] cpufreq: Fix updates of cached resolved frequency and index Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 063/703] mm/page_alloc: retry allocations that raced with a zonelist rebuild Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 064/703] mm/hugetlb: retry the pool walk when the zonelist is rebuilt Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 065/703] page_alloc: allow migration of smaller hugepages during contig_alloc Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 066/703] mm/page_alloc: retry alloc_contig_pages() when the zonelist is rebuilt Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 067/703] mm: page_isolation: introduce page_is_unmovable() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 068/703] mm/memory_hotplug: fix possible race in scan_movable_pages() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 069/703] mm: page_isolation: do not take slab pages for free Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 070/703] mm: rejig pageblock mask definitions Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 071/703] mm/page_alloc: remove the zone_spans_pfn() check from get_pfnblock_bitmap_bitidx() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 072/703] Bluetooth: L2CAP: Only accept LE responses to outstanding requests Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 073/703] spi: tegra210-quad: Refactor error handling into helper functions Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 074/703] spi: tegra210-quad: Check hardware status on timeout Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 075/703] spi: tegra210-quad: Unmap DMA buffers on transfer timeout Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 076/703] sched_ext: Fix ops.enqueue/dispatch() calls before ops.cpu_online() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 077/703] Bluetooth: l2cap: defer conn param update to avoid conn->lock/hdev->lock inversion Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 078/703] Revert "mm/hugetlb_vmemmap: fix incorrect vmemmap restore in rollback" Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 079/703] dm cache: validate the discard block size before narrowing Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 080/703] dm: fix use-after-free when dm_get_device() widens the open mode Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 081/703] iio: adc: ad7923: add the AD7927 to the SPI ID table Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 082/703] iio: temperature: hid-sensor-temperature: Use per-instance callbacks Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 083/703] ACPI: PM: Avoid initializing power management for absent devices Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 084/703] Revert "ALSA: hda/realtek: Fix silent speaker on Higole F9B" Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 085/703] ovl: refactor ovl_lookup() Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 086/703] ovl: do not read the flags of a put upper dentry in lookup Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 087/703] ovl: fix leak of lowerdata redirect on ovl_get_inode() failure Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 088/703] ovl: do not check the deferred lowerdata redirect on index lookup Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 089/703] ovl: follow lower to lowerdata redirects from any lower layer Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 090/703] ovl: bump the impure dir version when linking a file with origin Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 091/703] smb: client: hold server ref while queueing reconnect work Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 092/703] smb: client: dont write back through O_DIRECT handles Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 093/703] smb: client: dont fail writeback preparation if the task is dying Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 094/703] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14 Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 095/703] usb: dwc3: Always deassert xilinx resets Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 096/703] usb: dwc3: xilinx: re-assert resets on ZynqMP init error paths Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 097/703] w1: w1_therm: lock the list of slaves for the bulk read Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 098/703] usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 099/703] iio: humidity: hid-sensor-humidity: Use per-instance callbacks Greg Kroah-Hartman
2026-12-04 9:59 ` [PATCH 6.18 100/703] iio: proximity: Remove redundant dev_err()/dev_err_probe() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 101/703] iio: proximity: hx9023s: Allocate trigger before requesting IRQ Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 102/703] ipvs: read flags and seqs in master atomically Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 103/703] ipvs: honor the overload state and do not enter it forever Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 104/703] drm/ast: Handle framebuffer from dma-buf Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 105/703] iio: common: fix spelling mistakes in comments Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 106/703] iio: inv_sensors: convert to kernel types Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 107/703] iio: inv_sensors: better timestamp alignment when using watermark Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 108/703] iio: inv_sensors: improve period measurement by using a longer delay Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 109/703] iio: inv_sensors: prevent timestamps going back in time in transitions Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 110/703] iio: inv_sensors: fix estimated value larger than interrupt timestamp Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 111/703] iio: inv_sensors: do not compute period estimation when updating odr Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 112/703] Revert "wifi: ath10k: Stop unanswered temperature reads" Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 113/703] tpm: Call cmd_ready/go_idle for each command transmission Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 114/703] firmware: arm_scmi: Update ARM_SCMI_HAVE_TRANSPORT rationale Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 115/703] firmware: arm_ffa: Compare notify_id when looking up notifier callbacks Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 116/703] firmware: smccc: Provide stubs for HAVE_ARM_SMCCC_DISCOVERY=n Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 117/703] irqchip/gic-v3: Select HAVE_ARM_SMCCC_DISCOVERY only on arm64 Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 118/703] HID: vivaldi: Extract feature report value directly in vivaldi_feature_mapping() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 119/703] HID: vivaldi: avoid redundant feature report reads per usage Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 120/703] firmware: arm_scmi: imx: Validate MISC control response size Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 121/703] firmware: arm_scmi: Unregister notifier on enable failure Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 122/703] firmware: arm_scmi: Free mailbox state on mapping failure Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 123/703] soundwire: qcom: disable the interrupt before gating the clock Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 124/703] memory: tegra: Shut down Tegra210 EMC timers before teardown Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 125/703] memory: tegra: fix device_node leak in tegra186_mc_probe_device() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 126/703] irqchip/gic-v4: Clear the domain and fwnode pointers after freeing them Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 127/703] irqchip/gic-v4: Unwind what its_alloc_vcpu_irqs() allocated on failure Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 128/703] reset: scmi: Set the device for the reset controller Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 129/703] irqchip/gic-v4: Use a separate lockdep class for vPE doorbell IRQs Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 130/703] reset: spacemit: Fix the RCPU2 PWM reset registers Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 131/703] drm/msm/gem: Fix VM_BIND range check Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 132/703] drm/msm: Remove abuse of drm_exec internals Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 133/703] drm/msm/gem: Disallow nr_bos for VM_BIND contexts Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 134/703] drm/msm/gem: Decrement loop idx if handle lookup fails Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 135/703] drm/msm/gem: Clear nr_ops in lookup_ops() failure path Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 136/703] drm/msm: Fix a lock leak in msm_ioctl_gem_info_set_metadata() Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 137/703] selftests: drivers/s390x: Select uvdevice tests using the target architecture Greg Kroah-Hartman
2026-12-04 10:00 ` [PATCH 6.18 138/703] phy: ingenic: fix unbalanced regulator disable in exit 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