From: roel kluin <roel.kluin@gmail.com>
To: kvm-ia64@vger.kernel.org
Subject: Re: [PATCH] KVM: dereference of NULL pointer in set_pal_result()
Date: Fri, 08 Jan 2010 12:25:29 +0000 [thread overview]
Message-ID: <25e057c01001080425q33ea8641ncf940c60700e9410@mail.gmail.com> (raw)
In-Reply-To: <4B465C2D.8030303@gmail.com>
>> For the check "(p && p->exit_reason = EXIT_REASON_PAL_CALL", if p is NULL, the reference about "p->exit_reason = EXIT_REASON_PAL_CALL" won't be checked any more, so no issue here.
>> > p = kvm_get_exit_data(vcpu);
>> > - if (p && p->exit_reason = EXIT_REASON_PAL_CALL) {
>> > + if (!p)
>> > + return;
>> > + if (p->exit_reason = EXIT_REASON_PAL_CALL) {
>> > p->u.pal_data.ret = result;
>> > - return ;
>> > + return;
>> > }
>> > INIT_PAL_STATUS_UNIMPLEMENTED(p->u.pal_data.ret);
>
> IMHO it's not the test but the INIT_PAL_STATUS_UNIMPLEMENTED() that does
> the unwanted dereferencing, and that's fixed by the patch.
>
> Gabor
Correct. Thanks,
Roel
prev parent reply other threads:[~2010-01-08 12:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-07 22:11 [PATCH] KVM: dereference of NULL pointer in set_pal_result() Roel Kluin
2010-01-07 23:28 ` Zhang, Xiantao
2010-01-08 7:12 ` Gabor Gombas
2010-01-08 9:14 ` Zhang, Xiantao
2010-01-08 12:25 ` roel kluin [this message]
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=25e057c01001080425q33ea8641ncf940c60700e9410@mail.gmail.com \
--to=roel.kluin@gmail.com \
--cc=kvm-ia64@vger.kernel.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).