All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Laura Abbott <labbott@redhat.com>,
	Rik van Riel <riel@surriel.com>
Subject: Re: crypto: Kernel memory overwrite attempt detected to spans multiple pages
Date: Wed, 10 Apr 2019 16:11:58 -0700	[thread overview]
Message-ID: <20190410231156.GB120258@gmail.com> (raw)
In-Reply-To: <CAGXu5j+Gfvj9G6s_UQTw6hE11gJb1edt3BXzpbDQdc_dpcHgag@mail.gmail.com>

On Wed, Apr 10, 2019 at 02:57:46PM -0700, Kees Cook wrote:
> On Wed, Apr 10, 2019 at 12:07 PM Eric Biggers <ebiggers@kernel.org> wrote:
> > That didn't answer my question.  My question is what is the purpose of this?  If
> > there was actual buffer overflow when __GFP_COMP isn't specified that would make
> > perfect sense, but AFAICS there isn't.  So why does hardened usercopy consider
> > it broken when __GFP_COMP isn't specified?
> 
> The goal of CONFIG_HARDENED_USERCOPY_PAGESPAN was to detect copies
> across page boundaries in memory allocated by the page allocator.
> There appear to be enough cases of allocations that span pages but do
> not mark them with __GFP_COMP, so this logic hasn't proven useful in
> the real world (which is why no one should use the ..._PAGESPAN config
> in production). I'd like to get the kernel to the point where hardened
> usercopy can correctly do these checks (right now it's mainly only
> useful at checking for overflows in slub and slab), but it'll take
> time/focus for a while. No one has had time yet to track all of these
> down and fix them. (I defer to Laura and Rik on the design of the
> pagespan checks; they did the bulk of the work there.)
> 
> Does that help explain it, or am I still missing your question?
> 
> -- 
> Kees Cook

You've explained *what* it does again, but not *why*.  *Why* do you want
hardened usercopy to detect copies across page boundaries, when there is no
actual buffer overflow?

- Eric

WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Rik van Riel <riel@surriel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-security-module <linux-security-module@vger.kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	Laura Abbott <labbott@redhat.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: crypto: Kernel memory overwrite attempt detected to spans multiple pages
Date: Wed, 10 Apr 2019 16:11:58 -0700	[thread overview]
Message-ID: <20190410231156.GB120258@gmail.com> (raw)
In-Reply-To: <CAGXu5j+Gfvj9G6s_UQTw6hE11gJb1edt3BXzpbDQdc_dpcHgag@mail.gmail.com>

On Wed, Apr 10, 2019 at 02:57:46PM -0700, Kees Cook wrote:
> On Wed, Apr 10, 2019 at 12:07 PM Eric Biggers <ebiggers@kernel.org> wrote:
> > That didn't answer my question.  My question is what is the purpose of this?  If
> > there was actual buffer overflow when __GFP_COMP isn't specified that would make
> > perfect sense, but AFAICS there isn't.  So why does hardened usercopy consider
> > it broken when __GFP_COMP isn't specified?
> 
> The goal of CONFIG_HARDENED_USERCOPY_PAGESPAN was to detect copies
> across page boundaries in memory allocated by the page allocator.
> There appear to be enough cases of allocations that span pages but do
> not mark them with __GFP_COMP, so this logic hasn't proven useful in
> the real world (which is why no one should use the ..._PAGESPAN config
> in production). I'd like to get the kernel to the point where hardened
> usercopy can correctly do these checks (right now it's mainly only
> useful at checking for overflows in slub and slab), but it'll take
> time/focus for a while. No one has had time yet to track all of these
> down and fix them. (I defer to Laura and Rik on the design of the
> pagespan checks; they did the bulk of the work there.)
> 
> Does that help explain it, or am I still missing your question?
> 
> -- 
> Kees Cook

You've explained *what* it does again, but not *why*.  *Why* do you want
hardened usercopy to detect copies across page boundaries, when there is no
actual buffer overflow?

- Eric

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-04-10 23:12 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 11:54 crypto: Kernel memory overwrite attempt detected to spans multiple pages Geert Uytterhoeven
2019-03-19 11:54 ` Geert Uytterhoeven
2019-03-19 17:09 ` Eric Biggers
2019-03-19 17:09   ` Eric Biggers
2019-03-20 18:57   ` Eric Biggers
2019-03-20 18:57     ` Eric Biggers
2019-03-21 17:45     ` Kees Cook
2019-03-21 17:45       ` Kees Cook
2019-03-21 17:51       ` Eric Biggers
2019-03-21 17:51         ` Eric Biggers
2019-04-10  3:17         ` Eric Biggers
2019-04-10  3:17           ` Eric Biggers
2019-04-10 18:30           ` Kees Cook
2019-04-10 18:30             ` Kees Cook
2019-04-10 19:07             ` Eric Biggers
2019-04-10 19:07               ` Eric Biggers
2019-04-10 21:57               ` Kees Cook
2019-04-10 21:57                 ` Kees Cook
2019-04-10 23:11                 ` Eric Biggers [this message]
2019-04-10 23:11                   ` Eric Biggers
2019-04-10 23:27                   ` Kees Cook
2019-04-10 23:27                     ` Kees Cook
2019-04-11 17:58                     ` Eric Biggers
2019-04-11 17:58                       ` Eric Biggers
2019-04-11 18:33                       ` Kees Cook
2019-04-11 18:33                         ` Kees Cook
2019-04-11 19:26                         ` Eric Biggers
2019-04-11 19:26                           ` Eric Biggers
2019-04-11 19:28                           ` [PATCH] crypto: testmgr - allocate buffers with __GFP_COMP Eric Biggers
2019-04-11 19:28                             ` Eric Biggers
2019-04-11 20:32                             ` Kees Cook
2019-04-11 20:32                               ` Kees Cook
2019-04-12  5:38                               ` Dmitry Vyukov
2019-04-12  5:38                                 ` Dmitry Vyukov
2019-04-15  2:24                               ` Matthew Wilcox
2019-04-15  2:24                                 ` Matthew Wilcox
2019-04-15  2:46                                 ` Herbert Xu
2019-04-15  2:46                                   ` Herbert Xu
2019-04-16  2:18                                   ` Matthew Wilcox
2019-04-16  2:18                                     ` Matthew Wilcox
2019-04-16  3:14                                     ` Kees Cook
2019-04-16  3:14                                       ` Kees Cook
2019-04-17  4:08                                       ` Matthew Wilcox
2019-04-17  4:08                                         ` Matthew Wilcox
2019-04-17  8:09                                         ` Russell King - ARM Linux admin
2019-04-17  8:09                                           ` Russell King - ARM Linux admin
2019-04-17  9:54                                           ` Robin Murphy
2019-04-17  9:54                                             ` Robin Murphy
2019-04-11 20:36                           ` crypto: Kernel memory overwrite attempt detected to spans multiple pages Kees Cook
2019-04-11 20:36                             ` Kees Cook
2019-04-11 20:56                             ` Eric Biggers
2019-04-11 20:56                               ` Eric Biggers
2019-04-11  1:37                   ` Rik van Riel
2019-04-11  1:37                     ` Rik van Riel

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=20190410231156.GB120258@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=keescook@chromium.org \
    --cc=labbott@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=riel@surriel.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.