aboutsummaryrefslogtreecommitdiff
path: root/lib/string_helpers.c
diff options
context:
space:
mode:
authorJuergen Gross <[email protected]>2022-03-07 09:48:54 +0100
committerJuergen Gross <[email protected]>2022-03-07 09:48:54 +0100
commitabf1fd5919d6238ee3bc5eb4a9b6c3947caa6638 (patch)
treeeee81e5fc01af6a60a05266d4bbb528032153d38 /lib/string_helpers.c
parent6b1775f26a2da2b05a6dc8ec2b5d14e9a4701a1a (diff)
xen/blkfront: don't use gnttab_query_foreign_access() for mapped status
It isn't enough to check whether a grant is still being in use by calling gnttab_query_foreign_access(), as a mapping could be realized by the other side just after having called that function. In case the call was done in preparation of revoking a grant it is better to do so via gnttab_end_foreign_access_ref() and check the success of that operation instead. For the ring allocation use alloc_pages_exact() in order to avoid high order pages in case of a multi-page ring. If a grant wasn't unmapped by the backend without persistent grants being used, set the device state to "error". This is CVE-2022-23036 / part of XSA-396. Reported-by: Demi Marie Obenour <[email protected]> Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Roger Pau MonnĂ© <[email protected]> --- V2: - use gnttab_try_end_foreign_access() V4: - use alloc_pages_exact() and free_pages_exact() - set state to error if backend didn't unmap (Roger Pau MonnĂ©)
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions