lkml.org 
[lkml]   [2015]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] arm/xen: Enable user access to the kernel before issuing a privcmd call
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.

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.

--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.


\
 
 \ /
  Last update: 2015-09-11 17:41    [W:0.043 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site