Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222897

Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call

From Julien Grall <julien.grall@citrix.com>
Newsgroups linux.kernel
Subject Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call
Date 2015-09-11 17:00 +0200
Message-ID <q7xXY-4O5-5@gated-at.bofh.it> (permalink)
References <q7xlf-42z-19@gated-at.bofh.it> <q7xuV-4eq-7@gated-at.bofh.it> <q7xOi-4C9-11@gated-at.bofh.it> <q7xXY-4O5-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 11/09/15 15:55, Ian Campbell wrote:
> On Fri, 2015-09-11 at 15:45 +0100, Julien Grall wrote:
>> On 11/09/15 15:29, Ian Campbell wrote:
>>> On Fri, 2015-09-11 at 15:16 +0100, Julien Grall wrote:
>>>> When Xen is copyin data to/from the guest it will check if the kernel
>>>
>>> "copying"
>>>
>>>> has the right to do the access. If not, the hypercall will return an
>>>> error.
>>>>
>>>> After the commit a5e090acbf545c0a3b04080f8a488b17ec41fe02 "ARM:
>>>> software-based priviledged-no-access support", the kernel can't
>>>> access
>>>
>>> "privileged"
>>>
>>>> anymore the user space by default. This will result to fail on every
>>>
>>> "any more" (or "any longer")
>>>
>>>> hypercall made by the userspace (i.e via privcmd).
>>>>
>>>> We have to enable the userspace access and then restore the correct
>>>> permission everytime the privmcd is used to made an hypercall.
>>>
>>> "every time" and "privcmd"
>>>
>>>>  HYPERCALL1(tmem_op);
>>>>  HYPERCALL2(multicall);
>>>>  
>>>> -ENTRY(privcmd_call)
>>>> +ENTRY(__privcmd_call)
>>>
>>> arch/arm/include/asm/assembler.h seems to contain uaccess_* macros
>>> which
>>> could be used right here directly I think? That would be preferable to
>>> wrapping I think.
>>
>> Looking to the uaccess_save macro:
> 
> I was thinking more about uaccess_enable/disable.

Well, we can't assume that the function will be called with uaccess
disabled.  So we have to save the state and restore it after issuing the
hypercall.

Regards,

-- 
Julien Grall
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 16:20 +0200
  Re: [PATCH] arm/xen: Enable user access to the kernel before  issuing a privcmd call Ian Campbell <ian.campbell@citrix.com> - 2015-09-11 16:30 +0200
    Re: [PATCH] arm/xen: Enable user access to the kernel before issuing  a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 16:50 +0200
      Re: [PATCH] arm/xen: Enable user access to the kernel before issuing  a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 17:00 +0200
        Re: [PATCH] arm/xen: Enable user access to the kernel before issuing  a privcmd call Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-11 17:30 +0200
          Re: [PATCH] arm/xen: Enable user access to the kernel before issuing  a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 17:40 +0200
      Re: [PATCH] arm/xen: Enable user access to the kernel before  issuing a privcmd call Ian Campbell <ian.campbell@citrix.com> - 2015-09-11 17:00 +0200
      Re: [PATCH] arm/xen: Enable user access to the kernel before issuing  a privcmd call Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-09-11 17:30 +0200
    Re: [PATCH] arm/xen: Enable user access to the kernel before issuing  a privcmd call Julien Grall <julien.grall@citrix.com> - 2015-09-11 18:30 +0200

csiph-web