direct-io.hg

changeset 5617:22d7dda0e38d

bitkeeper revision 1.1782 (42c3a8e76Lioy1FVEJFTaTkbYVBy7Q)

[PATCH] Use copy_from_user when accessing guest_pt[]

Use copy_from_user when accessing guest_pt[]

Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author arun.sharma@intel.com[kaf24]
date Thu Jun 30 08:10:15 2005 +0000 (2005-06-30)
parents 800185829318
children f4768892d6dd
files xen/arch/x86/shadow.c
line diff
     1.1 --- a/xen/arch/x86/shadow.c	Thu Jun 30 08:09:58 2005 +0000
     1.2 +++ b/xen/arch/x86/shadow.c	Thu Jun 30 08:10:15 2005 +0000
     1.3 @@ -1906,7 +1906,7 @@ static int snapshot_entry_matches(
     1.4      unsigned long gpfn, unsigned index)
     1.5  {
     1.6      unsigned long smfn = __shadow_status(d, gpfn, PGT_snapshot);
     1.7 -    l1_pgentry_t *snapshot; // could be L1s or L2s or ...
     1.8 +    l1_pgentry_t *snapshot, gpte; // could be L1s or L2s or ...
     1.9      int entries_match;
    1.10  
    1.11      perfc_incrc(snapshot_entry_matches_calls);
    1.12 @@ -1916,10 +1916,14 @@ static int snapshot_entry_matches(
    1.13  
    1.14      snapshot = map_domain_page(smfn);
    1.15  
    1.16 +    if (__copy_from_user(&gpte, &guest_pt[index],
    1.17 +                         sizeof(gpte)))
    1.18 +        return 0;
    1.19 +
    1.20      // This could probably be smarter, but this is sufficent for
    1.21      // our current needs.
    1.22      //
    1.23 -    entries_match = !l1e_has_changed(guest_pt[index], snapshot[index],
    1.24 +    entries_match = !l1e_has_changed(gpte, snapshot[index],
    1.25                                       PAGE_FLAG_MASK);
    1.26  
    1.27      unmap_domain_page(snapshot);