Linux/linux 670b77ddrivers/thunderbolt property.c, drivers/usb/core config.c

Merge tag 'usb-7.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB and Thunderbolt fixes from Greg KH:
 "Here is a set of USB fixes and new device ids for 7.1-rc6. Nothing
  major in here, just lots of tiny fixes for reported issues found by
  users and some older patches found by some scanning tools. Included in
  here are:

   - typec fixes found by fuzzers that have decided to finally look at
     that device interaction path (i.e. before a driver is bound to a
     device)

   - typec fixes for issues found by users

   - thunderbolt driver fixes for reported problems

   - cdns3 driver fixes

   - dwc3 driver fixes

    [32 lines not shown]
DeltaFile
+72-45drivers/usb/typec/tcpm/tcpm.c
+40-31drivers/usb/host/xhci-tegra.c
+19-27drivers/usb/core/config.c
+23-9drivers/thunderbolt/property.c
+21-7drivers/usb/gadget/function/f_uvc.c
+15-12drivers/usb/dwc3/dwc3-xilinx.c
+190-13137 files not shown
+445-20643 files

Linux/linux 495fb8darch/mips/dec platform.c, drivers/tty/serial zs.c dz.c

Merge tag 'tty-7.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver fixes from Greg KH:
 "Here are some small serial driver fixes for 7.1-rc6. Included in here
  are:

   - mips serial driver fixes to resolve some long-standing issues with
     how they interacted with the console. That's the "majority" of the
     changes in this merge request

   - sh-sci driver regression fix

   - 8250 driver regression fixes

   - other small serial driver fixes for reported problems.

  All of these have been in linux-next for over a week with no reported
  issues"


    [20 lines not shown]
DeltaFile
+79-139drivers/tty/serial/zs.c
+88-83drivers/tty/serial/dz.c
+108-1arch/mips/dec/platform.c
+13-6drivers/tty/serial/pch_uart.c
+14-2drivers/tty/serial/qcom_geni_serial.c
+12-3drivers/tty/serial/fsl_lpuart.c
+314-2349 files not shown
+341-25015 files

Linux/linux 2544785drivers/iio/adc npcm_adc.c nxp-sar-adc.c, drivers/iio/chemical mhz19b.c

Merge tag 'char-misc-7.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc/iio fixes from Greg KH:
 "Here are some small char/misc/iio driver fixes for 7.1-rc6. Included
  in here are:

   - lots of small IIO driver fixes for reported problems.

   - Android binder bugfixes for reported issues.

   - small comedi test driver fixes

   - counter driver fix

   - parport driver fix (people still use this?)

   - rpi driver fix

   - uio driver fix

    [26 lines not shown]
DeltaFile
+42-14drivers/iio/dac/ad5686.c
+40-14drivers/iio/dac/ad3530r.c
+8-17drivers/iio/adc/npcm_adc.c
+20-4drivers/iio/adc/nxp-sar-adc.c
+8-15drivers/iio/adc/ad4695.c
+17-0drivers/iio/chemical/mhz19b.c
+135-6430 files not shown
+235-10936 files

Linux/linux 05d5d79drivers/gpib/cb7210 cb7210.c

Revert "gpib: cb7210: Fix region leak when request_irq fails"

This reverts commit 2eae90a457baa0048a96ed38ad93090ee38c8b2f.

Turns out not to be correct.

Link: https://lore.kernel.org/r/PpNUbGhrvT8I_KayoDvQYI2PYjmMw1QEkuVBDZz2PwBsVVgPkBXJarc2mBM0IhiH3AQG0GtgqEsDRXNj3yUKEDBaZa25u73pAjvcE6vfRsg=@protonmail.com
Reported-by: Dominik Karol Piątkowski <dominik.karol.piatkowski at protonmail.com>
Cc: Mark Brown <broonie at kernel.org>
Cc: Hongling Zeng <zhongling0719 at 126.com>
Cc: Hongling Zeng <zenghongling at kylinos.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
DeltaFile
+2-8drivers/gpib/cb7210/cb7210.c
+2-81 files

Linux/linux 1246c24fs/smb/server smb2pdu.c smbacl.c

Merge tag 'v7.1-rc6-ksmbd-server-fixes' of git://git.samba.org/ksmbd

Pull smb server fixes from Steve French:

 - security fix for FSCTL_SET_SPARSE

 - fix leak in ksmbd_query_inode_status()

 - fix OOB read in smb_check_perm_dacl()

* tag 'v7.1-rc6-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
  ksmbd: fix FSCTL permission bypass by adding a permission check for FSCTL_SET_SPARSE
  ksmbd: release ksmbd_inode ref via ksmbd_inode_put on lookup paths
  ksmbd: OOB read regression in smb_check_perm_dacl() ACE-walk loops
DeltaFile
+11-0fs/smb/server/smb2pdu.c
+4-4fs/smb/server/smbacl.c
+3-3fs/smb/server/vfs_cache.c
+18-73 files

Linux/linux 2765233drivers/gpu/drm/amd/amdgpu amdgpu_userq.c mes_userqueue.c, drivers/gpu/drm/hyperv hyperv_drm_proto.c

Merge tag 'drm-fixes-2026-05-30' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
 "Regular pull, doesn't seem too insane or AI owned, couple of UAF fixes
  and another repair for an earlier fix, mostly amdgpu and i915 display
  with xe/i915 accel, and misc core/driver fixes.

  It might be a bit bigger than usual at this stage, but I'm not seeing
  anything too scary here.

  dumb-buffer:
   - prevent overflows in dumb-buffer creation

  dma-buf:
   - fix UAF in dma_buf_fd() tracepoint

  gem:
   - fix for the fix for the fix for the change handle ioctl


    [57 lines not shown]
DeltaFile
+49-158drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+97-16drivers/gpu/drm/hyperv/hyperv_drm_proto.c
+33-14drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
+13-18drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
+16-12drivers/gpu/drm/i915/gem/i915_gem_ttm.c
+10-15drivers/gpu/drm/i915/display/intel_psr.c
+218-23321 files not shown
+341-27227 files

Linux/linux f5e5d35Documentation/devicetree/bindings/spi qcom,spi-qpic-snand.yaml, drivers/spi spi-mem.c

Merge tag 'spi-fix-v7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "One substantive fix here, fixing corruption of the maximum frequency
  for spi-mem operations which caused users to remember what should have
  been a temporarily modified maximum frequency as the standard going
  forward, potentially causing instability when the modification raised
  rather than lowered the frequency.

  We also have a trivial patch which just documents the correct way to
  describe the Qualcomm IPQ5210 SNAND controller in the DT, there are no
  code changes"

* tag 'spi-fix-v7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: spi-mem: avoid mutating op template in spi_mem_supports_op()
  spi: dt-bindings: spi-qpic-snand: Add ipq5210 compatible
DeltaFile
+11-4drivers/spi/spi-mem.c
+1-0Documentation/devicetree/bindings/spi/qcom,spi-qpic-snand.yaml
+12-42 files

Linux/linux 230ff93drivers/base/regmap regmap.c

Merge tag 'regmap-fix-v7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fix from Mark Brown:
 "Some other fixing in an API user turned up the fact that we weren't
  correctly applying cache only mode to volatile registers in
  regmap_update_bits(), causing us to try to access hardware that was
  powered off or otherwise not in a state to accept I/O. This fix
  returns an error instead, avoiding more serious consequences"

* tag 'regmap-fix-v7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: reject volatile update_bits() in cache-only mode
DeltaFile
+3-0drivers/base/regmap/regmap.c
+3-01 files

Linux/linux f3be0c9drivers/net/ethernet/microsoft/mana mana_en.c, net/bluetooth hci_core.c l2cap_core.c

Merge tag 'net-7.1-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Pull more networking fixes from Jakub Kicinski:
 "Quick follow up, nothing super urgent here. Main reason I'm sending
  this out is because the IPsec and Bluetooth PRs did not make it
  yesterday. I don't want to have to send you all of this + whatever
  comes next week, for rc7. The fixes under "Previous releases -
  regressions" are for real user-reported regressions from v7.0.

  Previous releases - regressions:

   - Revert "ipv6: preserve insertion order for same-scope addresses"

   - xfrm: move policy_bydst RCU sync, a fix which added a sync RCU on
     netns exit got backported to stable and was causing serious
     accumulation of dying netns's for real workloads

   - pcs-mtk-lynxi: fix bpi-r3 serdes configuration


    [28 lines not shown]
DeltaFile
+48-30drivers/net/ethernet/microsoft/mana/mana_en.c
+3-40net/bluetooth/hci_core.c
+33-8net/bluetooth/l2cap_core.c
+23-5net/xfrm/xfrm_iptfs.c
+18-5net/xfrm/xfrm_state.c
+18-5net/bluetooth/hidp/core.c
+143-9326 files not shown
+273-15432 files

Linux/linux 77590caarch/riscv/include/asm syscall_wrapper.h, include/linux compiler-clang.h syscalls.h

Merge tag 'clang-fixes-7.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux

Pull clang build fix from Nathan Chancellor:
 "A small fix to disable -Wattribute-alias for clang in the few places
  it is already disabled for GCC, now that tip of tree clang has
  implemented -Wattribute-alias as GCC has"

* tag 'clang-fixes-7.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux:
  Disable -Wattribute-alias for clang-23 and newer
DeltaFile
+6-0include/linux/compiler-clang.h
+4-0include/linux/syscalls.h
+4-0arch/riscv/include/asm/syscall_wrapper.h
+4-0include/linux/compat.h
+4-0include/linux/compiler_types.h
+22-05 files

Linux/linux 7164d78drivers/gpu/drm drm_gem.c

drm/gem: fix race between change_handle and handle_delete

drm_gem_change_handle_ioctl leaves the old handle live in the IDR
during the window between spin_unlock(table_lock) and the final
spin_lock(table_lock). A concurrent drm_gem_handle_delete on the old
handle succeeds in this window, decrements handle_count to 0, and frees
the GEM object while the new handle's IDR entry still references it.

NULL the old handle's IDR entry before dropping table_lock so that any
concurrent GEM_CLOSE on the old handle sees NULL and returns -EINVAL.
Restore the old entry on the prime-bookkeeping error path.

Fixes: 5e28b7b94408 ("drm: Set old handle to NULL before prime swap in change_handle")
Signed-off-by: Zhenghang Xiao <kipreyyy at gmail.com>
Cc: stable at vger.kernel.org
Signed-off-by: Dave Airlie <airlied at redhat.com>
Link: https://patch.msgid.link/20260526085313.26791-1-kipreyyy@gmail.com
DeltaFile
+2-0drivers/gpu/drm/drm_gem.c
+2-01 files

Linux/linux d0ee290arch/arm64/kvm sys_regs.c, arch/arm64/kvm/hyp/include/hyp switch.h

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "arm64:

   - Restore CONFIG_PKVM_DISABLE_STAGE2_ON_PANIC to its former glory by
     making sure the config symbol is correctly spelled out in the code

   - Don't reset the AArch32 view of the PMU counters to zero when the
     guest is writing to them

   - Fix an assorted collection of memory leaks in the newly added
     tracing code

   - Fix the capping of ZCR_EL2 which could be used in an unsanitised
     way by an L2 guest

  x86:


    [58 lines not shown]
DeltaFile
+65-26arch/x86/kvm/svm/sev.c
+29-6arch/x86/kvm/svm/avic.c
+10-6arch/arm64/kvm/hyp/include/hyp/switch.h
+14-1arch/x86/virt/hw.c
+10-3arch/x86/kvm/x86.c
+3-8arch/arm64/kvm/sys_regs.c
+131-5016 files not shown
+172-6722 files

Linux/linux 6e40c93drivers/accel/amdxdna aie2_pci.c, drivers/accel/ivpu ivpu_debugfs.c

Merge tag 'drm-misc-fixes-2026-05-29' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

Short summary of fixes pull:

amdxdna:
- require IOMMU on AIE2

dumb-buffer:
- prevent overflows in dumb-buffer creation

dma-buf:
- fix UAF in dma_buf_fd() tracepoint

hyperv:
- improve protocol validation

ivpu:
- test write offset in debugfs


    [7 lines not shown]
DeltaFile
+97-16drivers/gpu/drm/hyperv/hyperv_drm_proto.c
+12-5drivers/accel/rocket/rocket_gem.c
+12-2drivers/gpu/drm/drm_dumb_buffers.c
+5-1drivers/dma-buf/dma-buf.c
+5-0drivers/accel/amdxdna/aie2_pci.c
+1-1drivers/accel/ivpu/ivpu_debugfs.c
+132-256 files

Linux/linux 78ef59edrivers/net/wireguard send.c

Merge branch 'wireguard-fixes-for-7-1-rc6'

Jason A. Donenfeld says:

====================
WireGuard fixes for 7.1-rc6

Please find one small patch, fixing the order of adding padding onto a
packet, to ensure padding bytes get zeroed properly.
====================

Link: https://patch.msgid.link/20260529173134.3080773-1-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
DeltaFile
+10-10drivers/net/wireguard/send.c
+10-101 files

Linux/linux f75e3ebdrivers/net/wireguard send.c

wireguard: send: append trailer after expanding head

With how this is currently written, we add the trailer, zero it out, and
then add the header space on. If that header space requires a
reallocation + copy, the zeros in the trailer aren't copied, because the
skb len hasn't actually been yet expanded to cover that. Instead add the
padding at the end of the process rather than at the beginning.

Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Cc: stable at vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
Link: https://patch.msgid.link/20260529173134.3080773-2-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
DeltaFile
+10-10drivers/net/wireguard/send.c
+10-101 files

Linux/linux 072aa0fnet/ipv6 addrconf.c, tools/testing/selftests/net ioam6.sh

Revert "ipv6: preserve insertion order for same-scope addresses"

Chris Adams reported that preserving insertion order for same-scope
addresses is causing SSH connections to be dropped after stopping a VM
while running NetworkManager.

NetworkManager caches the IPv6 address configuration, when a RA arrives,
it determines the list of addresses to configure and checks if the
addresses are already in the right order in the kernel. If they aren't,
NetworkManager removes and re-adds them to achieve the desired order.

As the order changes, NetworkManager is confused and reconfigures the
addresses on every update. In addition, this would also affect to cloud
tooling that relies on IPv6 addresses order to identify primary and
secondaries addresses.

This reverts commit cb3de96eea66f5e4a580086c6a1be46e765f97f4.

Fixes: cb3de96eea66 ("ipv6: preserve insertion order for same-scope addresses")

    [5 lines not shown]
DeltaFile
+1-1net/ipv6/addrconf.c
+1-1tools/testing/selftests/net/ioam6.sh
+2-22 files

Linux/linux c84ff04net/key af_key.c, net/xfrm xfrm_iptfs.c xfrm_state.c

Merge tag 'ipsec-2026-05-29' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec

Steffen Klassert says:

====================
pull request (net): ipsec 2026-05-29

1) xfrm: route MIGRATE notifications to caller's netns
   Thread the caller's netns through km_migrate() so that
   MIGRATE notifications go to the issuing netns, fixing both the
   init_net listener leak and MOBIKE notifications inside
   non-init netns. From Maoyi Xie.

2) xfrm: ipcomp: Free destination pages on acomp errors
   Move the out_free_req label up so that allocated destination
   pages are released on decompression errors, not only on success.
   From Herbert Xu.

3) xfrm: Check for underflow in xfrm_state_mtu

    [53 lines not shown]
DeltaFile
+23-5net/xfrm/xfrm_iptfs.c
+18-5net/xfrm/xfrm_state.c
+9-8net/xfrm/xfrm_policy.c
+12-4net/xfrm/xfrm_input.c
+8-4net/xfrm/xfrm_ipcomp.c
+3-3net/key/af_key.c
+73-296 files not shown
+83-3912 files

Linux/linux ff6e798net/core skbuff.c

net: skbuff: fix pskb_carve leaking zcopy pages

When SKBFL_MANAGED_FRAG_REFS is set, frag pages are not refcounted but
their lifetime is controlled by the attached ubuf_info. To make a copy
of the skb_shared_info, we either should clear the flag and reference
the frags, or keep the flag and have frags unreferenced.

pskb_carve_inside_header() and pskb_carve_inside_nonlinear() don't
follow the rule and thus can leak page references. Let's clear
SKBFL_MANAGED_FRAG_REFS from the original skb to fix it. It's the
simplest way to address it, but there are more performant ways to do
that if it ever becomes a problem.

Link: https://lore.kernel.org/all/20260523085809.26331-1-nvminh232@clc.fitus.edu.vn/
Fixes: 753f1ca4e1e50 ("net: introduce managed frags infrastructure")
Reported-by: Minh Nguyen <minhnguyen.080505 at gmail.com>
Reported-by: Willem de Bruijn <willemdebruijn.kernel at gmail.com>
Signed-off-by: Pavel Begunkov <asml.silence at gmail.com>
Reviewed-by: Willem de Bruijn <willemb at google.com>

    [2 lines not shown]
DeltaFile
+10-0net/core/skbuff.c
+10-01 files

Linux/linux 9c7da87net/ipv6 route.c

ipv6: fix possible infinite loop in fib6_select_path()

Found while auditing the same pattern Sashiko reported in
rt6_fill_node() [1]. Apply the same fix as
commit f8d8ce1b515a ("ipv6: fix possible infinite loop in fib6_info_uses_dev()").

Writers holding tb6_lock can list_del_rcu(&first->fib6_siblings)
without waiting for RCU readers; first->fib6_siblings.next then
still points into the old ring and this softirq-side walker never
reaches &first->fib6_siblings as its terminator. fib6_purge_rt()
always WRITE_ONCE()s first->fib6_nsiblings to 0 before
list_del_rcu(), so an inside-loop check is a reliable detach signal.

[1] https://sashiko.dev/#/patchset/20260526020227.4857-1-jiayuan.chen%40linux.dev

Fixes: d9ccb18f83ea ("ipv6: Fix soft lockups in fib6_select_path under high next hop churn")
Signed-off-by: Jiayuan Chen <jiayuan.chen at linux.dev>
Reviewed-by: Ido Schimmel <idosch at nvidia.com>
Link: https://patch.msgid.link/20260527053133.180695-2-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
DeltaFile
+3-0net/ipv6/route.c
+3-01 files

Linux/linux 9f72412net/ipv6 route.c

ipv6: fix possible infinite loop in rt6_fill_node()

Sashiko reported this issue [1]. Apply the same fix as
commit f8d8ce1b515a ("ipv6: fix possible infinite loop in fib6_info_uses_dev()").

Writers holding tb6_lock can list_del_rcu(&rt->fib6_siblings)
without waiting for RCU readers; rt->fib6_siblings.next then still
points into the old ring and this softirq-side walker never reaches
&rt->fib6_siblings, causing a CPU stall. fib6_del_route() always
WRITE_ONCE()s rt->fib6_nsiblings to 0 before list_del_rcu(), so an
inside-loop check is a reliable detach signal.

[1] https://sashiko.dev/#/patchset/20260526020227.4857-1-jiayuan.chen%40linux.dev

Fixes: d9ccb18f83ea ("ipv6: Fix soft lockups in fib6_select_path under high next hop churn")
Signed-off-by: Jiayuan Chen <jiayuan.chen at linux.dev>
Reviewed-by: Ido Schimmel <idosch at nvidia.com>
Link: https://patch.msgid.link/20260527053133.180695-1-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
DeltaFile
+2-0net/ipv6/route.c
+2-01 files

Linux/linux f72eed9net/core filter.c

bpf: sockmap: fix tail fragment offset in bpf_msg_push_data

When bpf_msg_push_data() inserts data in the middle of a scatterlist
entry, it splits the original entry into a left fragment and a right
fragment.

The right fragment offset is page-local, but the code advances it with
`start`, which is the message-global insertion point. For inserts into a
non-first SG entry, this over-advances the offset and leaves the split
layout inconsistent.

Advance the right fragment offset by the fragment-local delta,
`start - offset`, which matches the length removed from the front of the
original entry.

Fixes: 6fff607e2f14 ("bpf: sk_msg program helper bpf_msg_push_data")
Cc: stable at kernel.org
Reported-by: Yuan Tan <yuantan098 at gmail.com>
Reported-by: Zhengchuan Liang <zcliangcn at gmail.com>

    [5 lines not shown]
DeltaFile
+1-1net/core/filter.c
+1-11 files

Linux/linux 1e584c3net/vmw_vsock virtio_transport_common.c

vsock/virtio: bind uarg before filling zerocopy skb

virtio_transport_send_pkt_info() allocates or reuses the zerocopy uarg
before entering the send loop, but virtio_transport_alloc_skb() still
fills the skb before it inherits that uarg. When fixed-buffer vectored
zerocopy hits MAX_SKB_FRAGS, io_sg_from_iter() may partially attach
managed frags and return -EMSGSIZE. The rollback path call kfree_skb()
to free an skb that carries SKBFL_MANAGED_FRAG_REFS but no uarg, so
skb_release_data() falls through to ordinary frag unref.

Pass the uarg into virtio_transport_alloc_skb() and bind it immediately
before virtio_transport_fill_skb(). This keeps control or no-payload skbs
untouched while ensuring success and rollback share one lifetime rule.

Fixes: 581512a6dc93 ("vsock/virtio: MSG_ZEROCOPY flag support")
Signed-off-by: Lin Ma <malin89 at huawei.com>
Signed-off-by: Rongzhen Cui <cuirongzhen at huawei.com>
Signed-off-by: Jingguo Tan <tanjingguo at huawei.com>
Acked-by: Arseniy Krasnov <avkrasnov at salutedevices.com>

    [4 lines not shown]
DeltaFile
+9-3net/vmw_vsock/virtio_transport_common.c
+9-31 files

Linux/linux 713074darch/x86/kvm/svm sev.c

Merge commit 'kvm-psc-for-7.1' into HEAD
DeltaFile
+65-26arch/x86/kvm/svm/sev.c
+65-261 files

Linux/linux c8cc238arch/x86/kvm/svm sev.c

KVM: SEV: Use READ_ONCE() when reading entries/indices from PSC buffer

Use READ_ONCE() when reading entries/indices from the guest-accessible
Page State Change buffer to defend against TOCTOU bugs.

Don't bother with READ_ONCE()/WRITE_ONCE() for cases where KVM is writing
(and not consuming the result!), as the guest isn't supposed to touch the
buffer while it's being processed.  I.e. using READ_ONCE() is all about
protecting against misbehaving guests.

Fixes: 9b54e248d264 ("KVM: SEV: Add support to handle Page State Change VMGEXIT")
Cc: stable at vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky at amd.com>
Signed-off-by: Sean Christopherson <seanjc at google.com>
Message-ID: <20260501202250.2115252-11-seanjc at google.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
DeltaFile
+6-6arch/x86/kvm/svm/sev.c
+6-61 files

Linux/linux 121d88darch/x86/kvm/svm sev.c

KVM: SEV: Check PSC request indices against the actual size of the buffer

When processing Page State Change (PSC) requests, validate the PSC buffer
against the effective size of the scratch area, which could be less than
the maximum size if the guest provided a pointer that isn't exactly at the
start of the GHCB shared buffer.

Fixes: 9b54e248d264 ("KVM: SEV: Add support to handle Page State Change VMGEXIT")
Cc: stable at vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky at amd.com>
Reviewed-by: Michael Roth <michael.roth at amd.com>
Signed-off-by: Sean Christopherson <seanjc at google.com>
Message-ID: <20260501202250.2115252-10-seanjc at google.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
DeltaFile
+15-2arch/x86/kvm/svm/sev.c
+15-21 files

Linux/linux ebe4b2darch/x86/kvm/svm sev.c

KVM: SEV: Don't explicitly pass PSC buffer to snp_begin_psc()

Stop explicitly passing the PSC buffer to snp_begin_psc(): it *must*
be the scratch area.  This will allow fixing a variety of bugs without
further complicating the code.

No functional change intended.

Cc: stable at vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky at amd.com>
Reviewed-by: Michael Roth <michael.roth at amd.com>
Signed-off-by: Sean Christopherson <seanjc at google.com>
Message-ID: <20260501202250.2115252-9-seanjc at google.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
DeltaFile
+6-5arch/x86/kvm/svm/sev.c
+6-51 files

Linux/linux 5867d7earch/x86/kvm/svm sev.c

KVM: SEV: Compute the correct max length of the in-GHCB scratch area

When setting the length of the GHCB scratch area, and the area is in the
GHCB shared buffer, set the effective length of the scratch area to the max
possible size given the start of the guest-provided pointer, and the end of
the shared buffer.

The code was "fine" when first introduced, as KVM doesn't consult the
length of the buffer when emulating MMIO, because the passed in @len always
specifies the *max* size required.  But for PSC requests, the incoming @len
is just the minimum length (to process the header), and KVM needs to know
the full size of the scratch area to avoid buffer overflows (spoiler alert).

Opportunistically rename @len => @min_len to better reflect its role.

Fixes: 9b54e248d264 ("KVM: SEV: Add support to handle Page State Change VMGEXIT")
Cc: stable at vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky at amd.com>
Reviewed-by: Michael Roth <michael.roth at amd.com>

    [3 lines not shown]
DeltaFile
+10-9arch/x86/kvm/svm/sev.c
+10-91 files

Linux/linux 1aa8a6darch/x86/kvm/svm sev.c

KVM: SEV: Ignore MMIO requests of length '0'

Explicitly ignore MMIO requests of length '0', so that setting up the
software scratch area (and other code) doesn't have to worry about
underflowing the length, and to allow for special casing '0' in the
future.

Fixes: 8f423a80d299 ("KVM: SVM: Support MMIO for an SEV-ES guest")
Cc: stable at vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky at amd.com>
Signed-off-by: Sean Christopherson <seanjc at google.com>
Message-ID: <20260501202250.2115252-3-seanjc at google.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
DeltaFile
+7-3arch/x86/kvm/svm/sev.c
+7-31 files

Linux/linux 2be5467arch/x86/kvm/svm sev.c

KVM: SEV: Use the size of the PSC header as the minimum size for PSC requests

When handling a Page State Change (PSC) #VMGEXIT use the size of the PSC
header as the minimum size for the scratch area.  Per the GHCB spec, PSC
requests do NOT provide the length, i.e. using control->exit_info_2 for the
length is completely made up behavior.  The existing code "works", e.g.
even though Linux-as-a-guest always passes '0', because KVM doesn't do
anything with the length when the request is in the GHCB's shared buffer.

Use the header as the min length.  Once the header is retrieved, KVM can
use the specified indices to compute the full size of the request.

Fixes: 9b54e248d264 ("KVM: SEV: Add support to handle Page State Change VMGEXIT")
Cc: stable at vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky at amd.com>
Reviewed-by: Michael Roth <michael.roth at amd.com>
Signed-off-by: Sean Christopherson <seanjc at google.com>
Message-ID: <20260501202250.2115252-6-seanjc at google.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
DeltaFile
+1-1arch/x86/kvm/svm/sev.c
+1-11 files

Linux/linux dcf1b2darch/x86/kvm/svm sev.c

KVM: SEV: Reject MMIO requests larger than 8 bytes with GHCB v2+

When using GHCB v2+, reject MMIO requests that are larger than 8 bytes.
Per the GHCB spec:

  SW_EXITINFO2 must be less than or equal to 0x7fffffff for version 1 and
  less than or equal to 0x8 for all other versions.

Fixes: 4af663c2f64a ("KVM: SEV: Allow per-guest configuration of GHCB protocol version")
Cc: stable at vger.kernel.org
Reviewed-by: Tom Lendacky <thomas.lendacky at amd.com>
Signed-off-by: Sean Christopherson <seanjc at google.com>
Message-ID: <20260501202250.2115252-4-seanjc at google.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
DeltaFile
+5-0arch/x86/kvm/svm/sev.c
+5-01 files