lkml.org 
[lkml]   [2015]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lkdtm: fix ACCESS_USERSPACE test
On Tue, Oct 27, 2015 at 04:47:53PM -0400, Stephen Smalley wrote:
> Add a copy_to_user() call to the ACCESS_USERSPACE test
> prior to attempting direct dereferencing of the user
> address to ensure the page is present. Otherwise,
> a fault occurs on arm kernels even prior to the introduction
> of CONFIG_CPU_SW_DOMAIN_PAN, and there is no difference in
> behavior for CONFIG_CPU_SW_DOMAIN_PAN=n vs CONFIG_CPU_SW_DOMAIN_PAN=y.
>
> Before this change, for any value of CONFIG_CPU_SW_DOMAIN_PAN:
> lkdtm: Performing direct entry ACCESS_USERSPACE
> lkdtm: attempting bad read at b6fe8000
> Unable to handle kernel paging request at virtual address b6fe8000
>
> After this change, for CONFIG_CPU_SW_DOMAIN_PAN=n:
> lkdtm: Performing direct entry ACCESS_USERSPACE
> lkdtm: attempting bad read at b6efc000
> lkdtm: attempting bad write at b6efc000
>
> After this change, for CONFIG_CPU_SW_DOMAIN_PAN=y:
> lkdtm: Performing direct entry ACCESS_USERSPACE
> lkdtm: attempting bad read at b6f7d000
> Unhandled fault: page domain fault (0x01b) at 0xb6f7d000
> ...
>
> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
> ---
> drivers/misc/lkdtm.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)

Should this also be applied to older kernels (i.e. a stable fix)?

thanks,

greg k-h


\
 
 \ /
  Last update: 2015-10-28 01:21    [W:0.048 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site