<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/virt, branch v3.4.95</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/virt?h=v3.4.95</id>
<link rel='self' href='https://git.amat.us/linux/atom/virt?h=v3.4.95'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-03-11T23:10:03Z</updated>
<entry>
<title>KVM: IOMMU: hva align mapping page size</title>
<updated>2014-03-11T23:10:03Z</updated>
<author>
<name>Greg Edwards</name>
<email>gedwards@ddn.com</email>
</author>
<published>2013-11-04T16:08:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f7741e3b3f9d3827e7bc75118118f102553f7564'/>
<id>urn:sha1:f7741e3b3f9d3827e7bc75118118f102553f7564</id>
<content type='text'>
commit 27ef63c7e97d1e5dddd85051c03f8d44cc887f34 upstream.

When determining the page size we could use to map with the IOMMU, the
page size should also be aligned with the hva, not just the gfn.  The
gfn may not reflect the real alignment within the hugetlbfs file.

Most of the time, this works fine.  However, if the hugetlbfs file is
backed by non-contiguous huge pages, a multi-huge page memslot starts at
an unaligned offset within the hugetlbfs file, and the gfn is aligned
with respect to the huge page size, kvm_host_page_size() will return the
huge page size and we will use that to map with the IOMMU.

When we later unpin that same memslot, the IOMMU returns the unmap size
as the huge page size, and we happily unpin that many pfns in
monotonically increasing order, not realizing we are spanning
non-contiguous huge pages and partially unpin the wrong huge page.

Ensure the IOMMU mapping page size is aligned with the hva corresponding
to the gfn, which does reflect the alignment within the hugetlbfs file.

Reviewed-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Signed-off-by: Greg Edwards &lt;gedwards@ddn.com&gt;
Signed-off-by: Gleb Natapov &lt;gleb@redhat.com&gt;
[bwh: Backported to 3.2: s/__gfn_to_hva_memslot/gfn_to_hva_memslot/]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Qiang Huang &lt;h.huangqiang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio()</title>
<updated>2014-02-22T18:32:46Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2014-01-29T13:16:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5a0d43c3374c287711f4191922835e18fc8ae3ec'/>
<id>urn:sha1:5a0d43c3374c287711f4191922835e18fc8ae3ec</id>
<content type='text'>
commit aac5c4226e7136c331ed384c25d5560204da10a0 upstream.

If kvm_io_bus_register_dev() fails then it returns success but it should
return an error code.

I also did a little cleanup like removing an impossible NULL test.

Fixes: 2b3c246a682c ('KVM: Make coalesced mmio use a device per zone')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: Fix buffer overflow in kvm_set_irq()</title>
<updated>2014-02-20T18:45:33Z</updated>
<author>
<name>Avi Kivity</name>
<email>avi@redhat.com</email>
</author>
<published>2012-04-22T14:02:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ec90b6113735a9f9fcb64a604b28f446fe03ded2'/>
<id>urn:sha1:ec90b6113735a9f9fcb64a604b28f446fe03ded2</id>
<content type='text'>
commit f2ebd422f71cda9c791f76f85d2ca102ae34a1ed upstream.

kvm_set_irq() has an internal buffer of three irq routing entries, allowing
connecting a GSI to three IRQ chips or on MSI.  However setup_routing_entry()
does not properly enforce this, allowing three irqchip routes followed by
an MSI route to overflow the buffer.

Fix by ensuring that an MSI entry is added to an empty list.

Signed-off-by: Avi Kivity &lt;avi@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: Improve create VCPU parameter (CVE-2013-4587)</title>
<updated>2013-12-20T15:34:19Z</updated>
<author>
<name>Andy Honig</name>
<email>ahonig@google.com</email>
</author>
<published>2013-11-19T00:09:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f843edd53fec967be6d41c81b1426ec82728934b'/>
<id>urn:sha1:f843edd53fec967be6d41c81b1426ec82728934b</id>
<content type='text'>
commit 338c7dbadd2671189cec7faf64c84d01071b3f96 upstream.

In multiple functions the vcpu_id is used as an offset into a bitfield.  Ag
malicious user could specify a vcpu_id greater than 255 in order to set or
clear bits in kernel memory.  This could be used to elevate priveges in the
kernel.  This patch verifies that the vcpu_id provided is less than 255.
The api documentation already specifies that the vcpu_id must be less than
max_vcpus, but this is currently not checked.

Reported-by: Andrew Honig &lt;ahonig@google.com&gt;
Signed-off-by: Andrew Honig &lt;ahonig@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: Fix iommu map/unmap to handle memory slot moves</title>
<updated>2013-12-04T18:50:34Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2012-12-10T17:32:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5833570f8e15cd7a40dd6c14ec73cb53736048cf'/>
<id>urn:sha1:5833570f8e15cd7a40dd6c14ec73cb53736048cf</id>
<content type='text'>
commit e40f193f5bb022e927a57a4f5d5194e4f12ddb74 upstream.

The iommu integration into memory slots expects memory slots to be
added or removed and doesn't handle the move case.  We can unmap
slots from the iommu after we mark them invalid and map them before
installing the final memslot array.  Also re-order the kmemdup vs
map so we don't leave iommu mappings if we get ENOMEM.

Reviewed-by: Gleb Natapov &lt;gleb@redhat.com&gt;
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Cc: Luis Henriques &lt;luis.henriques@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: perform an invalid memslot step for gpa base change</title>
<updated>2013-12-04T18:50:34Z</updated>
<author>
<name>Marcelo Tosatti</name>
<email>mtosatti@redhat.com</email>
</author>
<published>2012-08-24T18:54:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9af88f0e8b1ce5f10786654c3f00adde1c67a2e5'/>
<id>urn:sha1:9af88f0e8b1ce5f10786654c3f00adde1c67a2e5</id>
<content type='text'>
commit 12d6e7538e2d418c08f082b1b44ffa5fb7270ed8 upstream.

PPC must flush all translations before the new memory slot
is visible.

Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Signed-off-by: Avi Kivity &lt;avi@redhat.com&gt;
Cc: Luis Henriques &lt;luis.henriques@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: Allow cross page reads and writes from cached translations.</title>
<updated>2013-04-26T04:19:55Z</updated>
<author>
<name>Andrew Honig</name>
<email>ahonig@google.com</email>
</author>
<published>2013-03-29T16:35:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a6b0247eee46f424e032fb7431cc4700ad19ea5'/>
<id>urn:sha1:2a6b0247eee46f424e032fb7431cc4700ad19ea5</id>
<content type='text'>
commit 8f964525a121f2ff2df948dac908dcc65be21b5b upstream.

This patch adds support for kvm_gfn_to_hva_cache_init functions for
reads and writes that will cross a page.  If the range falls within
the same memslot, then this will be a fast operation.  If the range
is split between two memslots, then the slower kvm_read_guest and
kvm_write_guest are used.

Tested: Test against kvm_clock unit tests.

Signed-off-by: Andrew Honig &lt;ahonig@google.com&gt;
Signed-off-by: Gleb Natapov &lt;gleb@redhat.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: Fix bounds checking in ioapic indirect register reads (CVE-2013-1798)</title>
<updated>2013-04-26T04:19:55Z</updated>
<author>
<name>Andy Honig</name>
<email>ahonig@google.com</email>
</author>
<published>2013-02-20T22:49:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f56d137aa68f8edadac247aa48b335f2776954ff'/>
<id>urn:sha1:f56d137aa68f8edadac247aa48b335f2776954ff</id>
<content type='text'>
commit a2c118bfab8bc6b8bb213abfc35201e441693d55 upstream.

If the guest specifies a IOAPIC_REG_SELECT with an invalid value and follows
that with a read of the IOAPIC_REG_WINDOW KVM does not properly validate
that request.  ioapic_read_indirect contains an
ASSERT(redir_index &lt; IOAPIC_NUM_PINS), but the ASSERT has no effect in
non-debug builds.  In recent kernels this allows a guest to cause a kernel
oops by reading invalid memory.  In older kernels (pre-3.3) this allows a
guest to read from large ranges of host memory.

Tested: tested against apic unit tests.

Signed-off-by: Andrew Honig &lt;ahonig@google.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: Fix user memslot overlap check</title>
<updated>2013-01-17T16:50:42Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2012-11-29T21:07:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9d4c74b86237ac64376b92c54cf7b471e7e75f76'/>
<id>urn:sha1:9d4c74b86237ac64376b92c54cf7b471e7e75f76</id>
<content type='text'>
commit 5419369ed6bd4cf711fdda5e52a5999b940413f5 upstream.

Prior to memory slot sorting this loop compared all of the user memory
slots for overlap with new entries.  With memory slot sorting, we're
just checking some number of entries in the array that may or may not
be user slots.  Instead, walk all the slots with kvm_for_each_memslot,
which has the added benefit of terminating early when we hit the first
empty slot, and skip comparison to private slots.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: lock slots_lock around device assignment</title>
<updated>2012-04-19T03:04:18Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2012-04-18T03:46:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=21a1416a1c945c5aeaeaf791b63c64926018eb77'/>
<id>urn:sha1:21a1416a1c945c5aeaeaf791b63c64926018eb77</id>
<content type='text'>
As pointed out by Jason Baron, when assigning a device to a guest
we first set the iommu domain pointer, which enables mapping
and unmapping of memory slots to the iommu.  This leaves a window
where this path is enabled, but we haven't synchronized the iommu
mappings to the existing memory slots.  Thus a slot being removed
at that point could send us down unexpected code paths removing
non-existent pinnings and iommu mappings.  Take the slots_lock
around creating the iommu domain and initial mappings as well as
around iommu teardown to avoid this race.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
</content>
</entry>
</feed>
