All of lore.kernel.org
 help / color / mirror / Atom feed
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Tamas K Lengyel <tamas@tklengyel.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Alexandru Isaila" <aisaila@bitdefender.com>,
	"Petre Pircalabu" <ppircalabu@bitdefender.com>
Subject: Re: [PATCH] xen: vm_event: do not do vm_event_op for an invalid domain
Date: Tue, 18 Mar 2025 00:01:31 +0000	[thread overview]
Message-ID: <87senbi4v9.fsf@epam.com> (raw)
In-Reply-To: <CABfawhkjGAytjnJ8U5vx_baHdxZmpRdPpdwLdUfAa=ujOOvbYQ@mail.gmail.com>	(Tamas K. Lengyel's message of "Mon, 17 Mar 2025 19:51:58 -0400")

Hi Tamas,


Tamas K Lengyel <tamas@tklengyel.com> writes:

> On Mon, Mar 17, 2025 at 7:08 PM Volodymyr Babchuk
> <Volodymyr_Babchuk@epam.com> wrote:
>>
>> A privileged domain can issue XEN_DOMCTL_vm_event_op with
>> op->domain == DOMID_INVALID. In this case vm_event_domctl()
>> function will get NULL as the first parameter and this will
>> cause hypervisor panic, as it tries to derefer this pointer.
>>
>> Fix the issue by checking if valid domain is passed in.
>>
>> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
>>
>> ---
>>
>> This issue was found by the xen fuzzer ([1])
>>
>> [1] https://lore.kernel.org/all/20250315003544.1101488-1-volodymyr_babchuk@epam.com/
>> ---
>>  xen/common/vm_event.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
>> index fbf1aa0848..a4c233de52 100644
>> --- a/xen/common/vm_event.c
>> +++ b/xen/common/vm_event.c
>> @@ -600,6 +600,13 @@ int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec)
>>          return 0;
>>      }
>>
>> +    if ( unlikely(!d) )
>> +    {
>> +        gdprintk(XENLOG_INFO,
>> +                 "Tried to do a memory event op on invalid domain\n");
>
> This is not a memory event op?

Oh, this is good catch. I absent mindedly copied an error message from a
couple of lines below. Looks like we need another patch that fixes error
messages.


--
WBR, Volodymyr

      reply	other threads:[~2025-03-18  0:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 23:08 [PATCH] xen: vm_event: do not do vm_event_op for an invalid domain Volodymyr Babchuk
2025-03-17 23:40 ` Andrew Cooper
2025-03-17 23:51 ` Tamas K Lengyel
2025-03-18  0:01   ` Volodymyr Babchuk [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=87senbi4v9.fsf@epam.com \
    --to=volodymyr_babchuk@epam.com \
    --cc=aisaila@bitdefender.com \
    --cc=ppircalabu@bitdefender.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tamas@tklengyel.com \
    --cc=xen-devel@lists.xenproject.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 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.