gnttab: don't blindly free status pages upon version change
authorJan Beulich <jbeulich@suse.com>
Fri, 2 Mar 2018 15:41:20 +0000 (15:41 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 2 Mar 2018 16:07:18 +0000 (16:07 +0000)
commit5fd1eda78f7f8b6e0f366b84c66025c9c7be9847
treee2b532785a448d1924f06e0e4ce2bd4a658d5bd3
parent41a3b9138b9fca869150a33719010c034e4cc57e
gnttab: don't blindly free status pages upon version change

There may still be active mappings, which would trigger the respective
BUG_ON(). Split the loop into one dealing with the page attributes and
the second (when the first fully passed) freeing the pages. Return an
error if any pages still have pending references.

This is part of XSA-255.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Gbp-Pq: Name gnttab-dont-blindly-free-status-pages-up.patch
xen/arch/arm/mm.c
xen/common/grant_table.c
xen/include/asm-arm/grant_table.h
xen/include/asm-x86/grant_table.h