linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-mm@kvack.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 1/4] mm/usercopy: Check kmap addresses properly
Date: Tue, 10 May 2022 15:01:22 -0700	[thread overview]
Message-ID: <202205101455.24F5C046F@keescook> (raw)
In-Reply-To: <20220509203742.0f4adfa4004e51e66c1c9a20@linux-foundation.org>

On Mon, May 09, 2022 at 08:37:42PM -0700, Andrew Morton wrote:
> On Mon, 10 Jan 2022 23:15:27 +0000 "Matthew Wilcox (Oracle)" <willy@infradead.org> wrote:
> 
> > If you are copying to an address in the kmap region, you may not copy
> > across a page boundary,
> 
> In the source, the destination or in both, and why may we not?

This depends on direction. For copying to userspace, the source (kmap).
For copying from userspace, the destination (kmap).

> > no matter what the size of the underlying
> > allocation.  You can't kmap() a slab page because slab pages always
> > come from low memory.

As in it'll be processed as a slab page instead of kmap by the usercopy
checks?

-- 
Kees Cook

  reply	other threads:[~2022-05-10 22:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 23:15 [PATCH 0/4] Assorted improvements to usercopy Matthew Wilcox (Oracle)
2022-01-10 23:15 ` [PATCH 1/4] mm/usercopy: Check kmap addresses properly Matthew Wilcox (Oracle)
2022-05-10  3:37   ` Andrew Morton
2022-05-10 22:01     ` Kees Cook [this message]
2022-01-10 23:15 ` [PATCH 2/4] mm/usercopy: Detect vmalloc overruns Matthew Wilcox (Oracle)
2022-01-10 23:15 ` [PATCH 3/4] mm/usercopy: Detect large folio overruns Matthew Wilcox (Oracle)
2022-01-31 14:28   ` David Hildenbrand
2022-01-10 23:15 ` [PATCH 4/4] usercopy: Remove HARDENED_USERCOPY_PAGESPAN Matthew Wilcox (Oracle)
2022-01-12 23:08   ` Kees Cook
2022-01-31 14:27   ` David Hildenbrand
2022-01-31 19:27     ` Matthew Wilcox

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=202205101455.24F5C046F@keescook \
    --to=keescook@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /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 NNTP newsgroup(s).