lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 25 Oct 2013 19:39:05 -0400
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	David Vrabel <dvrabel@...tab.net>
CC:	linux-kernel@...r.kernel.org, xen-devel@...ts.xensource.com,
	Santosh.Jodh@...rix.com, JBeulich@...e.com,
	boris.ostrovsky@...cle.com, david.vrabel@...rix.com,
	mukesh.rathor@...cle.com, xhejtman@....muni.cz,
	yuval.shaia@...cle.com
Subject: Re: [Xen-devel] [PATCH v1] Set 1-1 P2M for PCI BARs and MCFG regions - if needed.

David Vrabel <dvrabel@...tab.net> wrote:
>On 25/10/13 16:03, Konrad Rzeszutek Wilk wrote:
>>
>>   2). Assume that INVALID_P2M_ENTRY is considered 1-1. That would
>require
>>      auditing of the code and also making sure that any
>xen_privcmd_mmap
>>      calls use the m2p_add_override.
>
>I'm not sure I understand the concern about the privcmd driver's
>foreign 
>mapping ioctls (MMAPBATCH_V2 and friends) as these all deal with MFNs 
>directly and don't use the p2m.
>
>>      However there are some
>>      valid cases in which we need to check for INVALID_P2M_ENTRY -
>>      balloon driver - that might be relaxed.
>
>Yes.  And this behaviour will be retained.   I think we only need to do
>
>the INVALID_P2M_ENTRY => 1:1 when constructing PTEs so all other
>callers 
>will see INVALID_P2M_ENTRY as before.

You are suggesting not touching the p2m code and instead change the the xen-make-pte to assume that INVALID and IDENTITY should have the same behaviour. Interesting.
>
>
>>      However again the P2M code
>>      and the ABI it places are not for the faint of the heart.
>
>I have no fear.

:-)
>
>If the above suggestion does work out it will reduce the amount of p2m 
>code /and/ remove a Xen-specific PTE bit.  So I think it is worth
>pursuing.
>
>In the meantime, the following minimal patch is a likely workaround.
>
>David
>
>8<-------------------------------
>x86/mm: set _PAGE_IOMAP in io_remap_pfn_range().
>
>Signed-off-by: David Vrabel <david.vrabel@...rix.com>
>---
>  arch/x86/include/asm/pgtable.h |    3 +++
>  1 file changed, 3 insertions(+)
>
>diff --git a/arch/x86/include/asm/pgtable.h
>b/arch/x86/include/asm/pgtable.h
>index 3d19994..d59b22a 100644
>--- a/arch/x86/include/asm/pgtable.h
>+++ b/arch/x86/include/asm/pgtable.h
>@@ -868,6 +868,9 @@ static inline pte_t pte_swp_clear_soft_dirty(pte_t
>pte)
>  	return pte_clear_flags(pte, _PAGE_SWP_SOFT_DIRTY);
>  }
>
>+#define io_remap_pfn_range(vma, addr, pfn, size, prot) \
>+  remap_pfn_range(vma, addr, pfn, size, (prot) | _PAGE_IOMAP)
>+
>  #include <asm-generic/pgtable.h>
>  #endif	/* __ASSEMBLY__ */

You are welcome to suggest it to hpa. Last time a  similar patch was proposed he was not too thrilled about it.

Looking forward to your p2m code surgery!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ