<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/include/xen/grant_table.h, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-03-11T11:42:10Z</updated>
<entry>
<title>xen/gnttab: fix gnttab_end_foreign_access() without page specified</title>
<updated>2022-03-11T11:42:10Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2022-02-25T15:05:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d168929b4c497a8c1945dd71e467b2db12bbad2'/>
<id>urn:sha1:6d168929b4c497a8c1945dd71e467b2db12bbad2</id>
<content type='text'>
Commit 42baefac638f06314298087394b982ead9ec444b upstream.

gnttab_end_foreign_access() is used to free a grant reference and
optionally to free the associated page. In case the grant is still in
use by the other side processing is being deferred. This leads to a
problem in case no page to be freed is specified by the caller: the
caller doesn't know that the page is still mapped by the other side
and thus should not be used for other purposes.

The correct way to handle this situation is to take an additional
reference to the granted page in case handling is being deferred and
to drop that reference when the grant reference could be freed
finally.

This requires that there are no users of gnttab_end_foreign_access()
left directly repurposing the granted page after the call, as this
might result in clobbered data or information leaks via the not yet
freed grant reference.

This is part of CVE-2022-23041 / XSA-396.

Reported-by: Simon Gaiser &lt;simon@invisiblethingslab.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Reviewed-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xen: remove gnttab_query_foreign_access()</title>
<updated>2022-03-11T11:42:09Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2022-02-25T15:05:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b3df6e19199db0b7bc15e28124b8e23f33205c8c'/>
<id>urn:sha1:b3df6e19199db0b7bc15e28124b8e23f33205c8c</id>
<content type='text'>
Commit 1dbd11ca75fe664d3e54607547771d021f531f59 upstream.

Remove gnttab_query_foreign_access(), as it is unused and unsafe to
use.

All previous use cases assumed a grant would not be in use after
gnttab_query_foreign_access() returned 0. This information is useless
in best case, as it only refers to a situation in the past, which could
have changed already.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Reviewed-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xen/grant-table: add gnttab_try_end_foreign_access()</title>
<updated>2022-03-11T11:42:09Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2022-02-25T15:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0ba1ab25bb5057869621b340dbd411cca3242467'/>
<id>urn:sha1:0ba1ab25bb5057869621b340dbd411cca3242467</id>
<content type='text'>
Commit 6b1775f26a2da2b05a6dc8ec2b5d14e9a4701a1a upstream.

Add a new grant table function gnttab_try_end_foreign_access(), which
will remove and free a grant if it is not in use.

Its main use case is to either free a grant if it is no longer in use,
or to take some other action if it is still in use. This other action
can be an error exit, or (e.g. in the case of blkfront persistent grant
feature) some special handling.

This is CVE-2022-23036, CVE-2022-23038 / part of XSA-396.

Reported-by: Demi Marie Obenour &lt;demi@invisiblethingslab.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Reviewed-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Xen/gnttab: introduce common INVALID_GRANT_{HANDLE,REF}</title>
<updated>2021-03-10T22:39:29Z</updated>
<author>
<name>Jan Beulich</name>
</author>
<published>2021-03-10T10:45:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bce21a2b48ede7cbcab92db18bc956daf1d5c246'/>
<id>urn:sha1:bce21a2b48ede7cbcab92db18bc956daf1d5c246</id>
<content type='text'>
It's not helpful if every driver has to cook its own. Generalize
xenbus'es INVALID_GRANT_HANDLE and pcifront's INVALID_GRANT_REF (which
shouldn't have expanded to zero to begin with). Use the constants in
p2m.c and gntdev.c right away, and update field types where necessary so
they would match with the constants' types (albeit without touching
struct ioctl_gntdev_grant_ref's ref field, as that's part of the public
interface of the kernel and would require introducing a dependency on
Xen's grant_table.h public header).

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Reviewed-by: Juergen Gross &lt;jgross@suse.com&gt;
Link: https://lore.kernel.org/r/db7c38a5-0d75-d5d1-19de-e5fe9f0b9c48@suse.com
Signed-off-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
</content>
</entry>
<entry>
<title>Xen/gntdev: correct error checking in gntdev_map_grant_pages()</title>
<updated>2021-02-15T07:52:27Z</updated>
<author>
<name>Jan Beulich</name>
</author>
<published>2021-02-15T07:52:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebee0eab08594b2bd5db716288a4f1ae5936e9bc'/>
<id>urn:sha1:ebee0eab08594b2bd5db716288a4f1ae5936e9bc</id>
<content type='text'>
Failure of the kernel part of the mapping operation should also be
indicated as an error to the caller, or else it may assume the
respective kernel VA is okay to access.

Furthermore gnttab_map_refs() failing still requires recording
successfully mapped handles, so they can be unmapped subsequently. This
in turn requires there to be a way to tell full hypercall failure from
partial success - preset map_op status fields such that they won't
"happen" to look as if the operation succeeded.

Also again use GNTST_okay instead of implying its value (zero).

This is part of XSA-361.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Juergen Gross &lt;jgross@suse.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
</content>
</entry>
<entry>
<title>xen: don't use page-&gt;lru for ZONE_DEVICE memory</title>
<updated>2020-12-09T09:31:41Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2020-12-07T08:36:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee32f32335e8c7f6154bf397f4ac9b6175b488a8'/>
<id>urn:sha1:ee32f32335e8c7f6154bf397f4ac9b6175b488a8</id>
<content type='text'>
Commit 9e2369c06c8a18 ("xen: add helpers to allocate unpopulated
memory") introduced usage of ZONE_DEVICE memory for foreign memory
mappings.

Unfortunately this collides with using page-&gt;lru for Xen backend
private page caches.

Fix that by using page-&gt;zone_device_data instead.

Cc: &lt;stable@vger.kernel.org&gt; # 5.9
Fixes: 9e2369c06c8a18 ("xen: add helpers to allocate unpopulated memory")
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovksy@oracle.com&gt;
Reviewed-by: Jason Andryuk &lt;jandryuk@gmail.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
</content>
</entry>
<entry>
<title>xen: add helpers for caching grant mapping pages</title>
<updated>2020-12-09T09:31:37Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2020-12-07T07:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca33479cc7be2c9b5f8be078c8bf3ac26b7d6186'/>
<id>urn:sha1:ca33479cc7be2c9b5f8be078c8bf3ac26b7d6186</id>
<content type='text'>
Instead of having similar helpers in multiple backend drivers use
common helpers for caching pages allocated via gnttab_alloc_pages().

Make use of those helpers in blkback and scsiback.

Cc: &lt;stable@vger.kernel.org&gt; # 5.9
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovksy@oracle.com&gt;
Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
</content>
</entry>
<entry>
<title>xen/grant-table: Allow allocating buffers suitable for DMA</title>
<updated>2018-07-27T03:05:14Z</updated>
<author>
<name>Oleksandr Andrushchenko</name>
</author>
<published>2018-07-20T09:01:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9bdc7304f536f3f77f0a69e7c3a8f5afda561a68'/>
<id>urn:sha1:9bdc7304f536f3f77f0a69e7c3a8f5afda561a68</id>
<content type='text'>
Extend grant table module API to allow allocating buffers that can
be used for DMA operations and mapping foreign grant references
on top of those.
The resulting buffer is similar to the one allocated by the balloon
driver in that proper memory reservation is made by
({increase|decrease}_reservation and VA mappings are updated if
needed).
This is useful for sharing foreign buffers with HW drivers which
cannot work with scattered buffers provided by the balloon driver,
but require DMAable memory instead.

Signed-off-by: Oleksandr Andrushchenko &lt;oleksandr_andrushchenko@epam.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Signed-off-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
</content>
</entry>
<entry>
<title>xen/grant-table: Make set/clear page private code shared</title>
<updated>2018-07-27T03:05:13Z</updated>
<author>
<name>Oleksandr Andrushchenko</name>
</author>
<published>2018-07-20T09:01:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c3799ee25e1fda159099af09f5f2e86091e41d4'/>
<id>urn:sha1:8c3799ee25e1fda159099af09f5f2e86091e41d4</id>
<content type='text'>
Make set/clear page private code shared and accessible to
other kernel modules which can re-use these instead of open-coding.

Signed-off-by: Oleksandr Andrushchenko &lt;oleksandr_andrushchenko@epam.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Signed-off-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
</content>
</entry>
<entry>
<title>xen: limit grant v2 interface to the v1 functionality</title>
<updated>2017-11-06T20:50:17Z</updated>
<author>
<name>Juergen Gross</name>
</author>
<published>2017-11-02T09:19:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56c9c700c4399858e50971d98ac44b5842b06a87'/>
<id>urn:sha1:56c9c700c4399858e50971d98ac44b5842b06a87</id>
<content type='text'>
As there is currently no user for sub-page grants or transient grants
remove that functionality. This at once makes it possible to switch
from grant v2 to grant v1 without restrictions, as there is no loss of
functionality other than the limited frame number width related to
the switch.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
Signed-off-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
</content>
</entry>
</feed>
