Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp814741imu; Fri, 25 Jan 2019 11:30:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN5VDR12orDRy7THbIfq27AnK5JtFkY5ppzd75sJVpcoNuY3yq5M7eMo/0VN+ZqOaOQHM8H0 X-Received: by 2002:a17:902:820d:: with SMTP id x13mr12644806pln.229.1548444642455; Fri, 25 Jan 2019 11:30:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548444642; cv=none; d=google.com; s=arc-20160816; b=L/k74w0ywKs7zvD8VRawIGgbEMTtUppossvwRHKjh9pE9XIuihzzWm4stX/pXzyGja l0n5WNw1yzOoyqlXXnTQ2GMCh91AnXQBWMWE6jfOWiFe7OxnS7X9I5muVLrFxzAhmyCJ ep7bVRovCN7bMlx+rZeiJSF5AwAUkOjrlJc3SdX9/ANsOzHHn7O9t+yeC14JfrExptb+ TyjSkEAAJ8qiPFQTLUP5xVkQkPJ8/QgaNrIQBzIQ2rqwQ/MB1jgKkoNNKACA/5wB5qYq Bnl7kmAtS0M4o9N6O8dSI+Q9Jn/J2JJ0lnWe9nsme0nhFNbF9gZGYft8Weo9X/oMr0zC Z5nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ww5Iu1QbHYxludV75gZhSQ1cVEB4MwtTUBxCvKbV0Ns=; b=Y37NhWRsyM5R11M9Wgo327A6H4A1V3F3iPmwzeb2ADpzEjDbhpq7EPcIl88BgJxz3q CaKWQrjaazvjtjlWTHSXx6NqaBLi6LWe0VS0Nbx5WZGi/AZIIoHuGmDaL1xRDMmIcMII CAs2j3uHr36659Yu/wStJULl4QVGhJEHnA33dfVMBWLUhjXclSjdkeidYvNaQlWVnX+D FZ5BQYAPm/lFyJpSUcNd+sqty+Jp84oF6UfA0NiTSdfNGqZTEooQzzCMEcwJ/I7yXvLh H2WHhoEPmbjhmi+HjSZSiJv3skFzA9ywovEZOxCC/JmwWqIGcIyaX5AR7Iosppe5CJ7p XUhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZXEgHwlK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8si26458109pgf.577.2019.01.25.11.30.25; Fri, 25 Jan 2019 11:30:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZXEgHwlK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728907AbfAYTaH (ORCPT + 99 others); Fri, 25 Jan 2019 14:30:07 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:36546 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727736AbfAYTaH (ORCPT ); Fri, 25 Jan 2019 14:30:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ww5Iu1QbHYxludV75gZhSQ1cVEB4MwtTUBxCvKbV0Ns=; b=ZXEgHwlKvOWKrx9g0SlEIbYLw TadyUIABncSF685kG7JRSlFsswQbGTUv92YWPb1ggkkkz7605W1p4x2vwEbffXHgJ72YfdJUmPs3k 5ZTDQanfHFYbrFj0bytN7hN+WJB+nVn612lYPk9hEt6o8kHfjA0l/+w17h65NyWWKrvej4lgosUyd 1FP/BbsIgoHLcnLLlilzSr90rHCA8sdIMmvoPyfTrP12YP7MIiQU5aPrPWM/5IHhv3U/laqLV1eKj 6Fpcc7jrbwCp602NukzUdUMUhUZ7COB40/Hqg5QIjusLWI5gP42LCW6yIlk/qZnzZlI0LS4XHT3to PfuRFIQnQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gn7Ay-0007es-Su; Fri, 25 Jan 2019 19:30:04 +0000 Date: Fri, 25 Jan 2019 11:30:04 -0800 From: Matthew Wilcox To: Kees Cook Cc: Andrew Morton , Linux-MM , LKML , Rik van Riel , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Kernel Hardening , Michael Ellerman Subject: Re: [PATCH] mm: Prevent mapping slab pages to userspace Message-ID: <20190125193004.GA21155@bombadil.infradead.org> References: <20190125173827.2658-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 26, 2019 at 07:44:40AM +1300, Kees Cook wrote: > > - if (PageAnon(page)) > > + if (PageAnon(page) || PageSlab(page)) > > Are there other types that should not get mapped? (Or better yet, is > there a whitelist of those that are okay to be mapped?) Funny you should ask; I think the next patch in this series looks like this: - if (PageAnon(page) || PageSlab(page)) + if (PageAnon(page) || PageSlab(page) || page_has_type(page)) but let's see if there's something I've overlooked with this patch.