x86/mm: Put the gfn on all paths after get_gfn_query()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 20 Nov 2018 13:58:10 +0000 (14:58 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Nov 2018 13:58:10 +0000 (14:58 +0100)
commitd80988cfc04ee608bee722448e7c3bc8347ec04c
tree29604742f287666c6ad2b70ffaa122db56fece2b
parente862e6ceb1fd971d755a0c57d6a0f3b8065187dc
x86/mm: Put the gfn on all paths after get_gfn_query()

c/s 7867181b2 "x86/PoD: correctly handle non-order-0 decrease-reservation
requests" introduced an early exit in guest_remove_page() for unexpected p2m
types.  However, get_gfn_query() internally takes the p2m lock, and must be
matched with a put_gfn() call later.

Fix the erroneous comment beside the declaration of get_gfn_query().

This is XSA-277.

Reported-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/memory.c
xen/include/asm-x86/p2m.h