public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: keescook@chromium.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lkdtm: fix ACCESS_USERSPACE test
Date: Wed, 28 Oct 2015 09:12:40 +0900	[thread overview]
Message-ID: <20151028001240.GA2971@kroah.com> (raw)
In-Reply-To: <1445978873-20870-1-git-send-email-sds@tycho.nsa.gov>

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

  parent reply	other threads:[~2015-10-28  0:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 20:47 [PATCH] lkdtm: fix ACCESS_USERSPACE test Stephen Smalley
2015-10-27 21:25 ` Kees Cook
2015-10-28  0:12 ` Greg KH [this message]
2015-10-29 13:28   ` Stephen Smalley
2015-10-30 18:01     ` Kees Cook

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=20151028001240.GA2971@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    /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