kernel_optimize_test/include/xen
Juergen Gross 39c00d0928 xen/gnttab: fix gnttab_end_foreign_access() without page specified
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 <simon@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 12:11:54 +01:00
..
arm arm/arm64: xen: Fix to convert percpu address to gfn correctly 2020-10-07 07:08:43 +02:00
interface xen: sync include/xen/interface/io/ring.h with Xen's newest version 2021-12-01 09:19:09 +01:00
acpi.h
balloon.h xen/balloon: add header guard 2020-09-04 09:59:53 +02:00
events.h xen: remove no longer used functions 2020-10-23 05:41:25 -05:00
features.h
grant_table.h xen/gnttab: fix gnttab_end_foreign_access() without page specified 2022-03-11 12:11:54 +01:00
hvc-console.h
hvm.h
mem-reservation.h
page.h
platform_pci.h
swiotlb-xen.h
xen-front-pgdir-shbuf.h
xen-ops.h
xen.h xen: add helpers to allocate unpopulated memory 2020-09-04 10:00:01 +02:00
xenbus_dev.h
xenbus.h arm/xen: Don't probe xenbus as part of an early initcall 2021-02-17 11:02:21 +01:00