mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
gnttab: correct pin status fixup for copy
Regardless of copy operations only setting GNTPIN_hst*, GNTPIN_dev*
also need to be taken into account when deciding whether to clear
_GTF_{read,writ}ing. At least for consistency with code elsewhere the
read part better doesn't use any mask at all.
This is XSA-230.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 6e2a4c7356
master date: 2017-08-15 15:08:03 +0200
This commit is contained in:
1 parent
266fc0ea45
commit
afc5ebfb5d
1 file changed
+3
-3
@@ -2122,10 +2122,10 @@ __release_grant_for_copy(
|
||||
static void __fixup_status_for_copy_pin(const struct active_grant_entry *act,
|
||||
uint16_t *status)
|
||||
{
|
||||
if ( !(act->pin & GNTPIN_hstw_mask) )
|
||||
if ( !(act->pin & (GNTPIN_hstw_mask | GNTPIN_devw_mask)) )
|
||||
gnttab_clear_flag(_GTF_writing, status);
|
||||
|
||||
if ( !(act->pin & GNTPIN_hstr_mask) )
|
||||
if ( !act->pin )
|
||||
gnttab_clear_flag(_GTF_reading, status);
|
||||
}
|
||||
|
||||
@@ -2333,7 +2333,7 @@ __acquire_grant_for_copy(
|
||||
|
||||
unlock_out_clear:
|
||||
if ( !(readonly) &&
|
||||
!(act->pin & GNTPIN_hstw_mask) )
|
||||
!(act->pin & (GNTPIN_hstw_mask | GNTPIN_devw_mask)) )
|
||||
gnttab_clear_flag(_GTF_writing, status);
|
||||
|
||||
if ( !act->pin )
|
||||
|
||||