diff options
author | Nicholas Piggin <[email protected]> | 2021-06-24 08:29:04 -0400 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2021-06-24 11:55:11 -0400 |
commit | f8be156be163a052a067306417cd0ff679068c97 (patch) | |
tree | 2f291bec641f75e1f350177da6179e8316699d71 /lib/test_overflow.c | |
parent | 309505dd56854c1f9744c9a2b8aa40d897002bca (diff) |
KVM: do not allow mapping valid but non-reference-counted pages
It's possible to create a region which maps valid but non-refcounted
pages (e.g., tail pages of non-compound higher order allocations). These
host pages can then be returned by gfn_to_page, gfn_to_pfn, etc., family
of APIs, which take a reference to the page, which takes it from 0 to 1.
When the reference is dropped, this will free the page incorrectly.
Fix this by only taking a reference on valid pages if it was non-zero,
which indicates it is participating in normal refcounting (and can be
released with put_page).
This addresses CVE-2021-22543.
Signed-off-by: Nicholas Piggin <[email protected]>
Tested-by: Paolo Bonzini <[email protected]>
Cc: [email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions