All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Joe Moriarty <joe.moriarty@oracle.com>,
	rkrcmar@redhat.com, kvm@vger.kernel.org,
	Xiao Guangrong <xiaoguangrong@tencent.com>
Subject: Re: [PATCH v1 1/1] KVM: X86: NULL pointer dereference [null-pointer-deref] (CWE 476) problem
Date: Wed, 14 Feb 2018 18:33:52 +0100	[thread overview]
Message-ID: <06fe1847-28a8-7457-e0c8-81ede5b68c8f@redhat.com> (raw)
In-Reply-To: <6e222b28-5c6e-5a57-1eb4-a9d8cc2b7dbe@oracle.com>

On 14/02/2018 17:55, Joe Moriarty wrote:
>>
> Hi Paolo,
> 
> Thank you for the review.  I wasn't sure if the change I proposed was
> correct or not.  I will take your suggestion of posting to the mailing
> list instead of as a patch the next time I encounter a situation like
> this again.  In the meantime, I will look at doing your suggestion of
> passing kvm_memory_slot down to gfn_to_rmap() and the other functions
> you pointed out above for the next version of the patch.

It's not easy, but I can send you a box of beers if you get round to it.
 Note that I'm still not sure how the NULL pointer dereference can
happen, and you didn't include more output from your tool, so you might
be wasting your time after all...

Anyway, I would start basically by mapping the paths from try_async_pf's
callers to mmu_set_spte and from there to rmap_add.

On the other hand, in the rmap_remove path, you probably should just
exit immediately if slot is NULL.  (Guangrong, do you have any idea why
we don't zap SPTEs in kvm_arch_free_memslot?)

Paolo

  reply	other threads:[~2018-02-14 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 18:26 [PATCH v1 0/1] Parfait changes Joe Moriarty
2018-02-13 18:26 ` [PATCH v1 1/1] KVM: X86: NULL pointer dereference [null-pointer-deref] (CWE 476) problem Joe Moriarty
2018-02-14 16:28   ` Paolo Bonzini
2018-02-14 16:55     ` Joe Moriarty
2018-02-14 17:33       ` Paolo Bonzini [this message]
2018-02-14 18:14         ` Joe Moriarty
2018-02-14 21:42           ` Paolo Bonzini

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=06fe1847-28a8-7457-e0c8-81ede5b68c8f@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=joe.moriarty@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=xiaoguangrong@tencent.com \
    /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.