linux-2.6-microblaze.git
2 weeks agoKVM: SVM: Serialize accesses to the owner and mirror list with separate lock
Paolo Bonzini [Thu, 6 Aug 2026 14:44:17 +0000 (16:44 +0200)]
KVM: SVM: Serialize accesses to the owner and mirror list with separate lock

Interaction between KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM and
KVM_CAP_VM_COPY_ENC_CONTEXT_FROM can cause two separate issues:

- in sev_migrate_from(), when the destination KVM is a mirror, the mirror
  entry is moved from the source's list to the owner's mirror_vms list,
  without holding the owner's lock unlike other writers of the owner's
  mirror list (sev_vm_copy_enc_context_from(), sev_vm_destroy()).
  A concurrent COPY or destroy can race with sev_migrate_from() and
  corrupt the list.

- In sev_vm_destroy(), the *owner* is still active and could receive
  concurrently a KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM that causes
  sev->enc_context_owner to change.  In this case the incorrect VM
  receives kvm_put_kvm().

The second issue needs particular care because the owner could disappear
altogether (even though the race window is impossibly small) between
reading it and locking it.  There is thus no way to perform the checks
under the owner lock without putting struct kvm under SLAB_TYPESAFE_BY_RCU
(which would allow kvm_get_kvm_safe() under RCU critical section).

It is much simpler to just use a global lock, since the critical
sections are so small and the new lock is always a leaf lock.

Fixes: b2125513dfc0 ("KVM: SEV: Allow SEV intra-host migration of VM with mirrors")
Cc: stable@vger.kernel.org
Reported-by: Shen Yongchao <grayhat@foxmail.com>
Link: https://lore.kernel.org/kvm/tencent_625C0F42824E542C72B34733392AF2C49709@qq.com/
Link: https://lore.kernel.org/kvm/tencent_DDC4E4352EC91CAC05A9A8F4E55E8C96730A@qq.com/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 weeks agoMerge tag 'kvm-s390-master-7.2-3' of https://git.kernel.org/pub/scm/linux/kernel...
Paolo Bonzini [Thu, 6 Aug 2026 13:47:46 +0000 (15:47 +0200)]
Merge tag 'kvm-s390-master-7.2-3' of https://git./linux/kernel/git/kvms390/linux into HEAD

KVM: s390: Misc fixes for 7.2

Fix a bunch of small issues that came up during the previous round of
fixes.

They are mostly extremely unlikely races, but they should be fixed
nonetheless.

2 weeks agoKVM: SVM: make svm_flush_tlb_gva do a full asid flush if NPT enabled
Paolo Bonzini [Thu, 23 Jul 2026 08:15:22 +0000 (10:15 +0200)]
KVM: SVM: make svm_flush_tlb_gva do a full asid flush if NPT enabled

Red Hat is seeing multiple reports of Windows memory corruptions
(and consequent BSODs) with hv-tlbflush=on, on AMD processors only.
The crashes, while extremely rare, happen even with a stock configuration,
but with Driver Verifier enabled they can be detected after approximately
200 VM hours.  In particular, Alexander Lougovski measured the following:

- on AMD Turin, 15 crashes in 3300 VM hours

- on AMD Milan, 2 crashes in 500 VM hours (there are fewer hours
  here due to the host being smaller)

- on Intel Sapphire Rapids, 0 crashes in 8000 VM hours

- on AMD Turin with full TLB flush (not exactly this patch but
  similar), no crashes in ~2 weeks of run time which should also
  be ~7000 VM hours

For Turin, the microcode version was 0x0b002162, which (assuming
this is the same issue) should not be affected by the problem listed in
https://knowledge.broadcom.com/external/article/419026/bsod-on-virtual-machines-running-on-amd.html;
on the other hand that problem should not apply to earlier processors.
AMD has not provided any information or analysis yet, and when we asked
we didn't know yet that it reproduced on Milan as well.

As to the workload, Alexander threw more or less everything at the same
time at the VM:

- a full Windows Defender scan every 30 minutes

- a disk I/O job

- a loop doing repeated mmap of system files (mostly to hope that
  it triggers some consistency check in the Windows memory manager)

- SQL Express 2022 + StressDB (1.6M rows), with the host doing queries
  (75% write/25% read) via sqlcmd

Driver Verifier is able to detect BSODs more or less at the same time as
the pages are freed.  They mostly happen in the Windows Defender filter
driver, but occasionally also in the networking stack (e.g., afd.sys)
or elsewhere in the filesystem stack (e.g., fltmgr.sys).

The flush is issued from kvm_hv_vcpu_flush_tlb(), which receives the
cross-CPU requests from the Hyper-V TLB flush hypercalls via a kfifo
and is invoked by the KVM_REQ_HV_TLB_FLUSH request.  The mechanism is
the same for both Intel and AMD, and the handler for both vendors is
a simple INVVPID(ADDR)/INVLPGA instruction.

Because the request is handled on the destination CPU, there is a question
of what happens if the VM is migrated across physical CPUs.  In that case,
the INVLPGA instruction would use a stale svm->vmcb->control.asid; but
if anything that might do an *unnecessary* flush (on an asid that's being
used for another VM) and then pre_svm_run() would force a full TLB rebuild.

So, for lack of better ideas, this patch forces a full ASID bump in
svm_flush_tlb_gva().  To avoid paying the price on Intel and also to
avoid unnecessary loops on AMD, the flush_tlb_gva op now returns whether
it did a full flush or not; kvm_hv_vcpu_flush_tlb() takes note and exits
its loops immediately.  While there is an obvious performance impact,
about half of the benefit from Hyper-V tlbflush is preserved (10% vs. 20%
on the SQL Server workload).

kvm_mmu_invalidate_addr() is the only other caller of the flush_tlb_gva op.
The change would have a performance impact on every intercepted INVLPG and,
for nested SVM, on every L1 INVLPGA.  For INVLPGA specifically, this covers
the same suspected issue but for nested hypervisors, so it is correct to
apply the workaround; for INVLPG on shadow paging, instead, the impact
would be stronger and, due to lack of data, for now the use of INVLPGA is
left in place in svm_flush_tlb_gva().

Analyzed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Analyzed-by: Alexander Lougovski <alougovs@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 weeks agoMerge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux
Linus Torvalds [Mon, 3 Aug 2026 19:26:51 +0000 (12:26 -0700)]
Merge tag 'fsverity-for-linus' of git://git./fs/fsverity/linux

Pull fsverity fix from Eric Biggers:
 "Fix a regression where truncating a file with fsverity enabled started
  being allowed on kernels without fsverity support"

* tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux:
  fs,fsverity: remove check for fsverity being enabled in setattr_prepare()

2 weeks agoMerge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux
Linus Torvalds [Mon, 3 Aug 2026 19:24:43 +0000 (12:24 -0700)]
Merge tag 'fscrypt-for-linus' of git://git./fs/fscrypt/linux

Pull fscrypt fix from Eric Biggers:
 "Fix a bug where FS_IOC_SET_ENCRYPTION_POLICY checked the original uid
  rather than the idmapped one"

* tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux:
  fscrypt: use the mount idmap for the owner check in fscrypt_ioctl_set_policy()

2 weeks agoMerge tag 'liveupdate-fixes-2026-08-03' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 3 Aug 2026 16:21:45 +0000 (09:21 -0700)]
Merge tag 'liveupdate-fixes-2026-08-03' of git://git./linux/kernel/git/liveupdate/linux

Pull liveupdate fix from Mike Rapoport:

 - fix a regression caused by allowing coexistence of KHO with deferred
   initialization of the memory map

* tag 'liveupdate-fixes-2026-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux:
  kho: align kho_scratch to MAX_ORDER_NR_PAGES pages

2 weeks agoMerge tag 'sched_ext-for-7.2-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 3 Aug 2026 15:55:50 +0000 (08:55 -0700)]
Merge tag 'sched_ext-for-7.2-rc6-fixes' of git://git./linux/kernel/git/tj/sched_ext

Pull sched_ext fixes from Tejun Heo:

 - More lifecycle fixes for the new sub-scheduler support: a failed
   enable could tear down a never-linked sub-scheduler in a way that
   races the root scheduler's disable and leads to a use-after-free,
   tasks that were not on the ext class could still get the enable
   callback, and a policy-rejection path silently rewrote a running
   task's scheduling policy instead of aborting the scheduler.

 - Scheduler enable/disable could deadlock with cgroup removal and a
   concurrent cgroup weight write through kernfs. Fixed by reordering
   lock acquisition.

 - Sync wakeups could leave the waker CPU incorrectly marked idle in the
   built-in idle-CPU tracking.

 - A selftest fix for sleeping tasks whose CPU affinity changes before
   wakeup.

* tag 'sched_ext-for-7.2-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext:
  selftests/sched_ext: Handle sleeping task affinity changes in numa test
  sched_ext: Mark waker CPU busy when selected in WAKE_SYNC case
  sched_ext: Don't enable non-ext tasks in the sub-sched task loops
  sched_ext: Skip sub-disable teardown for never-linked sub-schedulers
  sched_ext: Take cgroup_lock() first in scx_cgroup_lock()
  sched_ext: Reject setting disallow from init_task outside the enable path

2 weeks agoMerge tag 'cgroup-for-7.2-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 3 Aug 2026 15:28:01 +0000 (08:28 -0700)]
Merge tag 'cgroup-for-7.2-rc6-fixes' of git://git./linux/kernel/git/tj/cgroup

Pull cgroup fixes from Tejun Heo:

 - A pressure trigger's poll timer could be re-armed while the last
   trigger was being torn down and then fire after the cgroup was freed.

   Tie the timer to the cgroup's lifetime and shut it down when the
   cgroup is freed.

 - Writing to a pressure file forked a worker kthread while holding the
   cgroup mutex, creating lock dependencies from the mutex to the whole
   fork path. A pressure write racing a sched_ext scheduler enable,
   which blocks forks before grabbing the mutex, deadlocked.

   Fork the worker with the mutex dropped.

 - Documentation fix for io.latency behavior on non-rotational devices.

* tag 'cgroup-for-7.2-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  Docs/admin-guide/cgroup-v2: document io.latency rotational vs non-rotational behavior
  sched/psi: Shut down rtpoll_timer in psi_cgroup_free()
  sched/psi: Create the psimon kthread outside of cgroup_mutex

2 weeks agoKVM: s390: Fix cleanup in kvm_s390_pv_create_cpu()
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:40 +0000 (14:40 +0200)]
KVM: s390: Fix cleanup in kvm_s390_pv_create_cpu()

If creating a protected vCPU in kvm_s390_pv_create_cpu() fails,
kvm_s390_pv_destroy_cpu() was called, which checks whether the vCPU has
a PV handle and exits doing nothing otherwise. At that point, due to
not having created the protected vCPU, the PV handle will not be set,
and kvm_s390_pv_destroy_cpu() will do nothing, thus leaking the
allocated memory.

Fix by factoring out the code to free and reset a PV vCPU; call it from
kvm_s390_pv_destroy_cpu() and kvm_s390_pv_create_cpu().

Opportunistically fix the return value of kvm_s390_pv_destroy_cpu() in
case of errors: return -EIO instead if EIO.

Fixes: d4074324b07a ("KVM: s390: pv: avoid double free of sida page")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-14-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: Fix ordering when adding to SCA
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:39 +0000 (14:40 +0200)]
KVM: s390: Fix ordering when adding to SCA

When adding a new vCPU to the SCA area, the validity bit in the MCN was
set before the pointer to the state description, potentially allowing
for a race.

Fix by setting the pointer before setting the bit.

Fixes: 14542a0a54c5 ("KVM: S390: Remove sca_lock")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-13-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: Return -EINTR if a signal is pending while faulting-in
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:38 +0000 (14:40 +0200)]
KVM: s390: Return -EINTR if a signal is pending while faulting-in

If a fatal signal is pending while trying to fault-in a page, return
-EINTR instead of -EAGAIN.

Also fix unpack_one() to handle -EINTR properly.

Fixes: e907ae530133 ("KVM: s390: Add helper functions for fault handling")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-12-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: Free the mmu cache when kvm_arch_vcpu_create() fails
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:37 +0000 (14:40 +0200)]
KVM: s390: Free the mmu cache when kvm_arch_vcpu_create() fails

The mmu cache is the first thing that is allocated in
kvm_arch_vcpu_create(), but in case of failure it was not freed.

Fix by freeing the mmu cache in case of failure.

Refactor kvm_arch_vcpu_create() to use scope-based cleanup instead of
gotos.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-11-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: ucontrol: Add missing locking around gmap_remove_child()
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:36 +0000 (14:40 +0200)]
KVM: s390: ucontrol: Add missing locking around gmap_remove_child()

gmap_remove_child() needs to be called while holding the children_lock
of the parent gmap. This was not the case in the error handling path of
kvm_arch_vcpu_create() for UCONTROL guests.

Fix by adding the missing lock.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-10-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: cmma: Fix dirty tracking when removing memslot
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:35 +0000 (14:40 +0200)]
KVM: s390: cmma: Fix dirty tracking when removing memslot

When a memslot is removed, all ptes that mapped the slot are cleared or
even deallocated. If this happens while the system is in migration
mode, and if cmma-dirty pages are removed, the cmma-dirty counter will
not reflect reality.

Fix by appropriately decrementing the cmma-dirty counter when removing
a memslot.

Opportunistically improve kvm_arch_commit_memory_region() to use
__free() for the struct kvm_s390_mmu_cache.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-9-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: Fix race in __do_essa()
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:34 +0000 (14:40 +0200)]
KVM: s390: Fix race in __do_essa()

An unlikely race between __do_essa() and kvm_s390_vm_start_migration(),
kvm_s390_vm_stop_migration(), or dat_get_cmma() was possible.

Fix by locking kvm->slots_arch_lock. Since this is not a hot path, the
overhead of an additional mutex is negligible.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-8-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: Fix leaking of PGM_ADDRESSING to userspace
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:33 +0000 (14:40 +0200)]
KVM: s390: Fix leaking of PGM_ADDRESSING to userspace

If kvm_s390_set_cmma_bits() is asked to set CMMA values outside of a
memslot, PGM_ADDRESSING (5) is returned, instead of a negative error
value.

Same issue with kvm_s390_{g,s}et_skeys(), kvm_s390_keyop(), and
dat_reset_reference_bit().

Fix by returning -EFAULT whenever the return value would be > 0, which
is consistent with the behaviour before the gmap rewrite.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-7-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: ucontrol: Fix sca_clear_ext_call()
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:32 +0000 (14:40 +0200)]
KVM: s390: ucontrol: Fix sca_clear_ext_call()

When cleaning up a UCONTROL VM, sca_clear_ext_call() will touch memory
outside of the allocated ESCA block, and UCONTROL VMs don't even use
ESCA.

Fix by not touching ESCA for UCONTROL VMs, and fence the
KVM_S390_INTERRUPT ioctl altogether. Add extra checks in
sca_ext_call_pending() and sca_inject_ext_call() to make sure UCONTROL
VMs won't touch ESCA.

Fencing does not cause regressions with userspace, since UCONTROL VMs
never used KVM_S390_INTERRUPT ioctls.

Fixes: 7d43bafcff17 ("KVM: s390: Make provisions for ESCA utilization")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-6-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: Fix overclearing ESCA in case of error
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:31 +0000 (14:40 +0200)]
KVM: s390: Fix overclearing ESCA in case of error

If an attempt is made to create a vCPU with an already existing ID,
the duplicated vCPU will be destroyed. When destroying a vCPU, its
ESCA entry will be cleared. In the above scenario, the spurious
duplicate vCPU is destroyed, but the ESCA entry corresponding to the
original vCPU is cleared.

Fix by skipping clearing the ESCA entry if the vCPU creation was not
successful, i.e. if the vcpu->arch.initialized is still zero.

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Fixes: abf4a71ed95f ("KVM: s390: Unlink vcpu on destroy - v2")
[ Added Fixes tag while picking -- Claudio ]
Message-ID: <20260803124040.126471-5-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: Fix kvm_s390_vcpu_unsetup_cmma()
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:30 +0000 (14:40 +0200)]
KVM: s390: Fix kvm_s390_vcpu_unsetup_cmma()

In some cases kvm_s390_vcpu_unsetup_cmma() can be called with a 0
cbrlo; in such cases, if running with V != R, free_page() will attempt
to free physical page 0.

Fix by freeing cbrlo only if it's non-zero.

Fixes: b31605c12f4e ("KVM: s390: make cmma usage conditionally")
Fixes: 29b40f105ec8 ("KVM: s390: protvirt: Add initial vm and cpu lifecycle handling")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-4-imbrenda@linux.ibm.com>

2 weeks agoKVM: s390: Do not free SCA if it was not allocated
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:29 +0000 (14:40 +0200)]
KVM: s390: Do not free SCA if it was not allocated

If VM creation fails early in kvm_arch_init_vm(), the cleanup code
tries to free up the SCA, even though the address is 0. Due to using
free_pages_exact(), only the first page is skipped, accidentally
freeing pages 1, 2, and 3.

Fix by checking whether the pointer is NULL before attempting to free
the SCA in sca_dispose().

Fixes: e72753ed1267 ("KVM: s390: Use ESCA instead of BSCA at VM init")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-3-imbrenda@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
2 weeks agoKVM: s390: Fix unlikely NULL gmap dereference
Claudio Imbrenda [Mon, 3 Aug 2026 12:40:28 +0000 (14:40 +0200)]
KVM: s390: Fix unlikely NULL gmap dereference

When creating a new vCPU, kvm_vm_ioctl_create_vcpu() will call
kvm_arch_vcpu_postcreate() after the file descriptor for the new vCPU
has been created. The new file descriptor has not been returned yet,
but a malicious userspace program could try to guess it.

If a malicious userspace program manages to start the newly created vCPU
before kvm_arch_vcpu_postcreate() is called, __vcpu_run() will try to
dereference vcpu->arch.gmap and trigger a NULL pointer dereference.

Fix this by adding a new field to struct kvm_vcpu_arch to keep track of
the initialization status of the vCPU. Refuse to run a vCPU that is not
fully initialized.

Fixes: dafd032a15f8 ("KVM: s390: move vcpu specific initalization to a later point")
Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-2-imbrenda@linux.ibm.com>

2 weeks agoLinux 7.2-rc6
Linus Torvalds [Sun, 2 Aug 2026 23:24:24 +0000 (16:24 -0700)]
Linux 7.2-rc6

2 weeks agoDocs/admin-guide/cgroup-v2: document io.latency rotational vs non-rotational behavior
Tao Cui [Tue, 28 Jul 2026 09:57:07 +0000 (17:57 +0800)]
Docs/admin-guide/cgroup-v2: document io.latency rotational vs non-rotational behavior

io.latency is documented only in terms of average latency and the avg_lat
stat, which matches rotational devices.  On non-rotational devices a group
misses its target once enough of the IOs in the window individually exceed
it, and io.stat reports missed/total rather than avg_lat/win.

Describe both cases: how a miss is detected, note that the avg_lat tuning
guidance is rotational-only, and update the io.stat field list (mark
avg_lat/win as rotational-only, document missed/total).

Acked-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
2 weeks agoMerge tag 'riscv-for-linus-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 2 Aug 2026 19:12:21 +0000 (12:12 -0700)]
Merge tag 'riscv-for-linus-7.2-rc6' of git://git./linux/kernel/git/riscv/linux

Pull RISC-V fixes from Paul Walmsley:

 - Fix swiotlb initialization on systems where DRAM is located above
   4GiB (such as the Tenstorrent Blackhole cards)

 - Fix an out-of-bounds access in the memory hot-remove code that can
   occur on Sv39 and Sv48 systems

 - Avoid oopsing during boot if the SBI component of the unaligned
   access performance checking code loses a race against __init function
   freeing

 - Avoid attempting to install the debug-enabled vDSO when it shouldn't
   be built due to !CONFIG_MMU

 - Avoid some sparse warnings by adding missing __iomem notations in
   get_cycles{,_hi}()

 - Drop an unnecessary runtime warning in the SiFive errata handler

* tag 'riscv-for-linus-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: vdso: Only try to install vDSO when present
  riscv: mm: Fix out-of-bounds page-table walk during memory hot-remove
  riscv: drop __init from vec_check_unaligned_access_speed_all_cpus
  riscv: mm: fix SWIOTLB initialization for systems with DRAM above 4GB
  riscv/sifive: remove warning in errata
  riscv: time: Add missing __iomem in get_cycles() and get_cycles_hi()

2 weeks agoMerge tag 's390-7.2-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Sun, 2 Aug 2026 18:55:49 +0000 (11:55 -0700)]
Merge tag 's390-7.2-6' of git://git./linux/kernel/git/s390/linux

Pull s390 updates from Vasily Gorbik:

 - Fix PCI MMIO write syscall falsely reporting success for mappings not
   valid for MMIO when MIO is unavailable by returning -EFAULT

 - Fix CPRB parameter buffer overflows in zcrypt CCA AES cipher and ECC
   private key conversion by rejecting oversized key tokens

 - Fix buffer overreads and length underflow in pkey and zcrypt CCA
   token validation by checking length fields against actual buffer
   sizes

 - Fix out of bounds permission bitmap access in zcrypt EP11 admin CPRB
   filtering on custom device nodes by using AP_DOMAINS as the limit

 - Fix speculative permission bitmap reads in zcrypt CCA and EP11 admin
   CPRB handling by sanitizing user controlled domain indexes

 - Fix sensitive key material left in zcrypt CCA clear key import
   buffers by scrubbing CPRB and temporary buffers after use

* tag 's390-7.2-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/zcrypt: Fix missing mem scrub at clear key import in cca_clr2cipherkey()
  s390/zcrypt: Close speculative mem read possibility
  s390/zcrypt: Fix wrong domain value verification with EP11 CPRBs
  s390/zcrypt: Fix buffer over-read in cca_cipher2protkey
  s390/zcrypt: Validate length for CCA ECC private key requests
  s390/zcrypt: Validate length for CCA AES cipher key requests
  s390/pci: Fix s390_pci_mmio_write syscall error return without MIO

2 weeks agoMerge tag 'x86-urgent-2026-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 2 Aug 2026 18:44:12 +0000 (11:44 -0700)]
Merge tag 'x86-urgent-2026-08-02' of git://git./linux/kernel/git/tip/tip

Pull misc x86 fixes from Ingo Molnar:

 - Fix the boot-time memcmp() asm implementation's constraints
   and optimization properties (Mauricio Faria de Oliveira)

 - Move the 0xd0...0xd7 AMD Zen5 model range from the Zen6
   range where it mistakenly ended up (Pratik Vishwakarma)

* tag 'x86-urgent-2026-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/CPU/AMD: Carve out a Zen5 models range
  x86/boot: Add volatile, clobbers and zero-length test in memcmp()

2 weeks agoMerge tag 'sched-urgent-2026-08-02' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 2 Aug 2026 18:39:10 +0000 (11:39 -0700)]
Merge tag 'sched-urgent-2026-08-02' of git://git./linux/kernel/git/tip/tip

Pull scheduler fix from Ingo Molnar:

 - Fix wakeups of deferred DL servers to be actually deferred (Gabriele
   Monaco)

* tag 'sched-urgent-2026-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/deadline: Use revised wakeup rule only for running dl_server

2 weeks agoMerge tag 'perf-urgent-2026-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 2 Aug 2026 18:32:42 +0000 (11:32 -0700)]
Merge tag 'perf-urgent-2026-08-02' of git://git./linux/kernel/git/tip/tip

Pull uprobes fix from Ingo Molnar:

 - Fix uretprobes race that can crash the kernel (Breno Leitao)

* tag 'perf-urgent-2026-08-02' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  uprobes: Fix NULL pointer dereference in hprobe_expire()

2 weeks agoMerge tag 'vfs-7.2-rc6.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Linus Torvalds [Sun, 2 Aug 2026 17:12:21 +0000 (10:12 -0700)]
Merge tag 'vfs-7.2-rc6.fixes' of git://git./linux/kernel/git/vfs/vfs

Pull vfs fixes from Christian Brauner:
 "binfmt_misc:

   - Don't let an 'F' entry pin its own instance.

     An entry registered with 'F' opens its interpreter at registration
     time and holds that file until the entry is freed, so an entry
     nobody removes by hand is only closed once the binfmt_misc
     superblock is shut down.

     If the interpreter lives on a mount that keeps that superblock
     alive the two pin each other and the file is never closed. That's
     reachable by pointing the interpreter at the instance itself or by
     using the instance as an overlayfs lower layer, and once the mount
     namespace is gone there's nothing left to unregister through
     either.

   - Restore write access when removing an entry.

     Registering with the MISC_FMT_OPEN_FILE flag opens the interpreter
     via open_exec() which denies write access for as long as the entry
     exists, but removal only did filp_close() and never restored it.
     The inode's i_writecount stayed permanently negative and opening
     the interpreter for writing kept failing with ETXTBSY long after
     the entry was gone.

   - Use exe_file_deny_write_access() for the interpreter clone so both
     sides base their decision on the same mode.

   - Reject a flag character as the field delimiter. create_entry() pads
     the buffer with the delimiter so the field parsers terminate even
     on a truncated string, but check_special_flags() consumes flag
     characters instead of scanning for the delimiter.

     If the delimiter is itself a flag character the padding stops
     acting as a terminator and the scan keeps reading past the end of
     the allocation. Such a registration was always rejected, just only
     after the out of bounds read has already happened.

   - Don't leak the user namespace when the mount fails.

     bm_get_tree() hands its reference to get_tree_keyed() and sget_fc()
     moves it into sb->s_fs_info, but generic_shutdown_super() only
     calls ->put_super() from inside the if (sb->s_root) branch and
     bm_fill_super() can fail before either s_root or s_op is in place.

     Drop the reference in ->kill_sb() instead, which runs
     unconditionally.

  netfs:

   - Clear PG_private_2 on a copy-to-cache append failure.

   - Handle a rolling buffer allocation failure in single-object
     writeback and drop the extra folio reference
     netfs_write_folio_single() took before the append.

   - Release the previously batched readahead folios when
     rolling_buffer_load_from_ra() fails in
     netfs_prepare_read_iterator()

   - Fix the folio_queue ENOMEM in writeback by adding a mempool and
     passing gfp flags into the rolling buffer helpers.

  iomap:

   - Add a separate bio_set for iomap_split_ioend(). It can split bios
     that already come from iomap_ioend_bioset and deadlock once that
     bioset is exhausted.

  afs:

   - Set call->async for an asynchronous afs_fs_fetch_data() the way
     afs_fs_fetch_data64() already does.

   - Subtract subreq->transferred from subreq->len in
     afs_fs_fetch_data() rather than adding it.

   - Fix a UAF when sending a message"

* tag 'vfs-7.2-rc6.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  iomap: add a separate bio_set for iomap_split_ioend
  binfmt_misc: don't leak the user namespace when the mount fails
  binfmt_misc: reject a flag character as the field delimiter
  binfmt_misc: use exe_file_deny_write_access() for the interpreter clone
  binfmt_misc: restore write access when removing an entry
  binfmt_misc: don't let an 'F' entry pin its own instance
  netfs: Fix folio_queue ENOMEM in writeback by adding a mempool
  netfs: release readahead folios on iterator preparation failure
  netfs: handle single writeback rolling buffer allocation failure
  netfs: clear PG_private_2 on copy-to-cache append failure
  afs: Fix UAF when sending a message
  afs: Fix afs_fs_fetch_data() to subtract transferred from len
  afs: Fix afs_fs_fetch_data() to set call->async

2 weeks agoMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Linus Torvalds [Sun, 2 Aug 2026 16:32:07 +0000 (09:32 -0700)]
Merge tag 'scsi-fixes' of git://git./linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley"
 "No core changes. The largest driver fix is the reversion of threaded
  interrupt handlers in UFS and the next is the resume deadlock fix in
  hisi_sas which extends into libsas"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: ufs: core: Initialize hba->rpmbs list in ufshcd
  scsi: mpi3mr: Fix potential deadlock in mpi3mr_fault_uevent_emit
  scsi: target: Clear cmd_cnt when initial counter enrollment fails
  scsi: zfcp: Fix memory leak during adapter release by destroying gid_pn_req
  scsi: ufs: core: Revert "Delegate the interrupt service routine to a threaded IRQ handler"
  scsi: ufs: core: Cancel RTC work in active-active suspend
  scsi: scsi_debug: Fix REPORT ZONES alloc_len underflow OOB write
  scsi: target: iblock: Fix wrong PR ops NULL check for PREEMPT/RELEASE
  scsi: ufs: dt-bindings: Add missing mcq reg for qcom,sa8255p-ufshc
  scsi: libsas: Fix HA resume deadlock and hisi_sas disk-wake race
  scsi: libiscsi_tcp: Bound SCSI Response data segment to the connection buffer
  scsi: libiscsi: Fix stale-data leak into the SCSI sense buffer

2 weeks agoMerge tag 'dmaengine-fix-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul...
Linus Torvalds [Sun, 2 Aug 2026 16:19:40 +0000 (09:19 -0700)]
Merge tag 'dmaengine-fix-7.2' of git://git./linux/kernel/git/vkoul/dmaengine

Pull dmaengine fixes from Vinod Koul:

 - switchtec fix for register programming

 - sun6i descriptor reclaim fix

 - Intel idxd fixes for double free in error and setup failure

 - Qualcomm bam dma command element fix

* tag 'dmaengine-fix-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
  dmaengine: qcom: bam_dma: Fix command element mask field for BAM v1.6.0+
  dmaengine: idxd: fix fdev setup failure cleanup in idxd_cdev_open()
  dmaengine: idxd: fix double free of wq, engine, and group structs
  dmaengine: sun6i-dma: Fix reclaim descriptors while terminating DMA
  dmaengine: switchtec-dma: fix FIELD_GET misuse when programming SE threshold

2 weeks agoMerge tag 'phy-fixes-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
Linus Torvalds [Sun, 2 Aug 2026 16:16:32 +0000 (09:16 -0700)]
Merge tag 'phy-fixes-7.2' of git://git./linux/kernel/git/phy/linux-phy

Pull phy fixes from Vinod Koul:

 - fixes for zynqmp clock and pm error handling and SERDES scrambler
   register handling

 - Rockchip SSC spread fix

 - Qualcomm musb return call fix

* tag 'phy-fixes-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy:
  phy: zynqmp: keep SERDES scrambler and 8b/10b enabled for USB
  phy: zynqmp: use read-modify-write for SERDES scrambler bypass
  phy: zynqmp: fix L0_TM_DISABLE_SCRAMBLE_ENCODER mask
  phy: zynqmp: fix runtime PM leak on probe allocation failure
  phy: zynqmp: fix clock error handling in xpsgtr_phy_init()
  phy: rockchip: naneng-combphy: Always configure SSC spread direction
  phy: qcom: m31-eusb2: Fix return value of init call

2 weeks agoMerge tag 'i2c-fixes-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/andi...
Linus Torvalds [Sat, 1 Aug 2026 16:02:45 +0000 (09:02 -0700)]
Merge tag 'i2c-fixes-7.2-rc6' of git://git./linux/kernel/git/andi.shyti/linux

Pull i2c fixes from Andi Shyti:
 "A set of fixes across several host controller drivers. The largest
  part addresses three issues in the i.MX driver, while the remaining
  changes fix probe ordering, power management, timeout recovery and
  error handling.

  amd-mp2:
   - unregister callback if adapter registration fails

  designware:
   - defer probe until child GPIO controllers are bound

  imx:
   - mark adapter suspended while hardware is powered down
   - fix stale slave pointer and shared IRQ registration race
   - stop slave timer before clearing slave pointer

  iproc:
   - reset controller if START_BUSY remains set after timeout

  jz4780:
   - cache clock rate to avoid clk_get_rate() deadlock

  qcom-cci:
   - rely on runtime PM helpers for system sleep

  spacemit:
   - request interrupt after clock initialization"

* tag 'i2c-fixes-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux:
  i2c: qcom-cci: drop custom suspend/resume and rely on runtime PM helpers
  i2c: imx: Cancel hrtimer before clearing slave pointer
  i2c: imx: Fix slave registration race and error handling
  i2c: iproc: reset bus after timeout if START_BUSY is stuck
  i2c: imx: mark I2C adapter when hardware is powered down
  i2c: designware: defer probe if child GpioInt controllers are not bound
  i2c: jz4780: Cache host clock rate at probe to prevent CCF prepare_lock deadlock
  i2c: amd-mp2: Unregister callback on adapter add failure
  i2c: spacemit: request IRQ after controller initialization

3 weeks agoMerge tag 'kbuild-fixes-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuil...
Linus Torvalds [Sat, 1 Aug 2026 03:45:28 +0000 (20:45 -0700)]
Merge tag 'kbuild-fixes-7.2-1' of git://git./linux/kernel/git/kbuild/linux

Pull Kbuild fixes from Nathan Chancellor:

 - Fix regression with MO= when building out of tree kernel modules due
   to incorrectly overwriting build tree's Makefile

 - Avoid stripping .BTF sections from modules when building debug .rpm
   packages

* tag 'kbuild-fixes-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux:
  kbuild: rpm-pkg: Preserve BTF sections in kernel modules during debuginfo stripping
  kbuild: Stop modifying $(objtree)/Makefile when building oot-kmods oos

3 weeks agoMerge tag 'trace-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
Linus Torvalds [Sat, 1 Aug 2026 03:24:11 +0000 (20:24 -0700)]
Merge tag 'trace-v7.2-rc5' of git://git./linux/kernel/git/trace/linux-trace

Pull tracing fixes from Steven Rostedt:

 - Reset dropped_count in mmio_reset_data()

   When mmio_reset_data() is called, it does not reset the dropped_count
   so that subsequent runs will have incorrect reporting.

 - Add NULL check for mmio_trace_array in logging functions

   The functions __trace_mmiotrace_rw() and __trace_mmiotrace_map() may
   have the 'tr' variable passed to it as NULL. But they both
   dereference it without checking if it is NULL first.

 - Check return value of __register_event() in trace_module_add_events()

   If __register_event() fails, the __add_event_to_tracers() call after
   it will create a file for it. If the module fails to load and its
   memory is freed, the file will still point to it and it will not be
   removed as the registering of the event did not complete.

   Only call __add_event_to_tracers() if the __register_event() was
   successful.

 - Fix false positive match in regex_match_full()

   The regex full matching uses a strncmp() to test against the match
   string and the value. It should not match if value is a prefix of the
   string to match. Check to make sure the length of the strings match
   before comparing.

 - Fix reader page read offset for remote buffers

   A page swapped in by __rb_get_reader_page_from_remote() retains its
   stale read offset, causing subsequent reads to skip events or read
   past valid data.

 - Fix memory leak of subbuf_ids in rb_allocate_cpu_buffer()

   Remote buffers allocate a subbuf_ids array. If the allocator function
   fails after it is allocated, it does not free it, resulting in a
   memory leak.

* tag 'trace-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  ring-buffer: Fix subbuf_ids memory leak in rb_allocate_cpu_buffer() error path
  ring-buffer: Fix reader page read offset for remote buffers
  tracing/filters: Fix false positive match in regex_match_full()
  tracing: Check return value of __register_event() in trace_module_add_events()
  tracing/mmiotrace: Add NULL check for mmio_trace_array in logging functions
  tracing/mmiotrace: Reset dropped_count in mmio_reset_data()

3 weeks agoMerge tag 'ntfs-for-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinj...
Linus Torvalds [Sat, 1 Aug 2026 00:47:48 +0000 (17:47 -0700)]
Merge tag 'ntfs-for-7.2-rc6' of git://git./linux/kernel/git/linkinjeon/ntfs

Pull ntfs fixes from Namjae Jeon:

 - Keep RECALL_ON_OPEN in inode flags when reloading them from
   $FILE_NAME

 - Check runlist reallocation sizes for negative values and overflow

 - Drop stale page cache after shrinking non-resident attributes to
   prevent writeback failures and data loss

* tag 'ntfs-for-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/ntfs:
  ntfs: drop stale page-cache when shrinking a non-resident attr
  ntfs: harden runlist realloc size calculations
  ntfs: preserve RECALL_ON_OPEN on WSL special-file reparse points

3 weeks agoMerge tag 'v7.2-rc5-smb3-server-fixes' of git://git.samba.org/ksmbd
Linus Torvalds [Sat, 1 Aug 2026 00:35:17 +0000 (17:35 -0700)]
Merge tag 'v7.2-rc5-smb3-server-fixes' of git://git.samba.org/ksmbd

Pull smb server fixes from Steve French:

 - Use memcmp() when comparing fixed-size binary ClientGUIDs, so
   embedded NUL bytes are handled correctly

 - Reject repeated SMB2 NEGOTIATE requests after dialect selection

   This prevents preauth_info leaks, enforces the SMB2 protocol
   requirements, and serializes negotiation state updates.

 - Fix a use-after-free in __close_file_table_ids() by removing the
   volatile file ID from the owning IDR before dropping the IDR
   reference

* tag 'v7.2-rc5-smb3-server-fixes' of git://git.samba.org/ksmbd:
  ksmbd: use memcmp() to compare ClientGUIDs
  ksmbd: reject repeated SMB2 NEGOTIATE requests
  ksmbd: fix use-after-free in __close_file_table_ids()

3 weeks agoMerge tag 'ata-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Linus Torvalds [Sat, 1 Aug 2026 00:05:13 +0000 (17:05 -0700)]
Merge tag 'ata-7.2-rc6' of git://git./linux/kernel/git/libata/linux

Pull ata fixes from Damien Le Moal:

 - Fix PCI resource initialization in the sata_mv driver to keep legacy
   Marvell boards functional (Rosen)

 - Fix ahci_ceva driver initialization error path (Radhey)

 - Fix libata header file to remove a kernel doc compilation warning
   (Randy)

 - Increase the timeout for the STANDBY IMMEDIATE command to avoid
   suspend failures with drives that are slow to respond to this command
   (Matt)

 - Fixes for the handling of timed out commands in the presence of
   deferred non-NCQ commands, to avoid excessive delays in executing the
   error handler (me)

 - Disable link power management for a couple of WD drives that have
   been identified as not functioning properly when power management is
   used (Niklas)

 - Fix the device iteration loop when checking for link power management
   support to correctly handle port multiplier setups (Niklas)

* tag 'ata-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
  ata: libata-sata: fix ata_scsi_lpm_supported() iteration
  ata: libata-core: Disable LPM on WD Green 2.5 480GB
  ata: libata-core: Disable LPM on some WD drives
  scsi: libsas: terminate deferred commands on time out
  ata: libata-scsi: schedule deferred atapi command
  ata: libata-scsi: terminate deferred commands on time out
  ata: libata-eh: Increase STANDBY IMMEDIATE timeout
  ata: libata: avoid kernel-doc warnings
  ata: ahci_ceva: fix error paths in ceva_ahci_platform_enable_resources()
  ata: sata_mv: accept 1 or 2 resources in platform probe

3 weeks agoring-buffer: Fix subbuf_ids memory leak in rb_allocate_cpu_buffer() error path
Masami Hiramatsu (Google) [Fri, 31 Jul 2026 14:16:46 +0000 (23:16 +0900)]
ring-buffer: Fix subbuf_ids memory leak in rb_allocate_cpu_buffer() error path

In rb_allocate_cpu_buffer(), cpu_buffer->subbuf_ids is allocated using
kcalloc() when buffer->remote is non-NULL. If a subsequent page allocation
fails (e.g., ring_buffer_desc_page() returns NULL or rb_allocate_pages()
fails), execution jumps to fail_free_reader.

While __free(kfree) automatically frees the outer cpu_buffer structure
at scope exit, kfree(cpu_buffer) does not recursively free nested heap
pointers such as cpu_buffer->subbuf_ids, resulting in a memory leak.

Fix this by explicitly freeing cpu_buffer->subbuf_ids in the
fail_free_reader error unwinding path when cpu_buffer->remote is set.

Link: https://patch.msgid.link/178550740672.380917.6067449683620196150.stgit@devnote2
Fixes: 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes")
Assisted-by: Antigravity:gemini-3.6-flash
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
3 weeks agoMerge tag 'block-7.2-20260731' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe...
Linus Torvalds [Fri, 31 Jul 2026 23:42:34 +0000 (16:42 -0700)]
Merge tag 'block-7.2-20260731' of git://git./linux/kernel/git/axboe/linux

Pull block fixes from Jens Axboe:

 - A set of fixes for s390/dasd, via Stefan

 - Fix for a missing stop of the timeout timer, if a disk has never been
   added

 - Clear kernel owned fields on ublk setup by default

* tag 'block-7.2-20260731' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux:
  s390/dasd: Fix undersized format-check buffer
  s390/dasd: Fix potential NULL pointer dereference
  s390/dasd: Fix path verification interrupted by concurrent dasd_sleep_on_immediatly
  block: stop the timeout timer when releasing a never added disk
  ublk: reset kernel-owned dev_info fields in ublk_ctrl_add_dev()

3 weeks agoMerge tag 'io_uring-7.2-20260731' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 31 Jul 2026 23:14:19 +0000 (16:14 -0700)]
Merge tag 'io_uring-7.2-20260731' of git://git./linux/kernel/git/axboe/linux

Pull io_uring fixes from Jens Axboe:

 - Fix for a bug in how length caps are handled in multishot, and along
   with it, a generic fix for avoiding these kinds of conversion issues
   in the future.

 - Ensure that task restrictions are always preserved across exec.

 - Revert of the io_uring controlled epoll restriction, which disallowed
   nested contexts. Turns out that libuv is already using it like that,
   so we cannot simply remove it, sadly.

 - Fix for a reference leak in the zcrx code.

* tag 'io_uring-7.2-20260731' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux:
  io_uring: preserve task restrictions across exec
  io_uring/zcrx: don't clear master_ctx from the import path
  Revert "io_uring/epoll: disallow adding an epoll file to an epoll context"
  io_uring/kbuf: cap buffer selection length at MAX_RW_COUNT
  io_uring/net: initialize mshot_len for send

3 weeks agoMerge tag 'drm-fixes-2026-08-01' of https://gitlab.freedesktop.org/drm/kernel
Linus Torvalds [Fri, 31 Jul 2026 22:47:45 +0000 (15:47 -0700)]
Merge tag 'drm-fixes-2026-08-01' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
 "Weekly pulls request. As expected there is more AMD this week since
  Alex was off last week, vmwgfx looks to have been hit with the AI
  stick a bit and mediatek as well. Otherwise some minor fixes across
  the board, the new normal definitely seems to be a thing.

  dp:
   - Restrict some DP bandwidth calculations to HDMI DFP

  bridge:
   - Fix small leak in bridge/display-connector

  mediatek:
   - Check CRTC state before freeing
   - mtk_hdmi: Fix DDC adapter double put in v2
   - mtk_hdmi_common: take i2c adapter module reference
   - mtk_dsi: Enable HS clock only at pre-enable
   - ovl_adaptor: balance component registrations

  amdgpu:
   - VCN 5.3 fix
   - UserQ fixes
   - GEM close optimization
   - HDMI AV mute fix
   - UML build fixes
   - GFXOFF residency metrics fixes
   - SMU 15 fixes
   - debug_vm fix
   - PSP 15 fixes
   - NBIO 7.11.5 fix
   - pptable use after free fix
   - gpu metrics fetch fix
   - DC viewport fix
   - DML2.1 fix
   - i2c retimer spam fix
   - UMD profile pstate fix
   - Power metrics format cleanup
   - GTT size fix on APUs
   - DC context logging fix
   - PM sysfs fix for APUs
   - Follow on pageflip timeout fix

  amdkfd:
   - Various bounds checking fixes
   - Mutex locking fix

  i915/xe:
   - Check no-DMA huge-pte cases before DMA segment test
   - sink FRL rate fix
   - 200ms fix for TMDS scrambler status

  vmwgfx:
   - Improve various size checks and limit checks
   - Fix oops when submitting  invalid execbuf ioctl
   - Correctly lock in vmfwgx fence signaling path
   - More validation of execbuf ioctl
   - Fix oops in vmwgfx vkms init failure path
   - Overflow handling in shader path

  panthor:
   - Improve firmware validation

  imagination:
   - Improve imagination trace points.

  qaic:
   - Fix QAIC transaction length check"

* tag 'drm-fixes-2026-08-01' of https://gitlab.freedesktop.org/drm/kernel: (59 commits)
  drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status
  drm/amd/display: Exit idle optimizations before programming
  drm/amd/pm: hide pp_table sysfs on APUs
  accel/qaic: use sizeof(*trans_hdr) for transaction length check
  drm/panthor: validate firmware interface structure sizes
  drm/xe/pt: check no-DMA huge-pte cases before DMA segment test
  drm/imagination: Update the trace point pvr_job_submit_fw()
  drm/i915/dp: Ignore the sink's DSC max FRL rate without a PCON DSC encoder
  drm/mediatek: ovl_adaptor: balance component registrations
  drm/mediatek: mtk_dsi: Enable HS clock only at pre-enable
  drm/dp: Read the PCON max FRL bandwidth only for HDMI DFPs
  drm/amd/display: use proper context for logging
  drm/amdgpu: cap GTT size to physical RAM on APUs
  drm/amd/pm: use milliwatts for GPU power sensors
  drm/amdgpu: restore UMD profile pstate after runtime resume
  drm/amd/display: Silence link_dpms I2C retimer failures
  drm/amdkfd: hold event_mutex while checkpointing CRIU events
  drm/amd/display: check if dml21_add_phantom_plane() is successful
  drm/amd/display: Fix divide-by-zero in calculate_mcache_setting on zero viewport
  drm/amd/display: Add AV mute wait frames to dce110_set_avmute
  ...

3 weeks agoMerge tag 'devicetree-fixes-for-7.2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 31 Jul 2026 21:03:19 +0000 (14:03 -0700)]
Merge tag 'devicetree-fixes-for-7.2' of git://git./linux/kernel/git/robh/linux

Pull devicetree fixes from Rob Herring:

 - Fix NULL bus dereference in of_pci_range_parser_one()

 - Prevent out-of-bounds access when too many dynamic reserved memory
   regions are defined

* tag 'devicetree-fixes-for-7.2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of/address: Fix NULL bus dereference in of_pci_range_parser_one()
  of: reserved_mem: prevent OOB when too many dynamic regions are defined

3 weeks agoMerge tag 'hyperv-fixes-signed-20260731' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 31 Jul 2026 20:37:41 +0000 (13:37 -0700)]
Merge tag 'hyperv-fixes-signed-20260731' of git://git./linux/kernel/git/hyperv/linux

Pull hyper-v fixes from Wei Liu:

 - Multiple fixes for the MSHV driver (Stanislav Kinsburskii, Wei Liu,
   Yi Xie, Yousef Alhouseen)

 - Multiple fixes for the VMBus driver (Hardik Garg, Michael Kelley,
   Sebastian Andrzej Siewior)

* tag 'hyperv-fixes-signed-20260731' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  mshv_vtl: bounds-check cpu index in vtl mmap fault handler
  mshv: Publish VP to pt_vp_array before installing the file descriptor
  Drivers: hv: vmbus: add VTL2 redirect connection ID
  mshv: Order pt_vp_array publish against irqfd assertion path
  mshv: Fix missing error code on VP allocation failure
  mshv: Fix level-triggered check on uninitialized data
  mshv: Fix race in mshv_irqfd_deassign
  mshv: Use kfree_rcu in mshv_portid_free
  mshv: Fix sleeping under spinlock in mshv_portid_alloc
  mshv: Fix duplicate GSI detection for GSI 0
  Drivers: hv: vmbus: Remove vmbus_irq_initialized
  Drivers: hv: vmbus: Replace lockdep_hardirq_threaded() with lockdep annotation
  mshv_vtl: fix fd leak in mshv_ioctl_create_vtl()
  mshv_vtl: clear hypercall output before copyout
  Drivers: hv: vmbus: Set DMA coherent mask for VMBus devices
  mshv: fix hv_input_get_system_property struct

3 weeks agoMerge tag 'trace-tools-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 31 Jul 2026 20:25:45 +0000 (13:25 -0700)]
Merge tag 'trace-tools-v7.2-rc5' of git://git./linux/kernel/git/trace/linux-trace

Pull RTLA fix from Steven Rostedt:

 - Fix timerlat top actions triggering on signal

   Fix a bug in RTLA's timerlat top actions feature where on-threshold
   actions are triggered on any signal, regardless of whether a latency
   spike had actually occurred during the measurement.

   The return retval was checked for non-zero to do actions. But if a
   signal came in, it returns a negative and actions were being
   incorrectly triggered when they should not have been.

* tag 'trace-tools-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
  rtla/timerlat_top: Fix on-threshold actions firing on signal

3 weeks agomshv_vtl: bounds-check cpu index in vtl mmap fault handler
Yi Xie [Thu, 9 Jul 2026 02:19:47 +0000 (10:19 +0800)]
mshv_vtl: bounds-check cpu index in vtl mmap fault handler

cpu is taken from pgoff & 0xffff.  cpu_online() does not reject cpu >=
nr_cpu_ids, and per_cpu_ptr() can then walk off __per_cpu_offset.

Signed-off-by: Yi Xie <xieyi@kylinos.cn>
Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
3 weeks agomshv: Publish VP to pt_vp_array before installing the file descriptor
Stanislav Kinsburskii [Thu, 7 May 2026 15:44:32 +0000 (15:44 +0000)]
mshv: Publish VP to pt_vp_array before installing the file descriptor

mshv_partition_ioctl_create_vp() called anon_inode_getfd() before
publishing the new VP into partition->pt_vp_array.  anon_inode_getfd()
includes fd_install(), so the fd was live in current->files before the
publish ran.

A concurrent MSHV_RUN_VP ioctl on that fd does not serialise against the
in-progress MSHV_CREATE_VP â€” it takes vp->vp_mutex, not the partition
mutex.  Once the VP starts running and traps, mshv_intercept_isr() can look
up partition->pt_vp_array[vp_index] and observe NULL, silently dropping the
intercept message.

Split the fd creation: reserve an fd with get_unused_fd_flags(), create the
file with anon_inode_getfile(), publish the VP via smp_store_release(), and
finally call fd_install() as the userspace-visibility commit point.

Fixes: 621191d709b14 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
3 weeks agoDrivers: hv: vmbus: add VTL2 redirect connection ID
Hardik Garg [Fri, 17 Jul 2026 00:18:37 +0000 (00:18 +0000)]
Drivers: hv: vmbus: add VTL2 redirect connection ID

VMBus sends CHANNELMSG_INITIATE_CONTACT through a Hyper-V message
connection ID. Older protocol versions use VMBUS_MESSAGE_CONNECTION_ID,
while protocol version 5.0 and newer normally use
VMBUS_MESSAGE_CONNECTION_ID_4.

For a VTL2 kernel using VMBus protocol 5.0 or newer, the host
may expect INITIATE_CONTACT on either the redirect connection ID or
VMBUS_MESSAGE_CONNECTION_ID_4. There is no capability indication that
identifies which ID is active, so the driver must determine it at runtime.

During VMBus negotiation, the redirect ID is tried first because it is
used by VTL2 configurations with VMBus redirection enabled. If the
redirect ID is unavailable, the host rejects it synchronously with
HV_STATUS_INVALID_CONNECTION_ID, allowing fallback to the standard ID.

Return a distinct error for an invalid Initiate Contact connection ID so
this fallback does not mask other post-message failures or
protocol-version rejections. Preserve the existing connection ID
selection for older protocol versions or when running below VTL2.

Signed-off-by: Hardik Garg <hargar@linux.microsoft.com>
Reviewed-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
3 weeks agomshv: Order pt_vp_array publish against irqfd assertion path
Stanislav Kinsburskii [Thu, 23 Jul 2026 00:28:11 +0000 (00:28 +0000)]
mshv: Order pt_vp_array publish against irqfd assertion path

mshv_partition_ioctl_create_vp() initialises a VP struct (allocations,
mutex_init, init_waitqueue_head, page mappings) and then publishes the
pointer into partition->pt_vp_array.  Several ISR paths read this array
locklessly: the intercept ISR, the two scheduler ISRs, and
mshv_try_assert_irq_fast() on the irqfd fast path.

Of these, only mshv_try_assert_irq_fast() can structurally race the
publish.  It runs from an eventfd waker without holding pt_mutex, and
MSHV_IRQFD does not require the target lapic_apic_id (== vp_index) to
refer to an existing VP at registration time.  A user can therefore
register an irqfd targeting a yet-to-be-created VP, then trigger
mshv_try_assert_irq_fast() concurrently with MSHV_CREATE_VP for the
same index.  On weakly-ordered architectures the reader can observe a
non-NULL pointer in pt_vp_array before the initialising stores to the
VP struct become visible, leading to use of partially-initialised
fields (e.g. vp_register_page).

The other ISR readers cannot reach this race: the hypervisor will not
generate intercept or scheduler messages for a VP that has never been
told to run, and the user can only call MSHV_RUN_VP on the VP fd
returned by MSHV_CREATE_VP, which by construction is returned after
the publish.  Leave those readers as plain loads.

Use smp_store_release() in mshv_partition_ioctl_create_vp() to publish
the pointer, and pair it with smp_load_acquire() in
mshv_try_assert_irq_fast().  On x86 these compile to plain accesses
under TSO; on ARM64 they emit one-instruction acquire/release barriers,
acceptable on this fast path.

The destroy-side path (destroy_partition() clearing pt_vp_array[i] to
NULL after kfree(vp)) has a separate ordering and lifetime concern
that is out of scope here.

Fixes: 621191d709b14 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
3 weeks agomshv: Fix missing error code on VP allocation failure
Stanislav Kinsburskii [Thu, 7 May 2026 15:44:37 +0000 (15:44 +0000)]
mshv: Fix missing error code on VP allocation failure

In mshv_partition_ioctl_create_vp(), when kzalloc for the VP struct
fails, the code jumps to the cleanup path without setting ret. At that
point ret is 0 from the preceding successful mshv_vp_stats_map() call,
so the function returns success to userspace despite having failed to
create the VP. No fd is installed and no VP is registered in pt_vp_array,
but userspace has no way to know the operation failed.

Set ret to -ENOMEM before jumping to the cleanup path.

Fixes: 621191d709b14 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
3 weeks agomshv: Fix level-triggered check on uninitialized data
Stanislav Kinsburskii [Thu, 7 May 2026 15:43:43 +0000 (15:43 +0000)]
mshv: Fix level-triggered check on uninitialized data

In mshv_irqfd_assign(), the level-triggered validation for resample
irqfds checks irqfd_lapic_irq.lapic_control.level_triggered before
mshv_irqfd_update() has populated the field. Since the irqfd struct is
zero-allocated, level_triggered is always 0 at that point, causing the
check to always reject resample irqfds with -EINVAL. This makes
level-triggered interrupt resampling â€” used to avoid interrupt storms
with assigned devices â€” completely non-functional.

Move the check after the mshv_irqfd_update() call, which resolves the
IRQ routing entry and populates irqfd_lapic_irq with the actual trigger
mode.

Fixes: 621191d709b14 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
3 weeks agomshv: Fix race in mshv_irqfd_deassign
Stanislav Kinsburskii [Thu, 7 May 2026 15:43:15 +0000 (15:43 +0000)]
mshv: Fix race in mshv_irqfd_deassign

mshv_irqfd_deactivate() and the hlist traversal of pt_irqfds_list
require pt->pt_irqfds_lock to be held, but mshv_irqfd_deassign()
omits it. This races with the EPOLLHUP path in mshv_irqfd_wakeup(),
which does take the lock before calling mshv_irqfd_deactivate().

Additionally, mshv_irqfd_deactivate() uses hlist_del() which poisons
the node pointers rather than resetting them. Since
mshv_irqfd_is_active() relies on hlist_unhashed() (checks pprev ==
NULL), a poisoned node still appears active. If a concurrent path calls
mshv_irqfd_deactivate() again on the same irqfd, the guard fails to
prevent a double hlist_del() on poisoned pointers.

Fix both issues:
- Add the missing spin_lock_irq/spin_unlock_irq around the list
  traversal in mshv_irqfd_deassign(), matching mshv_irqfd_release().
- Use hlist_del_init() instead of hlist_del() so the node is properly
  marked as unhashed after removal, making the is_active guard reliable.

Fixes: 621191d709b14 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
3 weeks agomshv: Use kfree_rcu in mshv_portid_free
Stanislav Kinsburskii [Wed, 22 Jul 2026 23:56:46 +0000 (23:56 +0000)]
mshv: Use kfree_rcu in mshv_portid_free

mshv_portid_free() uses synchronize_rcu() followed by kfree() to
reclaim port table entries. This blocks the caller until a full RCU
grace period elapses, which is unnecessary since the same module already
uses the non-blocking kfree_rcu() pattern in mshv_port_table_fini().

Replace with kfree_rcu() to avoid the blocking wait and keep the
reclamation strategy consistent across the file.

Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
3 weeks agoMerge tag 'spi-fix-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Linus Torvalds [Fri, 31 Jul 2026 18:38:20 +0000 (11:38 -0700)]
Merge tag 'spi-fix-v7.2-rc5' of git://git./linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "The drip of driver specific fixes, mostly from the device vendors
  themselves, keeps on coming in. There's more than I'd like right now
  but equally nothing hugely alarming"

* tag 'spi-fix-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: spi-nxp-fspi: propagate clock reconfig failures in nxp_fspi_select_mem()
  spi: spi-nxp-fspi: enter stop mode before reconfiguring MCR0 and DLL
  spi: spi-nxp-fspi: add per-SoC SDR/DTR clock rate limits for all supported SoCs
  spi: spi-qpic-snand: write the feature value before executing SET_FEATURE
  spi: spi-cadence: Move TX FIFO full busy-wait into FIFO
  spi: qcom-qspi: Correct max DMA length to avoid 64K boundary failure
  spi: spacemit: prepare both DMA descriptors before submitting

3 weeks agoMerge tag 'pci-v7.2-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
Linus Torvalds [Fri, 31 Jul 2026 17:11:52 +0000 (10:11 -0700)]
Merge tag 'pci-v7.2-fixes-1' of git://git./linux/kernel/git/pci/pci

Pull pci fixes from Bjorn Helgaas:

 - Remove Karthikeyan Mitran from Mobiveil MAINTAINERS PCIe entry since
   email bounces (Manivannan Sadhasivam)

 - Preserve i.MX6Q, i.MX6QP, and i.MX6SX Root Port MSI/MSI-X
   Capabilities when using iMSI-RX to work around hardware defect
   (Soeren Moch)

 - Reorder i.MX6Q/DL PHY power up to fix boot hang regression (Richard
   Zhu)

* tag 'pci-v7.2-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
  PCI: imx6: Fix i.MX6Q/DL boot hang caused by improper PHY power sequencing
  PCI: imx6: Keep i.MX6 Root Port MSI/MSI-X Capabilities with iMSI-RX to work around hardware bug
  MAINTAINERS: Drop Karthikeyan Mitran from Mobiveil PCIe entry

3 weeks agoMerge tag 'hwmon-for-v7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Fri, 31 Jul 2026 16:50:10 +0000 (09:50 -0700)]
Merge tag 'hwmon-for-v7.2-rc6' of git://git./linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
 "Most of the patches are fixes for pre-existing issues reported by
  Sashiko. I suspect we'll see a lot of those for a while.

   - adt7470:
       - Fix PWM auto temp state array and bounds check
       - Fix divide-by-zero TOCTOU crash in fan speed read
       - Use cached PWM frequency value
       - Fix swapped PWM3 and PWM4 auto mode masks
       - Fix temperature alarm logic in hwmon_temp_read()
       - Fix busy-loop and I2C flooding in update thread
       - Fix cache updated before hardware write on I2C error
       - Fix fans stuck in manual mode on I2C errors

   - ina2xx: Fix various overflow issues

   - ltc4282: Fix reading the minimum alarm voltage

   - lm63: Mask PWM frequency multiplier to supported bits

   - lm90: Only report alarms if driver is ready

   - nct6775-core:
       - Prevent access to unsupported weight registers
       - Fix number of temperature registers for NCT6116

   - npcm750-pwm-fan: stop fan timer on device detach

   - nzxt-smart2: DMA-align output buffer

   - pmbus:
       - Fix return value from pmbus_update_byte_data()
       - Notify on the hwmon device, not the i2c client

   - sht3x: Fix unaligned accesses"

* tag 'hwmon-for-v7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (npcm750-pwm-fan): stop fan timer on device detach
  hwmon: (pmbus) Fix return value from pmbus_update_byte_data()
  hwmon: (adt7470) Fix PWM auto temp state array and bounds check
  hwmon: (adt7470) Fix divide-by-zero TOCTOU crash in fan speed read
  hwmon: (adt7470) Use cached PWM frequency value
  hwmon: (adt7470) Fix swapped PWM3 and PWM4 auto mode masks
  hwmon: (adt7470) Fix temperature alarm logic in hwmon_temp_read()
  hwmon: (adt7470) Fix busy-loop and I2C flooding in update thread
  hwmon: (adt7470) Fix cache updated before hardware write on I2C error
  hwmon: (adt7470) Fix fans stuck in manual mode on I2C errors
  hwmon: (nct6775-core) Prevent access to unsupported weight registers
  hwmon: (lm63) Mask PWM frequency multiplier to supported bits
  hwmon: (nzxt-smart2) DMA-align output buffer
  hwmon: (lm90) Only report alarms if driver is ready
  hwmon: (sht3x) Fix unaligned accesses
  hwmon: (ltc4282) Fix reading the minimum alarm voltage
  hwmon: (ina2xx) Fix various overflow issues
  hwmon: (pmbus/core) notify on the hwmon device, not the i2c client
  hwmon: (nct6775-core) Fix number of temperature registers for NCT6116

3 weeks agoMerge tag 'sound-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
Linus Torvalds [Fri, 31 Jul 2026 16:32:39 +0000 (09:32 -0700)]
Merge tag 'sound-7.2-rc6' of git://git./linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of sound fixes for the 7.2-rc6 cycle. Again, it became
  far larger than wished; I'll throttle from now on.

  There are no major changes, just a normal flow of small fixes. The
  majority of them are device-specific quirks and ASoC SDCA/codec
  updates, but it includes a few ALSA core fixes as well.

  ALSA Core:
   - Fix for ALSA sequencer timer division-by-zero
   - Fix potential race in ALSA timer core
   - Wake up linked drain waiters on PCM stream unlink
   - Fix double-free of converter objects on UMP rawmidi error path

  USB-audio:
   - Fix a few potential out-of-bounds access bugs
   - Prevent stack info leak in RME Digiface status
   - Fix UAF during UMP endpoint destruction
   - Fix UAF at error handling during probe in Line6 6fire driver
   - Quirks for C-Media CM6206, Corsair Virtuoso, Razer Barracuda X 2.4,
     JKY Technology, and generic USB headphones

  HD-audio:
   - Quirks for HP Victus 16, HP Dragonfly Folio G3, Lenovo Legion 7, HP
     Laptop 14s, Acer Nitro 5, TongFang X6SP45xU, Infinix INBOOK X3, and
     HP Pavilion All-in-One

  ASoC:
   - Comprehensive cleanups and bug fixes for SoundWire/SDCA drivers
   - DMI quirks for AMD ACP/YC on Lenovo Legion 7, Acer Aspire, MSI
     Crosshair A16, and ASUS ExpertBook
   - ACPI match table entry for SOF RT5682 on Intel Nova Lake
   - Device-specific mixer / clock, irq fixes for TI TAS2562, TI
     TAS2781, Sophgo cv1800b ADC, Maxim MAX98090/98095, FSL ASRC/EASRC
     and Realtek RT5640"

* tag 'sound-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (53 commits)
  ASoC: rt722: reset codec to fix abnormal sound
  ASoC: dt-bindings: realtek,rt5640: Make interrupts optional
  ALSA: hda/realtek: Add mute LED quirk for HP Victus 16-e0xxx (MB 88ED)
  ALSA: usb-audio: Add GET_SAMPLE_RATE quirk for C-Media CM6206
  ALSA: usb-audio: Clamp frame size in implicit-feedback mode
  ALSA: usb-audio: Fix DMA buffer out-of-bounds write when fill_max is set
  ALSA: usb-audio: Add quirk for Corsair Virtuoso (later revision)
  ALSA: pcm: wake linked drain waiters on unlink
  ASoC: amd: acp: Add DMI quirk for Lenovo Legion 7 15ASH11
  ASoC: sophgo: return 1 on volume change in cv1800b_adc_volume_set()
  ASoC: tas2781: Use correct calibration data for SINEGAIN2 register
  ASoC: SDCA: Move kcontrol search out of IRQ
  ASoC: SDCA: Switch to fixup_controls callback for IRQ registration
  ASoC: Add a component fixup_controls callback
  ASoC: SDCA: Populate IRQ data earlier
  ASoC: SDCA: Remove devm from primary IRQ cleanup
  ASoC: SDCA: Add sdca_irq_cleanup_late()
  ASoC: SDCA: Rename sdca_irq_allocate() to include devm
  ALSA: hda/realtek: Add quirk for HP Dragonfly Folio G3 2-in-1 (103c:8a05)
  ALSA:hda/realtek:ALC269 fixup for Legion 7 15ASH11 Mic Mute LED
  ...

3 weeks agoMerge tag 'uml-for-linus-7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 31 Jul 2026 16:16:11 +0000 (09:16 -0700)]
Merge tag 'uml-for-linus-7.2-rc5' of git://git./linux/kernel/git/uml/linux

Pull UML fix from Richard Weinberger:

 - Fix use-after-free in UML's vector networking driver

* tag 'uml-for-linus-7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux:
  um: vector: fix use-after-free in vector_mmsg_rx()

3 weeks agoMerge tag 'mm-hotfixes-stable-2026-07-30-19-30' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Fri, 31 Jul 2026 15:59:39 +0000 (08:59 -0700)]
Merge tag 'mm-hotfixes-stable-2026-07-30-19-30' of git://git./linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "12 hotfixes.  6 are cc:stable.  9 are for MM.

  There's a two-patch series from Nico which fixes a couple of PMD level
  mTHP accounting bugs and a two-patch series from Chris Gellermann
  which addresses mishandling of getline() in selftests. All the
  remainder are singletons - please see the changelogs for details"

* tag 'mm-hotfixes-stable-2026-07-30-19-30' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  selftests/mm: fix potential wild pointer access of getline due to missing init
  selftests/clone3: fix wild pointer access of getline due to missing init
  mm/page_reporting: use system_freezable_wq to fix UAF during suspend
  mm: vmscan: abort proactive reclaim early when freezing for suspend
  MAINTAINERS: update Nico Pache's email address
  arm64, mailmap: update email address for Peter Collingbourne
  MAINTAINERS: update address for Burak Emir
  mm/huge_memory: unlock i_mmap_rwsem before releasing after-split folios
  riscv/mm: use physical alignment for vmemmap_start_pfn
  mm/migrate: exclude hugetlb folios from MTHP_STAT_NR_ANON accounting
  mm: decrement MTHP_STAT_NR_ANON in free_zone_device_folio()
  mm: memcg: initialize *locked in memcg1_oom_prepare() stub

3 weeks agos390/dasd: Fix undersized format-check buffer
Stefan Haberland [Mon, 27 Jul 2026 14:28:40 +0000 (16:28 +0200)]
s390/dasd: Fix undersized format-check buffer

fmt_buffer_size in dasd_eckd_check_device_format() is declared as
int, even though one of the multiplicands, sizeof(struct eckd_count),
is a size_t. The expression

    trkcount * rpt_max * sizeof(struct eckd_count)

is therefore correctly evaluated at 64-bit width, but the result is
silently truncated when it is stored back into the 32-bit
fmt_buffer_size variable. For a sufficiently large track range
(start_unit/stop_unit are caller-controlled) this truncation
yields a buffer size far smaller than the number of tracks actually
requested. kzalloc() then succeeds with an undersized allocation,
while the subsequent channel program build still operates on the
untruncated track count and writes past the end of that buffer.

Compute the buffer size with check_mul_overflow() and keep it in a
size_t, so that a value that no longer fits results in -EINVAL
instead of a silently truncated allocation size.

Fixes: 8fd575200db5 ("s390/dasd: Add new ioctl BIODASDCHECKFMT")
Cc: stable@vger.kernel.org #4.7
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20260727142840.567286-4-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 weeks agos390/dasd: Fix potential NULL pointer dereference
Jan Höppner [Mon, 27 Jul 2026 14:28:39 +0000 (16:28 +0200)]
s390/dasd: Fix potential NULL pointer dereference

dasd_release_space() checks the implementation of the is_ese()
discipline function before calling it to determine if a given device is
an ESE DASD.

The current usage of the logical AND operator will lead to a NULL
pointer dereference as the function is called even if the function
pointer is NULL.

Fix this by using the logical OR operator.

Fixes: 91dc4a197569 ("s390/dasd: Add new ioctl to release space")
Cc: stable@vger.kernel.org # v5.3+
Reported-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Eduard Shishkin <edward6@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20260727142840.567286-3-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 weeks agos390/dasd: Fix path verification interrupted by concurrent dasd_sleep_on_immediatly
Stefan Haberland [Mon, 27 Jul 2026 14:28:38 +0000 (16:28 +0200)]
s390/dasd: Fix path verification interrupted by concurrent dasd_sleep_on_immediatly

When all channel paths to a DASD device are lost and subsequently
recovered, the path event handler starts one IO per path via
dasd_sleep_on_immediatly() to execute read configuration data (RCD) with
high priority.

dasd_sleep_on_immediatly() works by terminating the currently running
request before inserting the new request.
If a concurrent caller, such as the attention handler
dasd_eckd_check_attention_work() or the summary unit
check handler summary_unit_check_handling_work(), also calls
dasd_sleep_on_immediatly() while a path verification RCD is in progress,
the RCD gets terminated.

The problem is that a terminated request transitions from CLEARED to
TERMINATED without going through the normal retry path in
__dasd_device_process_ccw_queue.

The RCD therefore returns -EIO, and the affected paths remain
non-operational after recovery. RCD CQRs used for path verification
already carry the DASD_CQR_VERIFY_PATH flag.

Extend _dasd_term_running_cqr() to check this flag: instead of terminating
such a request, return -EAGAIN. In dasd_sleep_on_immediatly(), loop on
-EAGAIN with a short sleep, waiting for the path verification request to
complete before inserting the new request.

This is consistent with the already indefinite wait_event() that
dasd_sleep_on_immediatly() uses for its own request, and all other callers
(attention handler, summary unit check handler, reserve/release/steal-lock)
benefit automatically without requiring changes.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20260727142840.567286-2-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 weeks agos390/zcrypt: Fix missing mem scrub at clear key import in cca_clr2cipherkey()
Harald Freudenberger [Wed, 29 Jul 2026 14:01:34 +0000 (16:01 +0200)]
s390/zcrypt: Fix missing mem scrub at clear key import in cca_clr2cipherkey()

The helper function _ip_cprb_helper() uses internal buffer memory for
building and processing CPRBs. After use this buffer was never
scrubbed which could lead to leaving for example clear key material in
memory which could be exposed via tricky reuse of this same memory.

Extend the _ip_cprb_helper() function with another parameter 'scrub'
used to steer scrubbing of this buffer. So now the caller has the
opportunity to decide if scrubbing is needed or not.

Extend the clear key to secure key token import process in function
cca_clr2cipherkey() to tell the helper function from above to scrub
the cprb buffer when the clear key value is part of the request data.

Add explicit scrubbing on return from function cca_clr2cipherkey() for
the random EXOR buffer and the cprb buffer.

Overall this cleans the internal used buffer in case of clear key
import to prevent sensitive data to get exposed.

Fixes: 4bc123b18ce6 ("s390/zcrypt: Add low level functions for CCA AES cipher keys")
Cc: stable@vger.kernel.org
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
3 weeks agos390/zcrypt: Close speculative mem read possibility
Harald Freudenberger [Thu, 23 Jul 2026 09:54:53 +0000 (11:54 +0200)]
s390/zcrypt: Close speculative mem read possibility

The domain value is extracted from a given CCA or EP11 ioctl struct
when a CPRB is about to be sent. Thus this is a user controlled value.
Under some special conditions (custom device node used, administrative
load) this value is used as an array index after bounds checking, but
without speculation barrier.

Add the missing array_index_nospec() call to prevent speculative
execution where this domain value is used.

Fixes: cfd68b33094e ("s390/zcrypt: Filter admin CPRBs on custom devices")
Cc: stable@vger.kernel.org
Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
3 weeks agos390/zcrypt: Fix wrong domain value verification with EP11 CPRBs
Harald Freudenberger [Thu, 23 Jul 2026 09:54:52 +0000 (11:54 +0200)]
s390/zcrypt: Fix wrong domain value verification with EP11 CPRBs

There is a wrong upper limit check for the domain value when an EP11
CPRB is processed for sending to a crypto card. This check is only
active on custom device nodes but may lead to access heap memory
behind perms->adm when an administrative CPRB is sent.
Add correct limit (AP_DOMAINS = 256) checking to fix this.

Fixes: cfd68b33094e ("s390/zcrypt: Filter admin CPRBs on custom devices")
Cc: stable@vger.kernel.org
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
3 weeks agos390/zcrypt: Fix buffer over-read in cca_cipher2protkey
Harald Freudenberger [Wed, 29 Jul 2026 11:40:09 +0000 (13:40 +0200)]
s390/zcrypt: Fix buffer over-read in cca_cipher2protkey

Add validation of both the actual key buffer size and token length
fields in all the cca_check_sec*token() functions. Additionally check
in cca_gencipherkey() for possible underflow with returned key size.

The CCA token structures contain user-controlled len fields that
were used in operations without proper validation against both the
actual buffer size and minimum token structure size. An attacker
could set this field larger than the actual buffer size, leading to
reading beyond buffer boundaries. This may result in a kernel crash or
exposure of memory via sending this as part of a request down to the
crypto card. Also an attacker could have used a very small len value
and thus enforce a buffer under-run which may produce similar effects
as a over-read.

So now a key must
- key buf length must be at least sizeof the token struct
- the key len field inside the token must fit into the range of
  sizeof key token struct ... key buf length

Fixes: 4bc123b18ce6 ("s390/zcrypt: Add low level functions for CCA AES cipher keys")
Cc: stable@vger.kernel.org
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
3 weeks agos390/zcrypt: Validate length for CCA ECC private key requests
Holger Dengler [Wed, 29 Jul 2026 09:36:16 +0000 (11:36 +0200)]
s390/zcrypt: Validate length for CCA ECC private key requests

cca_ecc2protkey() derives the copy length for the CPRB parameter
block directly from the length field in the key token. Reject the
request early if the token length exceeds the available space in the
parameter block.

Fixes: fa6999e326fe ("s390/pkey: support CCA and EP11 secure ECC private keys")
Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Cc: stable@vger.kernel.org # 5.10+
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
3 weeks agos390/zcrypt: Validate length for CCA AES cipher key requests
Holger Dengler [Wed, 29 Jul 2026 09:36:15 +0000 (11:36 +0200)]
s390/zcrypt: Validate length for CCA AES cipher key requests

cca_cipher2protkey() derives the copy length for the CPRB parameter
block directly from the length field in the key token. Reject the
request early if the token length exceeds the available space in the
parameter block.

Fixes: 4bc123b18ce6 ("s390/zcrypt: Add low level functions for CCA AES cipher keys")
Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Cc: stable@vger.kernel.org # 5.4+
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
3 weeks agos390/pci: Fix s390_pci_mmio_write syscall error return without MIO
Niklas Schnelle [Wed, 22 Jul 2026 13:08:34 +0000 (15:08 +0200)]
s390/pci: Fix s390_pci_mmio_write syscall error return without MIO

On a machine without PCI memory-I/O (MIO) support or when running with
pci=nomio the s390 specific PCI MMIO write syscall checks if the MMIO
cookie is above ZPCI_IOMAP_ADDR_BASE as a sanity check before even
trying to perform the MMIO. If this check fails the return value was
left unchanged and thus 0 from prior operations falsely indicating
success. This could potentially confuse user-space into falsely
believing the MMIO, on a mapping not valid for MMIO was successful.

Fix this by setting the return value to -EFAULT prior to the check
following the same pattern as elsewhere in the same function.

Cc: stable@vger.kernel.org
Reviewed-by: Julian Ruess <julianr@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Fixes: a67a88b0b8de ("s390/pci: remove races against pte updates")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
3 weeks agoiomap: add a separate bio_set for iomap_split_ioend
Christoph Hellwig [Mon, 29 Jun 2026 12:52:29 +0000 (14:52 +0200)]
iomap: add a separate bio_set for iomap_split_ioend

iomap_split_ioend can split bios that already come from
iomap_ioend_bioset and thus deadlock when the bioset is exhausted.

Add a separate bio_set to avoid this deadlock.

Christian Brauner <brauner@kernel.org> says:
Mark iomap_ioend_split_bioset static as it is only used in ioend.c,
fixing the sparse warning reported by the kernel test robot.

Fixes: 5fcbd555d483 ("iomap: split bios to zone append limits in the submission handlers")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260629125229.3400726-1-hch@lst.de
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
3 weeks agouprobes: Fix NULL pointer dereference in hprobe_expire()
Breno Leitao [Wed, 29 Jul 2026 14:44:40 +0000 (07:44 -0700)]
uprobes: Fix NULL pointer dereference in hprobe_expire()

Forking a task that has a pending uretprobe can oops the kernel with a
NULL pointer dereference in the clone() path:

  BUG: kernel NULL pointer dereference, address: 0000000000000018
  Oops: 0002 [#1] SMP NOPTI
  RIP: 0010:hprobe_expire
  CR2: 0000000000000018
  Call Trace:
   uprobe_copy_process
   copy_process
   kernel_clone
   __x64_sys_clone
   do_syscall_64
   entry_SYSCALL_64_after_hwframe

This was found on real hosts on Meta fleet.

I've got the impression that this is what is happening:

  CPU 1                          CPU 2 (traced task)
  -----                          -------------------
                                 hit uprobe, prepare_uretprobe():
                                   hprobe LEASED, refcount >= 1
  uprobe_unregister()
    put_uprobe(): refcount -> 0
                                 fork() -> dup_utask()
                                   hprobe_expire(hprobe, true)
                                     try_get_uprobe() -> NULL
                                     get_uprobe(NULL)   <-- Oops

Only take the extra reference when the uprobe is non-NULL; a NULL means
it is gone and is the correct value to return.

Fixes: dd1a7567784e ("uprobes: SRCU-protect uretprobe lifetime (with timeout)")
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260729-uprobe-v1-1-61896b87c867@debian.org
3 weeks agoMerge tag 'drm-intel-fixes-2026-07-30' of https://gitlab.freedesktop.org/drm/i915...
Dave Airlie [Fri, 31 Jul 2026 04:44:11 +0000 (14:44 +1000)]
Merge tag 'drm-intel-fixes-2026-07-30' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes

One DP DSC fix and one HDMI 2.0 fix.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/amvIvqJehP7uaUgx@intel.com
3 weeks agoMerge tag 'amd-drm-fixes-7.2-2026-07-30' of https://gitlab.freedesktop.org/agd5f...
Dave Airlie [Fri, 31 Jul 2026 04:43:32 +0000 (14:43 +1000)]
Merge tag 'amd-drm-fixes-7.2-2026-07-30' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-7.2-2026-07-30:

amdgpu:
- PM sysfs fix for APUs
- Follow on pageflip timeout fix

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20260730150018.801791-1-alexander.deucher@amd.com
3 weeks agoMerge tag 'drm-xe-fixes-2026-07-30' of https://gitlab.freedesktop.org/drm/xe/kernel...
Dave Airlie [Fri, 31 Jul 2026 04:43:02 +0000 (14:43 +1000)]
Merge tag 'drm-xe-fixes-2026-07-30' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes

- Check no-DMA huge-pte cases before DMA segment test (Himal)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patch.msgid.link/amtk7ZddR12dgg-A@intel.com
3 weeks agoMerge tag 'drm-misc-fixes-2026-07-30' of https://gitlab.freedesktop.org/drm/misc...
Dave Airlie [Fri, 31 Jul 2026 04:33:49 +0000 (14:33 +1000)]
Merge tag 'drm-misc-fixes-2026-07-30' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

drm-misc-fies for v7.2-rc6:
- vmwgfx:
  - Improve various size checks and limit checks.
  - Fix oops when submitting  invalid execbuf ioctl.
  - Correctly lock in vmfwgx fence signaling path.
  - More validation of execbuf ioctl.
  - Fix oops in vmwgfx vkms init failure path.
  - Overflow handling in shader path.
- Improve firmware validation in panthor.
- Fix small leak in bridge/display-connector
- Improve imagination trace points.
- Fix QAIC transaction length check.
- Restrict some DP bandwidth calculations to HDMI DFP.

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patch.msgid.link/178a513f-2d7f-4e3a-811b-cd0d9dc309eb@linux.intel.com
3 weeks agoMerge tag 'amd-drm-fixes-7.2-2026-07-29' of https://gitlab.freedesktop.org/agd5f...
Dave Airlie [Fri, 31 Jul 2026 04:20:17 +0000 (14:20 +1000)]
Merge tag 'amd-drm-fixes-7.2-2026-07-29' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-7.2-2026-07-29:

amdgpu:
- VCN 5.3 fix
- UserQ fixes
- GEM close optimization
- HDMI AV mute fix
- UML build fixes
- GFXOFF residency metrics fixes
- SMU 15 fixes
- debug_vm fix
- PSP 15 fixes
- NBIO 7.11.5 fix
- pptable use after free fix
- gpu metrics fetch fix
- DC viewport fix
- DML2.1 fix
- i2c retimer spam fix
- UMD profile pstate fix
- Power metrics format cleanup
- GTT size fix on APUs
- DC context logging fix

amdkfd:
- Various bounds checking fixes
- Mutex locking fix

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20260729182209.4072227-1-alexander.deucher@amd.com
3 weeks agoMerge tag 'mediatek-drm-fixes-20260729' of https://git.kernel.org/pub/scm/linux/kerne...
Dave Airlie [Fri, 31 Jul 2026 04:09:29 +0000 (14:09 +1000)]
Merge tag 'mediatek-drm-fixes-20260729' of https://git./linux/kernel/git/chunkuang.hu/linux into drm-fixes

Mediatek DRM Fixes - 20260729

1. Check CRTC state before freeing
2. mtk_hdmi: Fix DDC adapter double put in v2
3. mtk_hdmi_common: take i2c adapter module reference
4. mtk_dsi: Enable HS clock only at pre-enable
5. ovl_adaptor: balance component registrations

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://patch.msgid.link/20260729131701.4158-1-chunkuang.hu@kernel.org
3 weeks agoMerge tag 'v7.2-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Linus Torvalds [Fri, 31 Jul 2026 00:41:25 +0000 (17:41 -0700)]
Merge tag 'v7.2-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:

 - fix SMB1 read and write potential buffer leaks

 - netfs error handling fix

 - fix check for last write time in truncate and setattr and cleanup use
   of smb_store_release()

 - fscache fix and cleanup

 - validate idmap key payload length

 - minor SMB1 error mapping cleanup

 - witness protocol memory allocation fix

* tag 'v7.2-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: add fscache_resize_cookie() to cifs_setsize()
  cifs: fix time_last_write stamp placement in setattr/truncate paths
  cifs: consolidate time_last_write stamp into _cifsFileInfo_put()
  smb: client: simplify cifs_fscache_get_super_cookie()
  smb: client: free partially allocated transform folio queue
  cifs: validate idmap key payload length
  smb: client: remove conditional return with no effect
  smb: client: fix buffer leaks in SMB1 read and write
  smb: client: use GFP_KERNEL for registry allocation

3 weeks agoMerge tag 'for-v7.2-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux...
Linus Torvalds [Thu, 30 Jul 2026 23:50:17 +0000 (16:50 -0700)]
Merge tag 'for-v7.2-rc' of git://git./linux/kernel/git/sre/linux-power-supply

Pull power supply fixes from Sebastian Reichel:

 - Documentation build fix for bd71828

 - max17040: handle missing status supplier

 - macsmc: Support macOS 27 SMC firmware

 - bq25890: fix the -10 C NTC lookup entry

* tag 'for-v7.2-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
  power: supply: bq25890: fix the -10 C NTC lookup entry
  power: supply: macsmc: Support macOS 27 SMC firmware
  power: supply: max17040: handle missing status supplier
  power: supply: bd71828: add a terminating table border

3 weeks agoksmbd: use memcmp() to compare ClientGUIDs
Namjae Jeon [Mon, 20 Jul 2026 01:32:01 +0000 (10:32 +0900)]
ksmbd: use memcmp() to compare ClientGUIDs

ClientGUID is a fixed-size binary value and can contain embedded NUL
bytes. strncmp() stops comparing at the first NUL byte, so different
ClientGUID values can incorrectly be treated as equal.

Use memcmp() in SMB3 multichannel session binding and
FSCTL_VALIDATE_NEGOTIATE_INFO to compare all SMB2_CLIENT_GUID_SIZE
bytes.

Fixes: f5a544e3bab7 ("ksmbd: add support for SMB3 multichannel")
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Reported-by: Samu <nomomentomori@gmail.com>
Suggested-by: Samu <nomomentomori@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
3 weeks agoksmbd: reject repeated SMB2 NEGOTIATE requests
Namjae Jeon [Thu, 23 Jul 2026 14:07:14 +0000 (23:07 +0900)]
ksmbd: reject repeated SMB2 NEGOTIATE requests

Unauthenticated client can send multiple successful SMB2 NEGOTIATE
requests on one connection before SESSION_SETUP. While the connection is
in KSMBD_SESS_NEED_SETUP, smb2_handle_negotiate() accepts another
SMB3.1.1 NEGOTIATE and overwrites conn->preauth_info with a new allocation.
Only the final allocation is freed when the connection is released, leaking
one object for every additional successful request.

A repeated SMB2 NEGOTIATE after a dialect has been selected is a protocol
violation. MS-SMB2 section 3.3.5.4 requires the server to disconnect
without replying in this case. Set the connection exiting when rejecting
the request, in addition to suppressing the response.

Reject SMB2 NEGOTIATE unless the connection is new or is waiting for the
SMB2 NEGOTIATE that follows an SMB1 multi-protocol negotiate. Serialize
both SMB1 and SMB2 negotiation paths under conn->srv_mutex, since they
update connection-wide dialect and negotiation state.

Move the locking contract to ksmbd_smb_negotiate_common(), where the state
and dialect are selected, and add ksmbd_conn_new() for consistent state
access.

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Reported-by: Runa Takemoto <takemotoruna223@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
3 weeks agoksmbd: fix use-after-free in __close_file_table_ids()
Namjae Jeon [Wed, 22 Jul 2026 01:04:19 +0000 (10:04 +0900)]
ksmbd: fix use-after-free in __close_file_table_ids()

A ksmbd_file can remain alive after logical close while another session
holds a temporary reference obtained through ksmbd_lookup_fd_inode().
ksmbd_close_fd() currently marks the file closed and drops the idr-owned
reference, but leaves the pointer published in the closing session's idr
until the final reference is dropped.

If the foreign holder performs the final ksmbd_fd_put(), __put_fd_final()
supplies the foreign session's file table to __ksmbd_close_fd(). The object
is then freed without being removed from its owner's idr, and the owner
session later dereferences the stale pointer during file-table teardown.

Remove the volatile id from the owner's idr while ksmbd_close_fd() still
holds that table's lock, and clear volatile_id before dropping
the idr-owned reference. A later foreign final put then only performs
physical destruction and cannot remove the object from the wrong table.

Fixes: 8510a043d334 ("ksmbd: increment reference count of parent fp")
Reported-by: Yunseong Kim <yunseong.kim@est.tech>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
3 weeks agoMerge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg...
Linus Torvalds [Thu, 30 Jul 2026 22:12:31 +0000 (15:12 -0700)]
Merge tag 'for-linus-iommufd' of git://git./linux/kernel/git/jgg/iommufd

Pull iommufd fixes from Jason Gunthorpe:
 "Several bug fixes found by tools and fuzzing:

   - Incorrect domain passed during replace to ack faults

   - Block the access API from using dmabuf

   - Missing unlock on error unwind

   - Race seeing a partially setup vdevice in the xarray

   - Do not allow vdevices to have multiple stream ids in SMMUv3

   - Possible UAF if racing faults with domain changes"

* tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd:
  iommu/iommufd: Fix IOPF group ownership UAF
  iommu/arm-smmu-v3-iommufd: Require exactly one Stream ID for a vDEVICE
  iommufd/viommu: Publish a vDEVICE only after vdevice_init() succeeds
  iommufd/viommu: Release the igroup lock on the vdevice_size error path
  iommufd: Reject DMABUF pages from the access pin path
  iommufd: Fix wrong hwpt passed to iommufd_auto_response_faults on replace

3 weeks agoMerge tag 'audit-pr-20260730' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoor...
Linus Torvalds [Thu, 30 Jul 2026 22:04:23 +0000 (15:04 -0700)]
Merge tag 'audit-pr-20260730' of git://git./linux/kernel/git/pcmoore/audit

Pull audit fixes from Paul Moore:

 - Fix potential integer overflows in audit_log_n_string()

   Similar to the earlier fix to audit_log_n_hex() that you merged
   earlier in July. Expect a cleaner, and generally better fix for these
   functions in an upcoming merge window, but this addresses the problem
   in a small patch that should be easy for people to backport.

 - Fix potential use-after-free in audit_del_rule()

* tag 'audit-pr-20260730' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
  audit: fix potential use-after-free in audit_del_rule()
  audit: fix potential integer overflow in audit_log_n_string()

3 weeks agoio_uring: preserve task restrictions across exec
Kyumin Lee [Thu, 30 Jul 2026 19:27:34 +0000 (04:27 +0900)]
io_uring: preserve task restrictions across exec

Per-task restrictions apply to all rings created by a task. Once
installed, they should not be dropped across exec.

For a task that has used io_uring, the exec cancellation path calls
__io_uring_free(). This frees both the task context and the per-task
restriction, so a ring created after exec is unrestricted.

Split task context cleanup into io_uring_free_tctx(), and use it from
the exec cancellation path. Keep __io_uring_free() for final task
cleanup, where both the context and restriction are released.

Fixes: ed82f35b926b ("io_uring: allow registration of per-task restrictions")
Cc: stable@vger.kernel.org # 7.1+
Signed-off-by: Kyumin Lee <fyonglkm@gmail.com>
Link: https://patch.msgid.link/20260730192734.459247-1-fyonglkm@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 weeks agodrm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status
Jerome Tollet [Wed, 20 May 2026 02:25:44 +0000 (07:55 +0530)]
drm/i915/hdmi: Poll for 200 msec for TMDS_Scrambler_Status

HDMI 2.0 section 6.1.3.1 specifies that after enabling
Scrambling_Enable and starting scrambled video transmission, the source
should poll Scrambling_Status until it reads 1 or until a timeout of
200 ms expires.

Add a polling step after enabling the HDMI port to check the scrambling
status when HDMI scrambling is enabled.

On some HDMI 2.0 sinks, omitting this check can result in 4K@60Hz
(594 MHz) failing to come up correctly because the sink has not yet
finished its scrambling setup. In practice, waiting for the scrambling
status here fixes such sinks.

While this synchronous polling is not itself explicitly required for
correct modeset sequencing, HDMI 2.0 section 6.1.3.1 does recommend it
as the way for the source to verify that the TMDS link is functioning
correctly with scrambling enabled.

v3:
 - Add explicit HDMI 2.0 section reference in code comment
 - Clarify commit message around the observed sink fix

v2:
 - Poll TMDS_Scrambler_Status for up to 200 ms instead of using a fixed
   delay

Reported-by: Jerome Tollet <jtollet@cisco.com>
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6868
Link: https://lore.kernel.org/dri-devel/20251230091037.5603-1-jerome.tollet@gmail.com/
Signed-off-by: Jerome Tollet <jerome.tollet@gmail.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
Link: https://patch.msgid.link/20260520022544.3097252-1-ankit.k.nautiyal@intel.com
(cherry picked from commit b7d51d65e4f12a48392d260613108ec262bc7774)
Fixes: 15953637886d ("drm/i915: enable scrambling")
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
3 weeks agoio_uring/zcrx: don't clear master_ctx from the import path
Woraphat Khiaodaeng [Thu, 30 Jul 2026 16:27:41 +0000 (16:27 +0000)]
io_uring/zcrx: don't clear master_ctx from the import path

import_zcrx() attaches an existing ifq to another ring.  It never calls
zcrx_set_ring_ctx() and so never takes the ->master_ctx reference, but
its error path still passes @ctx to zcrx_unregister(), which clears
->master_ctx and drops its percpu_ref whenever ifq->master_ctx == ctx.

That condition is reachable.  A ring that registers an ifq with a
non-zero event type_mask gets ->master_ctx pointed at itself, and
nothing stops it from exporting that ifq with ZCRX_CTRL_EXPORT and
importing the resulting fd back into the same ring.  Failing the import
after the refcount bumps -- an argument page mapped PROT_READ makes the
copy_to_user() in import_zcrx() return -EFAULT -- then clears the
->master_ctx owned by the original registration, which is still live.

Refcounts stay balanced and nothing is freed early, so there is no
splat.  The ring silently stops receiving ZCRX_EVENT_ALLOC_FAIL and
ZCRX_EVENT_COPY: zcrx_send_notif() returns early on a NULL
->master_ctx, and ->master_ctx is only ever set on a freshly allocated
ifq, so it cannot be restored without tearing the ring down.

Pass NULL instead, matching zcrx_box_release() and the zcrx_export()
error path.  io_register_zcrx() only gets away with passing @ctx
because zcrx_set_ring_ctx() runs after its last goto err.

Fixes: 00d91481279f ("io_uring/zcrx: share an ifq between rings")
Signed-off-by: Woraphat Khiaodaeng <worapat.kd2@gmail.com>
Link: https://patch.msgid.link/20260730162741.1125-1-worapat.kd2@gmail.com
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
[axboe: add pavel edit]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 weeks agoMerge tag 'pm-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Linus Torvalds [Thu, 30 Jul 2026 19:03:50 +0000 (12:03 -0700)]
Merge tag 'pm-7.2-rc6' of git://git./linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix issues related to cpufreq, in the ACPI CPPC library and the
  generic CPPC cpufreq driver, in the powernow-k8 and amd-pstate
  drivers, and in the schedutil governor:

   - Allow fast frequency switching in the ACPI CPPC library only when
     every supported control used by the driver callback has an address
     space already accepted for fast access (Christian Loehle)

   - Skip writes to unsupported performance controls in the ACPI CPPC
     library (Christian Loehle)

   - Update cppc_cpufreq_update_perf_limits() to read policy->min and
     policy->max once and, if the lockless snapshot is inconsistent,
     reduce the minimum to the observed maximum, along the lines of
     cpufreq_driver_resolve_freq() (Christian Loehle)

   - Fix a possible memory leak in the powernowk8_cpu_init() error paths
     (Abdun Nihaal)

   - Loosen the requirement on lowest nonlinear frequency != min freq in
     the amd-pstate driver that is too tight for new systems some of
     which actually have the lowest nonlinear frequency identical to the
     minimum frequency (Mario Limonciello)

   - Prevent amd-pstate from loading on unsupported hardware (Rong
     Zhang)

   - Address an initialization race in the schedutil governor when it
     runs on multi-CPU cpufreq policies, by making it initialize all
     per-CPU structures first and only then publish the per-CPU
     utilization update hooks (Zhongqiu Han)"

* tag 'pm-7.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: powernow-k8: Fix possible memory leak in powernowk8_cpu_init()
  ACPI: CPPC: Skip writes to unsupported performance controls
  cpufreq/amd-pstate: Prevent the driver from loading on unsupported hardware
  cpufreq/amd-pstate: Loosen requirement on lowest nonlinear frequency != min freq
  cpufreq: schedutil: Publish util hooks only after all sg_cpu are initialized
  cpufreq: cppc: Sanitize lockless policy limit snapshots
  ACPI: CPPC: Check all controls for fast switching

3 weeks agos390/vfio_ccw: Implement a crw lock
Eric Farman [Tue, 28 Jul 2026 03:30:22 +0000 (05:30 +0200)]
s390/vfio_ccw: Implement a crw lock

Unlike the channel_program struct, which covers synchronous I/O
submissions and asynchronous interrupts, the CRW region relies
exclusively on asynchronous events coming from hardware.

Implement a lock to manage the list of those payloads, to ensure
they are read cohesively.

Fixes: 3f02cb2fd9d2 ("vfio-ccw: Wire up the CRW irq and CRW region")
Cc: stable@vger.kernel.org
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Selectively expand io_mutex
Eric Farman [Tue, 28 Jul 2026 03:30:21 +0000 (05:30 +0200)]
s390/vfio_ccw: Selectively expand io_mutex

The io_mutex was defined to serialize the io_regions, but then has
also sort of been associated with the I/O themselves because of
the close relationship they share.

With the handful of races that are possible, the choices are either to:
 A) expand the scope of io_mutex to close these remaining windows, or
 B) reduce the scope of io_mutex to just io_region, and introduce a new
    lock mechanism for the remaining I/O resources

This patch implements A, since B brings with it a lot more interactions
that would need to be tracked and kept in a correct hierarchy. It also
takes advantage of the workqueue element for cp_free() that now gets
called out of fsm_notoper(), which could be invoked out of an interrupt
context and thus cannot acquire a mutex itself.

Fixes: 4f76617378ee ("vfio-ccw: protect the I/O region")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Move cp cleanup out of not operational
Eric Farman [Tue, 28 Jul 2026 03:30:20 +0000 (05:30 +0200)]
s390/vfio_ccw: Move cp cleanup out of not operational

The fsm_notoper() routine is called when the device has been
lost, and is (by definition) no longer operational. Since this
can happen asynchronously from the normal behavior of the
driver, the cleanup may happen when holding other locks
in the calling sequence (notably, the cio subchannel lock).

Push the cleanup of the private->cp resources to a workqueue,
where it can be done out from under that lock sequence and
a future patch can safely manage the locking requirements.

Fixes: 204b394a23ad ("vfio/ccw: Move FSM open/close to MDEV open/close")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Cancel existing workqueues
Eric Farman [Tue, 28 Jul 2026 03:30:19 +0000 (05:30 +0200)]
s390/vfio_ccw: Cancel existing workqueues

The initialization of the io_work and crw_work workqueues begs the
question of whether they should be un-initialized. Add the corresponding
cleanup tags in _release_dev to ensure work isn't dispatched after
the private struct is free'd.

Suggested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Fixes: e5f84dbaea59 ("vfio: ccw: return I/O results asynchronously")
Fixes: 3f02cb2fd9d2 ("vfio-ccw: Wire up the CRW irq and CRW region")
Cc: stable@vger.kernel.org
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Ensure index for read/write regions are within range
Eric Farman [Tue, 28 Jul 2026 03:30:18 +0000 (05:30 +0200)]
s390/vfio_ccw: Ensure index for read/write regions are within range

The introduction of the capability chain rightly clamped the
region indexes to the range of the capabilities itself, but
neglected to do so for the existing read/write regions which
should also be enforced.

Fixes: db8e5d17ac03 ("vfio-ccw: add capabilities chain")
Cc: stable@vger.kernel.org
Cc: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Calculate idal length based on idaw type
Eric Farman [Tue, 28 Jul 2026 03:30:17 +0000 (05:30 +0200)]
s390/vfio_ccw: Calculate idal length based on idaw type

Sashiko pointed out that get_guest_idal() unconditionally calculates
the length of the IDAL presuming everything is a Format-2 IDAW.

The output of vfio-ccw is always Format-2, but the input can be either
Format-1 (31-bit addresses) or Format-2 (64-bit addresses). As a result,
the size of the guest IDAL may be incorrect and should be trimmed down.

Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/r/20260720203400.7328E1F000E9@smtp.kernel.org/
Fixes: 1b676fe3d9d3 ("vfio/ccw: handle a guest Format-1 IDAL")
Cc: stable@vger.kernel.org
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Ensure first IDAW remains constant
Eric Farman [Tue, 28 Jul 2026 03:30:16 +0000 (05:30 +0200)]
s390/vfio_ccw: Ensure first IDAW remains constant

The first IDAW in a list does not need to be on a 2K/4K boundary
like all others, and so is read separately to accurately calculate
the size of the buffer needed to read the full IDAL.

Verify that the address found in the first IDAW is unchanged between
reads, to ensure a consistent set of IDAWs being worked with.

Fixes: 01aa26c672c0 ("s390/cio: Combine direct and indirect CCW paths")
Cc: stable@vger.kernel.org
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Fix out of bounds check on CCW array
Eric Farman [Tue, 28 Jul 2026 03:30:15 +0000 (05:30 +0200)]
s390/vfio_ccw: Fix out of bounds check on CCW array

The routine ccwchain_calc_length() counts the number of channel
command words (CCWs) that are chained together in a single channel
program, and rejects anything larger than CCWCHAIN_LEN_MAX (256) CCWs.

The loop itself is "do..while (count < 257)", and while the logic in
is_cpa_within_range() correctly adjusts between the 0-index array of
CCWs and the count of CCWs starting at 1, this means it would look
at a possible 257th CCW before ending the loop and (correctly)
returning an error.

Fix this by restructuring the loop to break as soon as 256 CCWs
(thus indexes 0-255) are examined, without looking at memory
outside the range.

Fixes: 0a19e61e6d4c ("vfio: ccw: introduce channel program interfaces")
Cc: stable@vger.kernel.org
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Limit the number of channel program segments
Eric Farman [Tue, 28 Jul 2026 03:30:14 +0000 (05:30 +0200)]
s390/vfio_ccw: Limit the number of channel program segments

The processing of channel programs, and the CCWs within them, is done
recursively. As such, there is an arbitrary (but not architectural)
limit to the number of CCWs that can exist in a single channel program.

The vfio-ccw logic breaks these channel programs into segments whenever
it encounters a Transfer-In-Channel (TIC) CCW, and the combined number
of segments count towards the global limit. Impose an equivalent limit
to the number of segments until such logic can be made non-recursive.

Fixes: 0a19e61e6d4c ("vfio: ccw: introduce channel program interfaces")
Cc: stable@vger.kernel.org
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agos390/vfio_ccw: Free all memory if cp_init() fails
Eric Farman [Tue, 28 Jul 2026 03:30:13 +0000 (05:30 +0200)]
s390/vfio_ccw: Free all memory if cp_init() fails

The routine cp_free() is called to unpin/free any memory once an I/O
is completed successfully, or if cp_prefetch() fails. But if cp_init()
fails, and cp->initialized is not enabled, the same routine cannot be
used to free all the memory.

An attempt to address this exists in ccwchain_handle_ccw(), where a
single call to ccwchain_free() is made for the currently-processed
CCW segment. But this will leak other segments (created as a result
of a Transfer in Channel) that had been allocated as part of the same
channel program.

Address this by performing the cleanup outside of the recursive
ccwchain_handle_ccw()/ccwchain_loop_tic() logic.

Fixes: 8b515be512a2 ("vfio-ccw: Fix memory leak and don't call cp_free in cp_init")
Cc: stable@vger.kernel.org
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
3 weeks agoRevert "io_uring/epoll: disallow adding an epoll file to an epoll context"
Jens Axboe [Thu, 30 Jul 2026 16:33:14 +0000 (10:33 -0600)]
Revert "io_uring/epoll: disallow adding an epoll file to an epoll context"

Turns out that my naive assumption that surely nobody is using io_uring
to manage nested epoll instances was wrong - libuv is in fact doing that
very thing. Since we have users in the wild using that feature, we
cannot remove it from upstream. Revert the commit that introduced that
limitation.

This reverts commit cfa1539b24aff18ecb71c6334e7270f810d145bb.

Link: https://lore.kernel.org/io-uring/605939add4dfb674bd7ab39ef8dbd3fd22e754e4.camel@xry111.site/
Reported-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
3 weeks agoio_uring/kbuf: cap buffer selection length at MAX_RW_COUNT
Jens Axboe [Sun, 26 Jul 2026 14:13:09 +0000 (08:13 -0600)]
io_uring/kbuf: cap buffer selection length at MAX_RW_COUNT

io_ring_buffers_peek() builds an iovec array from provided buffers, and
that in turn can be handed off to a lower level provider. Be prudent and
cap the total size to MAX_RW_COUNT, which is the Linux default for how
much IO do to in a single call.

No bugs here, but it's a good preventative measure to avoid truncation
issues.

Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>