All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan@pereq.eu>
To: sashiko-reviews@lists.linux.dev
Cc: kvmarm@lists.linux.dev, Oliver Upton <oupton@kernel.org>,
	Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH] KVM: arm64: nv: Fix NULL dereference in kvm_inject_nested()
Date: Mon, 16 Nov 2026 18:27:17 +0300	[thread overview]
Message-ID: <avsg1V-mvqL3sFkP@stanley.mountain> (raw)
In-Reply-To: <sashiko-outbox-217134@kernel.org>

On Mon, Nov 16, 2026 at 02:06:38PM +0000, sashiko-bot@kernel.org wrote:
> > @@ -2915,7 +2917,8 @@ static int kvm_inject_nested(struct kvm_vcpu *vcpu, u64 esr_el2,
> >  	 */
> >  	__kvm_adjust_pc(vcpu);
> >  
> > -	kvm_arch_vcpu_load(vcpu, smp_processor_id());
> > +	if (loaded)
> > +		kvm_arch_vcpu_load(vcpu, smp_processor_id());
> >  	vcpu_clear_flag(vcpu, IN_NESTED_EXCEPTION);
> >  
> >  	preempt_enable();
> 
> [Severity: High]
> Can kvm_pmu_nested_transition() at the end of kvm_inject_nested() still
> run when the vCPU is not loaded?
> 
> Right below preempt_enable(), kvm_inject_nested() unconditionally calls
> kvm_pmu_nested_transition():
> 
> arch/arm64/kvm/emulate-nested.c:kvm_inject_nested() {
>     ...
> 	preempt_enable();
> 
> 	if (kvm_vcpu_has_pmu(vcpu))
> 		kvm_pmu_nested_transition(vcpu);
> }

Sigh...  Sashiko is right again.  I will resend.

I need to figure out a better way to test patches so this doesn't
happen again...

regards,
dan carpenter


  reply	other threads:[~2026-11-16 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 13:40 [PATCH] KVM: arm64: nv: Fix NULL dereference in kvm_inject_nested() Dan Carpenter
2026-11-16 14:06 ` sashiko-bot
2026-11-16 15:27   ` Dan Carpenter [this message]
2026-11-16 18:11 ` Marc Zyngier

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=avsg1V-mvqL3sFkP@stanley.mountain \
    --to=dan@pereq.eu \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.