Re: [PATCH] usercopy: Skip HIGHMEM page checking

2019-09-17 Thread Kees Cook
On Tue, Sep 17, 2019 at 09:36:06AM -0700, Matthew Wilcox wrote: > If the copy has the correct bounds, the 'wholly within one base page' > check will pass and it'll return. If the copy does span a page, > the virt_to_head_page(end) call will return something bogus, then the > PageReserved and CMA t

Re: [PATCH] usercopy: Skip HIGHMEM page checking

2019-09-17 Thread Matthew Wilcox
On Mon, Sep 16, 2019 at 08:05:00PM -0700, Kees Cook wrote: > On Mon, Sep 16, 2019 at 05:32:09PM -0700, Matthew Wilcox wrote: > > On Mon, Sep 16, 2019 at 02:32:56PM -0700, Kees Cook wrote: > > > When running on a system with >512MB RAM with a 32-bit kernel built with: > > > > > > CONFIG_DEBUG_VIR

Re: [PATCH] usercopy: Skip HIGHMEM page checking

2019-09-16 Thread Kees Cook
On Mon, Sep 16, 2019 at 05:32:09PM -0700, Matthew Wilcox wrote: > On Mon, Sep 16, 2019 at 02:32:56PM -0700, Kees Cook wrote: > > When running on a system with >512MB RAM with a 32-bit kernel built with: > > > > CONFIG_DEBUG_VIRTUAL=y > > CONFIG_HIGHMEM=y > > CONFIG_HARDENED_USERCOPY=y

Re: [PATCH] usercopy: Skip HIGHMEM page checking

2019-09-16 Thread Matthew Wilcox
On Mon, Sep 16, 2019 at 02:32:56PM -0700, Kees Cook wrote: > When running on a system with >512MB RAM with a 32-bit kernel built with: > > CONFIG_DEBUG_VIRTUAL=y > CONFIG_HIGHMEM=y > CONFIG_HARDENED_USERCOPY=y > > all execve()s will fail due to argv copying into kmap()ed pages,

[PATCH] usercopy: Skip HIGHMEM page checking

2019-09-16 Thread Kees Cook
When running on a system with >512MB RAM with a 32-bit kernel built with: CONFIG_DEBUG_VIRTUAL=y CONFIG_HIGHMEM=y CONFIG_HARDENED_USERCOPY=y all execve()s will fail due to argv copying into kmap()ed pages, and on usercopy checking the calls ultimately of virt_to_page() wil