public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Ian Campbell <ian.campbell@citrix.com>,
	<xen-devel@lists.xenproject.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<stefano.stabellini@eu.citrix.com>,
	<linux-kernel@vger.kernel.org>,
	Riku Voipio <riku.voipio@linaro.org>
Subject: Re: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call
Date: Fri, 11 Sep 2015 16:36:55 +0100	[thread overview]
Message-ID: <55F2F517.6020105@citrix.com> (raw)
In-Reply-To: <20150911152525.GU21084@n2100.arm.linux.org.uk>

On 11/09/15 16:25, Russell King - ARM Linux wrote:
> On Fri, Sep 11, 2015 at 03:56:38PM +0100, Julien Grall wrote:
>> Well, we can't assume that the function will be called with uaccess
>> disabled.
> 
> Please explain your reasoning.

I think I was confused about the usage of uaccess.
Thank you for the explanation.

> The reason copy_from_user() et.al. need to save and restore the DACR is
> because the DACR may be in one of two states on older ARM architectures.
> It may have set the kernel domain to 'manager' mode, to allow these
> accessors to work on kernel memory, or the kernel domain may be in
> 'client' mode, thereby preventing the accessors from touching kernel
> memory.
> 
> Unless the code path is reachable with the kernel domain in manager
> mode, (iow, a set_fs(KERNEL_DS) or set_fs(get_ds()) has been done) then
> it should be safe to use uaccess_disable/uaccess_enable.


I believe that our privcmd driver doesn't made any usage of set_fs(...),
so I will use the uaccess_{disable,enable} macro.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-09-11 15:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11 14:16 [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call Julien Grall
2015-09-11 14:29 ` Ian Campbell
2015-09-11 14:45   ` Julien Grall
2015-09-11 14:55     ` Ian Campbell
2015-09-11 14:56       ` Julien Grall
2015-09-11 15:25         ` Russell King - ARM Linux
2015-09-11 15:36           ` Julien Grall [this message]
2015-09-11 15:20     ` Russell King - ARM Linux
2015-09-11 16:22   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55F2F517.6020105@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=riku.voipio@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox