Kernel-hardening archive mirror
 help / color / mirror / Atom feed
From: Jann Horn <jannh@google.com>
To: Kernel Hardening <kernel-hardening@lists.openwall.com>,
	Kees Cook <keescook@chromium.org>
Subject: usercopy arch_within_stack_frames() is a no-op in almost all modern kernel configurations
Date: Tue, 18 Aug 2020 04:34:18 +0200	[thread overview]
Message-ID: <CAG48ez00pYAER-RrXPBkiw=3W7NkkQ+hNxNXzY-XdXV7JEFBMg@mail.gmail.com> (raw)

I was looking at some usercopy stuff and noticed that
arch_within_stack_frames() (the helper used by the usercopy
bounds-checking logic to detect copies that cross stack frames) seems
to be a no-op on almost all modern kernel configurations.

It is only defined for x86 - no implementation for e.g. arm64 exists
at all. The x86 version requires CONFIG_FRAME_POINTER, which is only
selected by CONFIG_UNWINDER_FRAME_POINTER (whereas the more modern
choice, and default, for x86-64 is CONFIG_UNWINDER_ORC).

Personally, I don't feel very attached to that check; but if people
are interested in keeping it, it should probably be reworked to use
the proper x86 unwinder API: unwind_start(), unwind_next_frame(),
unwind_get_return_address_ptr() and unwind_done() together would
probably help with this. Otherwise, it should probably be removed,
since in that case it's pretty much going to just be bitrot?

             reply	other threads:[~2020-08-18  2:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18  2:34 Jann Horn [this message]
2020-08-18 20:30 ` usercopy arch_within_stack_frames() is a no-op in almost all modern kernel configurations 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='CAG48ez00pYAER-RrXPBkiw=3W7NkkQ+hNxNXzY-XdXV7JEFBMg@mail.gmail.com' \
    --to=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).