Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:Update
xen.10699
xsa291.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xsa291.patch of Package xen.10699
From: Jan Beulich <jbeulich@suse.com> Subject: x86/mm: don't retain page type reference when IOMMU operation fails The IOMMU update in _get_page_type() happens between recording of the new reference and validation of the page for its new type (if necessary). If the IOMMU operation fails, there's no point in actually carrying out validation. Furthermore, with this resulting in failure getting indicated to the caller, the recorded type reference also needs to be dropped again. Note that in case of failure of alloc_page_type() there's no need to undo the IOMMU operation: Only special types get handed to the function. The function, upon failure, clears ->u.inuse.type_info, effectively converting the page to PGT_none. The IOMMU mapping, however, solely depends on whether the type is PGT_writable_page. This is XSA-291. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2869,6 +2869,13 @@ static int _get_page_type(struct page_in iommu_ret = iommu_map_page(d, gfn_x(gfn), mfn_x(page_to_mfn(page)), IOMMUF_readable|IOMMUF_writable); + + if ( unlikely(iommu_ret) ) + { + _put_page_type(page, false, NULL); + rc = iommu_ret; + goto out; + } } } @@ -2883,12 +2890,10 @@ static int _get_page_type(struct page_in rc = alloc_page_type(page, type, preemptible); } + out: if ( (x & PGT_partial) && !(nx & PGT_partial) ) put_page(page); - if ( !rc ) - rc = iommu_ret; - return rc; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor