public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Krowiak <akrowiak@linux.ibm.com>
To: Halil Pasic <pasic@linux.ibm.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	Rorie Reyes <rreyes@linux.ibm.com>,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, hca@linux.ibm.com, borntraeger@de.ibm.com,
	agordeev@linux.ibm.com, gor@linux.ibm.com, jjherne@linux.ibm.com
Subject: Re: [PATCH v1] s390/vfio-ap: Signal eventfd when guest AP configuration is changed
Date: Fri, 17 Jan 2025 07:53:51 -0500	[thread overview]
Message-ID: <d31e8a98-a87e-41dd-ba41-ba8ac45eadba@linux.ibm.com> (raw)
In-Reply-To: <20250116203034.2ec75969.pasic@linux.ibm.com>




On 1/16/25 2:30 PM, Halil Pasic wrote:
> On Thu, 16 Jan 2025 10:38:41 -0500
> Anthony Krowiak <akrowiak@linux.ibm.com> wrote:
>
>>> Alex, does the above answer your question on what guards against UAF (the
>>> short answer is: matrix_dev->mdevs_lock)?
>> I agree that the matrix_dev->mdevs_lock does prevent changes to
>> matrix_mdev->cfg_chg_trigger while it is being accessed by the
>> vfio_ap device driver. My confusion arises from my interpretation of
>> Alex's question; it seemed to me that he was talking its use outside
>> of the vfio_ap driver and how to guard against that.
> BTW the key for understanding how we are protected form something
> like userspace closing he eventfd is that eventfd_ctx_fdget()
> takes a reference to the internal eventfd context,  which makes
> sure userspace can not shoot us in the foot and the context
> remains to be safe to use until we have done our put. Generally
> userspace is responsible for not shooting itself in the foot,
> so how QEMU uses its end is mostly QEMUs problem in my understanding.

I started digging through that code to try to find the reference to the
eventfd and whether/how it is protected, but got lost in the
twists and turns. Thanks for the info.

>
> Regards,
> Halil


      reply	other threads:[~2025-01-17 12:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-07 18:36 [PATCH v1] s390/vfio-ap: Signal eventfd when guest AP configuration is changed Rorie Reyes
2025-01-13 16:08 ` Alexander Gordeev
2025-02-05 17:33   ` Rorie Reyes
2025-02-05 17:47     ` Anthony Krowiak
2025-02-06  7:40       ` Alexander Gordeev
2025-02-06 14:12         ` Rorie Reyes
2025-02-11  7:58           ` Alexander Gordeev
2025-02-11 15:02             ` Rorie Reyes
2025-02-11 20:24               ` Anthony Krowiak
2025-02-12 10:55                 ` Vasily Gorbik
2025-01-14  9:03 ` Harald Freudenberger
2025-01-16 16:46   ` Anthony Krowiak
2025-01-17  8:30     ` Harald Freudenberger
2025-01-17 12:42       ` Anthony Krowiak
2025-01-14 20:05 ` Alex Williamson
2025-01-15 19:35   ` Anthony Krowiak
2025-01-16  0:17     ` Halil Pasic
2025-01-16 15:38       ` Anthony Krowiak
2025-01-16 16:52         ` Alex Williamson
2025-01-16 19:18           ` Halil Pasic
2025-01-17 12:50             ` Anthony Krowiak
2025-01-17 12:55           ` Anthony Krowiak
2025-01-16 19:30         ` Halil Pasic
2025-01-17 12:53           ` Anthony Krowiak [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=d31e8a98-a87e-41dd-ba41-ba8ac45eadba@linux.ibm.com \
    --to=akrowiak@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jjherne@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.ibm.com \
    --cc=rreyes@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox