<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/virt, branch v5.12.15</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.12.15</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.12.15'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-05-12T06:39:27Z</updated>
<entry>
<title>nitro_enclaves: Fix stale file descriptors on failed usercopy</title>
<updated>2021-05-12T06:39:27Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@grsecurity.net</email>
</author>
<published>2021-04-29T16:59:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3494c68d79cbb7ddff88fd35e0796343ef736606'/>
<id>urn:sha1:3494c68d79cbb7ddff88fd35e0796343ef736606</id>
<content type='text'>
commit f1ce3986baa62cffc3c5be156994de87524bab99 upstream.

A failing usercopy of the slot uid will lead to a stale entry in the
file descriptor table as put_unused_fd() won't release it. This enables
userland to refer to a dangling 'file' object through that still valid
file descriptor, leading to all kinds of use-after-free exploitation
scenarios.

Exchanging put_unused_fd() for close_fd(), ksys_close() or alike won't
solve the underlying issue, as the file descriptor might have been
replaced in the meantime, e.g. via userland calling close() on it
(leading to a NULL pointer dereference in the error handling code as
'fget(enclave_fd)' will return a NULL pointer) or by dup2()'ing a
completely different file object to that very file descriptor, leading
to the same situation: a dangling file descriptor pointing to a freed
object -- just in this case to a file object of user's choosing.

Generally speaking, after the call to fd_install() the file descriptor
is live and userland is free to do whatever with it. We cannot rely on
it to still refer to our enclave object afterwards. In fact, by abusing
userfaultfd() userland can hit the condition without any racing and
abuse the error handling in the nitro code as it pleases.

To fix the above issues, defer the call to fd_install() until all
possible errors are handled. In this case it's just the usercopy, so do
it directly in ne_create_vm_ioctl() itself.

Signed-off-by: Mathias Krause &lt;minipli@grsecurity.net&gt;
Signed-off-by: Andra Paraschiv &lt;andraprs@amazon.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20210429165941.27020-2-andraprs@amazon.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Correct type casting of argument of copy_from_user()</title>
<updated>2021-03-10T15:59:50Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-03-10T15:37:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1201d68f4781141411e734315f22457e6ea2cfcb'/>
<id>urn:sha1:1201d68f4781141411e734315f22457e6ea2cfcb</id>
<content type='text'>
hsm.c:336:50: warning: incorrect type in argument 2 (different address spaces)
hsm.c:336:50:    expected void const [noderef] __user *from
hsm.c:336:50:    got void *

This patch fixes above sparse warning.

Fixes: 3d679d5aec64 ("virt: acrn: Introduce interfaces to query C-states and P-states allowed by hypervisor")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210310153708.17451-1-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Use EPOLLIN instead of POLLIN</title>
<updated>2021-03-10T08:50:23Z</updated>
<author>
<name>Yejune Deng</name>
<email>yejune.deng@gmail.com</email>
</author>
<published>2021-03-10T07:49:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a758b7c4c6f21f8e117fc8097c56fd9967363c15'/>
<id>urn:sha1:a758b7c4c6f21f8e117fc8097c56fd9967363c15</id>
<content type='text'>
This fixes the following sparse warning:
"sparse warnings: (new ones prefixed by &gt;&gt;)"
&gt;&gt; drivers/virt/acrn/irqfd.c:163:13: sparse: sparse: restricted __poll_t
 degrades to integer

Fixes: dcf9625f2adf ("virt: acrn: Use vfs_poll() instead of f_op-&gt;poll()")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Acked-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Signed-off-by: Yejune Deng &lt;yejune.deng@gmail.com&gt;
Link: https://lore.kernel.org/r/20210310074901.7486-1-yejune.deng@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Use vfs_poll() instead of f_op-&gt;poll()</title>
<updated>2021-03-10T08:16:09Z</updated>
<author>
<name>Yejune Deng</name>
<email>yejune.deng@gmail.com</email>
</author>
<published>2021-02-21T13:33:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dcf9625f2adf33cf3ea14c72b436b7c212807e51'/>
<id>urn:sha1:dcf9625f2adf33cf3ea14c72b436b7c212807e51</id>
<content type='text'>
Use a more advanced function vfs_poll() in acrn_irqfd_assign().
At the same time, modify the definition of events.

Signed-off-by: Yejune Deng &lt;yejune.deng@gmail.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210221133306.33530-1-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Make remove_cpu sysfs invisible with !CONFIG_HOTPLUG_CPU</title>
<updated>2021-03-10T08:16:09Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-21T13:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e54b78886949e16301e8ac3cc4b2b43969bfe5fa'/>
<id>urn:sha1:e54b78886949e16301e8ac3cc4b2b43969bfe5fa</id>
<content type='text'>
Without cpu hotplug support, vCPU cannot be removed from a Service VM.
Don't expose remove_cpu sysfs when CONFIG_HOTPLUG_CPU disabled.

Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Qais Yousef &lt;qais.yousef@arm.com&gt;
Acked-by: Randy Dunlap &lt;rdunlap@infradead.org&gt; # build-tested
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210221134339.57851-2-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Introduce an interface for Service VM to control vCPU</title>
<updated>2021-02-09T09:58:19Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-07T03:10:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=279dcf693ac76c9d16b91ffc41280babaff26bb2'/>
<id>urn:sha1:279dcf693ac76c9d16b91ffc41280babaff26bb2</id>
<content type='text'>
ACRN supports partition mode to achieve real-time requirements. In
partition mode, a CPU core can be dedicated to a vCPU of User VM. The
local APIC of the dedicated CPU core can be passthrough to the User VM.
The Service VM controls the assignment of the CPU cores.

Introduce an interface for the Service VM to remove the control of CPU
core from hypervisor perspective so that the CPU core can be a dedicated
CPU core of User VM.

Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Yu Wang &lt;yu1.wang@intel.com&gt;
Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Reviewed-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210207031040.49576-18-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Introduce irqfd</title>
<updated>2021-02-09T09:58:19Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-07T03:10:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=aa3b483ff1d71c50b33db154048dff9a8f08ac71'/>
<id>urn:sha1:aa3b483ff1d71c50b33db154048dff9a8f08ac71</id>
<content type='text'>
irqfd is a mechanism to inject a specific interrupt to a User VM using a
decoupled eventfd mechanism.

Vhost is a kernel-level virtio server which uses eventfd for interrupt
injection. To support vhost on ACRN, irqfd is introduced in HSM.

HSM provides ioctls to associate a virtual Message Signaled Interrupt
(MSI) with an eventfd. The corresponding virtual MSI will be injected
into a User VM once the eventfd got signal.

Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Yu Wang &lt;yu1.wang@intel.com&gt;
Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Reviewed-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210207031040.49576-17-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Introduce ioeventfd</title>
<updated>2021-02-09T09:58:19Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-07T03:10:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d8ad515156b66e7e79a6e4c814f997ee54eb47c7'/>
<id>urn:sha1:d8ad515156b66e7e79a6e4c814f997ee54eb47c7</id>
<content type='text'>
ioeventfd is a mechanism to register PIO/MMIO regions to trigger an
eventfd signal when written to by a User VM. ACRN userspace can register
any arbitrary I/O address with a corresponding eventfd and then pass the
eventfd to a specific end-point of interest for handling.

Vhost is a kernel-level virtio server which uses eventfd for signalling.
To support vhost on ACRN, ioeventfd is introduced in HSM.

A new I/O client dedicated to ioeventfd is associated with a User VM
during VM creation. HSM provides ioctls to associate an I/O region with
a eventfd. The I/O client signals a eventfd once its corresponding I/O
region is matched with an I/O request.

Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Yu Wang &lt;yu1.wang@intel.com&gt;
Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Reviewed-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210207031040.49576-16-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Introduce I/O ranges operation interfaces</title>
<updated>2021-02-09T09:58:19Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-07T03:10:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5a0c9f176f232513d4114a518cbff835d232f500'/>
<id>urn:sha1:5a0c9f176f232513d4114a518cbff835d232f500</id>
<content type='text'>
An I/O request of a User VM, which is constructed by hypervisor, is
distributed by the ACRN Hypervisor Service Module to an I/O client
corresponding to the address range of the I/O request.

I/O client maintains a list of address ranges. Introduce
acrn_ioreq_range_{add,del}() to manage these address ranges.

Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Yu Wang &lt;yu1.wang@intel.com&gt;
Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210207031040.49576-15-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>virt: acrn: Introduce interfaces to query C-states and P-states allowed by hypervisor</title>
<updated>2021-02-09T09:58:19Z</updated>
<author>
<name>Shuo Liu</name>
<email>shuo.a.liu@intel.com</email>
</author>
<published>2021-02-07T03:10:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3d679d5aec648f50e645702929890b9611998a0b'/>
<id>urn:sha1:3d679d5aec648f50e645702929890b9611998a0b</id>
<content type='text'>
The C-states and P-states data are used to support CPU power management.
The hypervisor controls C-states and P-states for a User VM.

ACRN userspace need to query the data from the hypervisor to build ACPI
tables for a User VM.

HSM provides ioctls for ACRN userspace to query C-states and P-states
data obtained from the hypervisor.

Cc: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Cc: Zhenyu Wang &lt;zhenyuw@linux.intel.com&gt;
Cc: Yu Wang &lt;yu1.wang@intel.com&gt;
Cc: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Zhi Wang &lt;zhi.a.wang@intel.com&gt;
Reviewed-by: Reinette Chatre &lt;reinette.chatre@intel.com&gt;
Signed-off-by: Shuo Liu &lt;shuo.a.liu@intel.com&gt;
Link: https://lore.kernel.org/r/20210207031040.49576-14-shuo.a.liu@intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
