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

Re: [Xen-devel] [PATCH V13 3/7] xen/arm: Allow hypervisor access to mem_access protected pages





On Thu, Mar 12, 2015 at 2:50 PM, Julien Grall <julien.grall@xxxxxxxxxx> wrote:
Hi Tamas,

On 06/03/15 21:24, Tamas K Lengyel wrote:
> +/*
> + * If mem_access is in use it might have been the reason why get_page_from_gva
> + * failed to fetch the page, as it uses the MMU for the permission checking.
> + * Only in these cases we do a software-based type check and fetch the page if
> + * we indeed found a conflicting mem_access setting.
> + */
> +static int check_type_get_page(vaddr_t gva, unsigned long flag,
> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âstruct page_info** page)
> +{
> +Â Â long rc;
> +Â Â paddr_t ipa;
> +Â Â unsigned long maddr;
> +Â Â unsigned long mfn;
> +Â Â xenmem_access_t xma;
> +Â Â p2m_type_t t;
> +
> +Â Â rc = gva_to_ipa(gva, &ipa);

I though a bit more about this call.

gva_to_ipa only checks if the mapping has read-permission. That would
allow a guest to write on read-only mapping.

You have to pass the flags to gva_to_ipa in order to avoid
re-introducing XSA-98 [1]

Here I really just care if the mapping exist to see if we have a mem_access restriction, r/w permission checking is then performed afterwards by checking the page type. If there are additional restrictions on the page beside the type, those certainly should be added. Can you point me to where that additional restriction is stored so I can query for it?


Regards,

[1] http://xenbits.xen.org/xsa/advisory-98.html

--
Julien Grall

Thanks,
Tamas

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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