[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.7] gnttab: correct pin status fixup for copy



commit 8aebf856caabeb46f89acf07b727193e16ab1242
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Aug 15 15:26:42 2017 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Aug 15 15:26:42 2017 +0200

    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@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 6e2a4c73564ab907b732059adb317d6ca2d138a2
    master date: 2017-08-15 15:08:03 +0200
---
 xen/common/grant_table.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index d12e617..cce8ca9 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2121,10 +2121,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);
 }
 
@@ -2332,7 +2332,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 )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.7

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.