1. 15 Feb, 2021 3 commits
    • Jan Beulich's avatar
      Xen/gntdev: correct dev_bus_addr handling in gntdev_map_grant_pages() · dbe52836
      Jan Beulich authored
      We may not skip setting the field in the unmap structure when
      GNTMAP_device_map is in use - such an unmap would fail to release the
      respective resources (a page ref in the hypervisor). Otoh the field
      doesn't need setting at all when GNTMAP_device_map is not in use.
      
      To record the value for unmapping, we also better don't use our local
      p2m: In particular after a subsequent change it may not have got updated
      for all the batch elements. Instead it can simply be taken from the
      respective map's results.
      
      We can additionally avoid playing this game altogether for the kernel
      part of the mappings in (x86) PV mode.
      
      This is part of XSA-361.
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      dbe52836
    • Jan Beulich's avatar
      Xen/x86: also check kernel mapping in set_foreign_p2m_mapping() · b512e1b0
      Jan Beulich authored
      We should not set up further state if either mapping failed; paying
      attention to just the user mapping's status isn't enough.
      
      Also use GNTST_okay instead of implying its value (zero).
      
      This is part of XSA-361.
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      b512e1b0
    • Jan Beulich's avatar
      Xen/x86: don't bail early from clear_foreign_p2m_mapping() · a35f2ef3
      Jan Beulich authored
      Its sibling (set_foreign_p2m_mapping()) as well as the sibling of its
      only caller (gnttab_map_refs()) don't clean up after themselves in case
      of error. Higher level callers are expected to do so. However, in order
      for that to really clean up any partially set up state, the operation
      should not terminate upon encountering an entry in unexpected state. It
      is particularly relevant to notice here that set_foreign_p2m_mapping()
      would skip setting up a p2m entry if its grant mapping failed, but it
      would continue to set up further p2m entries as long as their mappings
      succeeded.
      
      Arguably down the road set_foreign_p2m_mapping() may want its page state
      related WARN_ON() also converted to an error return.
      
      This is part of XSA-361.
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      a35f2ef3
  2. 14 Feb, 2021 7 commits
  3. 13 Feb, 2021 12 commits
  4. 12 Feb, 2021 13 commits
  5. 11 Feb, 2021 5 commits