direct-io.hg

changeset 10601:be0a536b70cc

[IA64] don't allow non-dom0 domains to set pte memory attributes

domUs shouldn't be allowed to set arbitrary memory attributes.
This could allow accessing system memory with uncached attributes,
leading to address aliasing, unsupported transactions, or worse.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Wed Jun 21 10:25:00 2006 -0600 (2006-06-21)
parents 9031316e5203
children 2d60987140b6
files xen/arch/ia64/xen/mm.c
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Wed Jun 21 10:15:46 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Wed Jun 21 10:25:00 2006 -0600
     1.3 @@ -471,6 +471,14 @@ u64 translate_domain_pte(u64 pteval, u64
     1.4  	pteval2 |= (pteval & _PAGE_ED);
     1.5  	pteval2 |= _PAGE_PL_2; // force PL0->2 (PL3 is unaffected)
     1.6  	pteval2 = (pteval & ~_PAGE_PPN_MASK) | pteval2;
     1.7 +	/*
     1.8 +	 * Don't let non-dom0 domains map uncached addresses.  This can
     1.9 +	 * happen when domU tries to touch i/o port space.  Also prevents
    1.10 +	 * possible address aliasing issues.
    1.11 +	 */
    1.12 +	if (d != dom0)
    1.13 +		pteval2 &= ~_PAGE_MA_MASK;
    1.14 +
    1.15  	return pteval2;
    1.16  }
    1.17