Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Paolo Bonzini" <pbonzini@redhat.com>, kvm@vger.kernel.org
Cc: kvmarm@lists.linux.dev, "Oliver Upton" <oupton@kernel.org>,
	"Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH 3/4] KVM: arm64: vgic-its: Add signal checks in scan_its_table()
Date: Fri, 04 Dec 2026 18:23:49 +0000	[thread overview]
Message-ID: <sashiko-outbox-250414@kernel.org> (raw)
In-Reply-To: <20261204175740.2153746-4-pbonzini@redhat.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] KVM: arm64: scan_its_table() returns raw -EINTR on
  signal_pending()
- [Low] KVM: arm64: vgic-its: document -EINTR for
  KVM_DEV_ARM_ITS_RESTORE_TABLES
--

commit c47af74ba02a050024193468999b27c29d77d85d
Author: Raghavendra Rao Ananta <rananta@google.com>

KVM: arm64: vgic-its: Add signal checks in scan_its_table()

This commit adds a signal_pending() check to the scan_its_table() loop so
KVM_DEV_ARM_ITS_RESTORE_TABLES returns -EINTR when a signal is pending.

> diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c
> index 82f7d052efcb3..9c81a8656e943 100644
> --- a/arch/arm64/kvm/vgic/vgic-its.c
> +++ b/arch/arm64/kvm/vgic/vgic-its.c
> @@ -2171,6 +2171,9 @@ static int scan_its_table(struct vgic_its *its, gpa_t base, int size, u32 esz,
>  		int next_offset;
>  		size_t byte_offset;
>  
> +		if (signal_pending(current))
> +			return -EINTR;
> +
>  		ret = kvm_read_guest_lock(kvm, gpa, entry, esz);
>  		if (ret)
>  			return ret;

[Severity: Medium]
Can returning raw -EINTR on signal_pending(current) cause spurious
KVM_DEV_ARM_ITS_RESTORE_TABLES failures?

signal_pending() also triggers on TIF_NOTIFY_SIGNAL task_work (such as
io_uring) and SA_RESTART signals.  Because arch_do_signal_or_restart() only
restarts -ERESTART* codes, raw -EINTR reaches userspace and aborts restore
in VMMs that do not expect or retry -EINTR on this one-shot ioctl.

Switching to -ERESTARTSYS or retrying in userspace is also not idempotent:
vgic_v3_lpi_sync_pending_status() clears pending bits in guest GICR_PENDBASER
RAM during restore, and rollback via its_free_ite() -> vgic_put_irq() frees
unqueued disabled LPIs, silently losing those pending interrupts on retry.

Checking fatal_signal_pending(current) instead avoids both spurious
interruptions and non-idempotent retries.

[Severity: Low]
Should Documentation/virt/kvm/devices/arm-vgic-its.rst be updated to list
-EINTR in the KVM_DEV_ARM_VGIC_GRP_CTRL Errors table if this ioctl can now
return -EINTR to userspace?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204175740.2153746-1-pbonzini@redhat.com?part=3

  reply	other threads:[~2026-12-04 18:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 17:57 [PATCH 0/4] Fixes for various kvm-arm vulnerabilities Paolo Bonzini
2026-12-04 17:57 ` [PATCH 1/4] KVM: arm64: vgic-its: Bound PINTID during ITE table restore Paolo Bonzini
2026-12-04 18:14   ` sashiko-bot
2026-12-04 17:57 ` [PATCH 2/4] irqchip/gic-v4: Contain VMAPTI vINTID to the expected boundaries Paolo Bonzini
2026-12-04 17:57 ` [PATCH 3/4] KVM: arm64: vgic-its: Add signal checks in scan_its_table() Paolo Bonzini
2026-12-04 18:23   ` sashiko-bot [this message]
2026-12-04 17:57 ` [PATCH 4/4] KVM: arm64: vgic: Linearise AP list pruning process Paolo Bonzini
2026-12-04 18:21   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-250414@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox