All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Keun-O Park <kpark3469@gmail.com>
Cc: Will Deacon <will.deacon@arm.com>,
	"kernel-hardening@lists.openwall.com"
	<kernel-hardening@lists.openwall.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	James Morse <james.morse@arm.com>,
	Pratyush Anand <panand@redhat.com>,
	keun-o.park@darkmatter.ae,
	AKASHI Takahiro <takahiro.akashi@linaro.org>
Subject: [kernel-hardening] Re: [PATCH] arm64: usercopy: Implement stack frame object validation
Date: Mon, 30 Jan 2017 14:15:43 -0800	[thread overview]
Message-ID: <CAGXu5jJ=G05X0GBv82GrcWdVp2o5fdAqhGL3ypCL_=is=K3BLw@mail.gmail.com> (raw)
In-Reply-To: <CA+KhAHZgtTQz+ig=_G+YvasKFw6RjfMj=6EYF8sd6vs5eL1bKg@mail.gmail.com>

On Mon, Jan 30, 2017 at 3:26 AM, Keun-O Park <kpark3469@gmail.com> wrote:
> Hello Kees,
>
> Thanks for the suggestion about lkdtm. Yes, it worked correctly.
> provoke-crash# echo USERCOPY_STACK_FRAME_TO > DIRECT
> [11388.369172] lkdtm: Performing direct entry USERCOPY_STACK_FRAME_TO
> [11388.369259] lkdtm: attempting good copy_to_user of local stack
> [11388.369366] lkdtm: attempting bad copy_to_user of distant stack
> [11388.369453] usercopy: kernel memory exposure attempt detected from
> ffffffc87985fd60 (<process stack>) (32 bytes)
>
> provoke-crash# echo USERCOPY_STACK_FRAME_FROM > DIRECT
> [12687.156830] lkdtm: Performing direct entry USERCOPY_STACK_FRAME_FROM
> [12687.156918] lkdtm: attempting good copy_from_user of local stack
> [12687.156995] lkdtm: attempting bad copy_from_user of distant stack
> [12687.157082] usercopy: kernel memory overwrite attempt detected to
> ffffffc87985fd60 (<process stack>) (32 bytes)
>
> One thing I want to ask is..
> Does USERCOPY_HEAP_FLAG_FROM/TO work correctly in latest kernel?

No, this protection (the whitelisting flag) isn't implemented yet in
upstream. (You're more than welcome to dig into it, if you want!)

> Both on Pixel(v3.18) and on emulator(v4.10-rc5)
> In these two cases the bad attempt passed. I guess the code for this
> test might not be ready. Am I right?

Correct.

-Kees

-- 
Kees Cook
Pixel Security

  reply	other threads:[~2017-01-30 22:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 13:46 [kernel-hardening] [PATCH] arm64: usercopy: Implement stack frame object validation kpark3469
2017-01-25 13:54 ` [kernel-hardening] " Will Deacon
2017-01-25 14:44   ` Keun-O Park
2017-01-26  0:58     ` Kees Cook
2017-01-30 11:26       ` Keun-O Park
2017-01-30 22:15         ` Kees Cook [this message]
2017-01-26  7:10   ` AKASHI Takahiro
2017-01-30 12:42     ` Keun-O Park
2017-01-30 22:19       ` Kees Cook
2017-01-31  9:10         ` Keun-O Park
2017-01-31 17:56           ` Kees Cook
2017-01-26 16:40   ` Yann Droneaud
2017-01-26 17:36     ` Kees Cook
2017-01-26 17:47       ` Will Deacon
2017-01-26 15:23 ` James Morse
2017-02-02 13:34   ` Keun-O Park

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='CAGXu5jJ=G05X0GBv82GrcWdVp2o5fdAqhGL3ypCL_=is=K3BLw@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=keun-o.park@darkmatter.ae \
    --cc=kpark3469@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=panand@redhat.com \
    --cc=takahiro.akashi@linaro.org \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.