From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 References: <20190125173827.2658-1-willy@infradead.org> <20190128102055.5b0790549542891c4dca47a3@linux-foundation.org> In-Reply-To: <20190128102055.5b0790549542891c4dca47a3@linux-foundation.org> From: Kees Cook Date: Tue, 29 Jan 2019 08:00:14 +1300 Message-ID: Subject: Re: [PATCH] mm: Prevent mapping slab pages to userspace Content-Type: text/plain; charset="UTF-8" To: Andrew Morton Cc: Matthew Wilcox , Linux-MM , LKML , Rik van Riel , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Kernel Hardening , Michael Ellerman List-ID: On Tue, Jan 29, 2019 at 7:21 AM Andrew Morton wrote: > > On Fri, 25 Jan 2019 09:38:27 -0800 Matthew Wilcox wrote: > > > It's never appropriate to map a page allocated by SLAB into userspace. > > A buggy device driver might try this, or an attacker might be able to > > find a way to make it happen. > > It wouldn't surprise me if someone somewhere is doing this. Rather > than mysteriously breaking their code, how about we emit a warning and > still permit it to proceed, for a while? It seems like a fatal condition to me? There's nothing to check that such a page wouldn't get freed by the slab while still mapped to userspace, right? But I'll take warning over not checking. :) -- Kees Cook