Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3800386imu; Mon, 28 Jan 2019 11:02:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN4FoYLYbxyB0nVsqfpHAMWAxrSYDeqGHYhTsbU5EZV4vesDl75NccPNIDu2qbvUV4a7LjhQ X-Received: by 2002:a65:49cd:: with SMTP id t13mr21079491pgs.376.1548702141487; Mon, 28 Jan 2019 11:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548702141; cv=none; d=google.com; s=arc-20160816; b=mYjwcx6CNqgdDqOumOOX8M+8+f12RXxqKUpYwxeQL/biXGWhf3jeYdORdjGqR8qku/ rk4TYqBRxKtXtHpl6C6u8q24ZLhie2KODjNFCAdw4B67TRKxy3sEYc5H6HYQsI/Msf99 1ZRPVj7x/g+QJRn1kkQY/KDBv49vuexLA1h6VtfDw254ac4XYqAQ+cDqPhmdDo0xEVlH IA256q4DPALTe/sCHN0lv/0nKeCZBvAfBqUiKe7tRp0Qw7+J5VxRkPr2xifon18BhNb5 9nDuNe3LZVgJ/u2NGxO5i53QYA3KXiXLTAyPMcnsjj22Cx7P2W13o89T40n1BpPslf1b PYSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HW28ls7Wx+igmjl+yu70fqcBEBBFWWC4XR6jh21UZYg=; b=f2Hi9STRGgVhlU3xmZCHQnTjH+1/RWth/mv23aXmoRZDQr0ZZpbv0AKkHpu9N+QIL5 KGQquCcuXTpsFdDhGUqlQuZ5kbHMQnFL3Ca5DD5FQsZvmSwAjG/VT0yHJZAB6m19gkD3 y2nI5fMqp3M00lj/AlHjBhTLMCkj4Lk331MPnuzWm+Khe9eX7wDt7tbJr5QsfkNZOnQL zyJPtAEQiNJaTFBG59sZhrewF4OmwuVmcQq9+YKCW8XJq43gMhRR4nRcbp6tLIi8rP06 YdpeJbnxpsk9093fNk3RrEYJzgVYDNcs/AJlSq2HwLzuWn6IVcX44PUyZHJ9P4zY6vuf qe2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kfKH+nma; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si32233096pgj.416.2019.01.28.11.02.05; Mon, 28 Jan 2019 11:02:21 -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=pass header.i=@chromium.org header.s=google header.b=kfKH+nma; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727056AbfA1TAc (ORCPT + 99 others); Mon, 28 Jan 2019 14:00:32 -0500 Received: from mail-vk1-f194.google.com ([209.85.221.194]:37958 "EHLO mail-vk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfA1TAb (ORCPT ); Mon, 28 Jan 2019 14:00:31 -0500 Received: by mail-vk1-f194.google.com with SMTP id w72so3914469vkd.5 for ; Mon, 28 Jan 2019 11:00:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HW28ls7Wx+igmjl+yu70fqcBEBBFWWC4XR6jh21UZYg=; b=kfKH+nmaemVN1YLHaFgCdpR8oIM1Il/wC44Xsc3dCbL7K7GWHY/x23uRnB+zY2JwO9 0goxzN28D1fXTVU7AgBKBinIv1rd824L7tNtIe/DlAN6O4P8Sil7cwq77F0jP6G83wJ7 6/t4SE/k8w1Hl1+2IJGM1jRzyCkgua/nCMkPQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HW28ls7Wx+igmjl+yu70fqcBEBBFWWC4XR6jh21UZYg=; b=gC23AxRXPcF+lkbzEDk7GdRIo1jQIEqu69jxvuXB/4ewcVpK7Dg6F3fBEMXVZuFoi1 BTf671U1HAYTWqYHet5RpYMXovVAEDkOzcBNx/+LXAHYt56a7s7fBVb7WeUyG+KcdAJR ySgJsqC1OsEuzYDjX8A7HViShsCXwAZhsEsmHAxzfpxHJHpG7BdKkUJdl7kdRJNn3CPn 8YMnEGk75R3yhcPAkZVg892T1cPiLDtwMshhfU5kteW0l2sHAEkJRRBujCRX4D4RzH8C lI2mQTSNo7HfNHsZOaoTr7YlgdeDHXOaASBhM0I+EpSGbvf7ETUQMhSYpsZNIu6eAnYa gigQ== X-Gm-Message-State: AJcUukf1wJBdp0c2Hv/PRT3HDteLaEYPpVLh0ecv4wyKCtFj4Lt3mUn+ vXm9Y8IrpsaAbbDJ/x/Eh/Z8jozpwcc= X-Received: by 2002:a1f:2d89:: with SMTP id t131mr8843622vkt.27.1548702030160; Mon, 28 Jan 2019 11:00:30 -0800 (PST) Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com. [209.85.222.52]) by smtp.gmail.com with ESMTPSA id t133sm35056961vsc.8.2019.01.28.11.00.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 11:00:27 -0800 (PST) Received: by mail-ua1-f52.google.com with SMTP id t8so6002853uap.0 for ; Mon, 28 Jan 2019 11:00:26 -0800 (PST) X-Received: by 2002:ab0:740a:: with SMTP id r10mr9002232uap.14.1548702026118; Mon, 28 Jan 2019 11:00:26 -0800 (PST) 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 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm: Prevent mapping slab pages to userspace To: Andrew Morton Cc: Matthew Wilcox , Linux-MM , LKML , Rik van Riel , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Kernel Hardening , Michael Ellerman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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