Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3663883img; Mon, 25 Mar 2019 15:13:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/iR/JUOKrjZ90eedqSLN2Gs183+zLdFkOSOnZ/6ccno04boHXM6cx/c0lmd02cfqV0j/2 X-Received: by 2002:a63:4616:: with SMTP id t22mr24803378pga.217.1553552011802; Mon, 25 Mar 2019 15:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553552011; cv=none; d=google.com; s=arc-20160816; b=p76DDfSDEy0cNmPH0wVi6UOCEkVLrurdAFZ6DB0HabmKGMIDUfSJWmx6v59sbvKqvZ q96uSykNiZxmuhhQ3jUIL/W9s12av96A9Qh5PtyOJhGs7tsg0y2jKPHU3BNssfLjSY9D 20aoP0fA7mkTIFh65Akv3KoAznsQP7l6fvffq1Li9PbVqmUjP1Xrlbf9znIe9wGLLR7K xCroptKJPkKqmyNvrrXJ2/xUS8t1lSCiOvQKAkAlyveT6Jmo4kIkSaDSAWCvnxJdtSg6 Gl5edthKPR9NTxi0abbtX1r8fH2U+TfjsDFQ+cJbJYyzO7p+YaBQXBWJUIYCO7ZU+Ln+ u0ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=PrJR0RaRgSbOBZwUzeo3I5hhwuXL6aA00K5kUeXQKiA=; b=epYjeuvxCUA1X03JHbeutZ+y19b95gb7lWGvHvGGfVk91oonZuuijqnZYSsJKRIIQR eIr8xnhzuNe6JtFrDsNaApPfZemHRscc1Q8A+joTaw7ida5bHOLLos7cGqXbafYR4t33 lDSCpsmrdqy6NpCWnO3cjxncjJw9/6OaswhJrH46WV8ip+XO6wPGQ79+L+WWzEbC57SA T0iO5wJV7iRZAYDYgfQ+RREH3MltGZGt+ogWGhzy2Ak3VNNafLBrwC0APnhPFgYWWdDd jNzVAfYfJdQi3N5BvaSo86bZ4aAaAmYcz5p3EmSvfGYrYj0AsoZte3gluVfU3FQAjxPl aR5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ldxpNgax; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o123si15597186pfb.116.2019.03.25.15.13.17; Mon, 25 Mar 2019 15:13:31 -0700 (PDT) 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=@google.com header.s=20161025 header.b=ldxpNgax; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731181AbfCYWK5 (ORCPT + 99 others); Mon, 25 Mar 2019 18:10:57 -0400 Received: from mail-qk1-f201.google.com ([209.85.222.201]:54892 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731145AbfCYWKy (ORCPT ); Mon, 25 Mar 2019 18:10:54 -0400 Received: by mail-qk1-f201.google.com with SMTP id v2so9914742qkf.21 for ; Mon, 25 Mar 2019 15:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=PrJR0RaRgSbOBZwUzeo3I5hhwuXL6aA00K5kUeXQKiA=; b=ldxpNgaxH/YHCoW1sAkKWCMk2rgkoIUCtZL9a3pHP1mgnuQGeHZOc2Hb8QqN9V/vhm nwU9NE1Y9sBqrUedzaF+jEQRCmfrzLWhJhZpAhWJfkX7TRIC2hTXiF19DrpYCo2BovDm iQRcbzBQsxO7oY7WniRiSxdW6DFqLI79Z3k0SkVIgYoLlVlbBPLclFAG4RtQ/oNUBp7t CxNo8cyMyHiyiMM6FwJdS5EuDvNKTU6uEHB1PxHs+RFl/d5mu8kzoILCb//teVE+zVlz ws+ZRmX5w82F56rt7M41HYV41JtsVSNrO0vBivx7Ax4wLryQaFJ5ZTpkh2Rqwh8Av9ZD dMVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=PrJR0RaRgSbOBZwUzeo3I5hhwuXL6aA00K5kUeXQKiA=; b=saMcsO8/AeizJ4aInXhfrmPjnixTQdGlzW37zahRCNXaRJ6VahVkZcAWpRUbkU4Dsm 9cgEms3INV3rHjI/u7X6vwCnh3MaDXfA+DOKCB/Qf4+4E+etWP1cKuJCPZ33aT9DttPK FufzqboayUez4CoD1Xad1+aQI7mXNUT7mxgaYObt4sHms5C2v1PfHHo3LeFkkdI9oJzr iLdU0OrRdkHXiy/6nWadbNH+lhi3x4zInldu857jlOZBnxGwulMZCcV/D1HpeCrJkVBb CdCPuZ2zK8jXsd4wCIquMgqgx0RMj+X/QmR/o+ogzRCRNtjjjDPgUDkB7CZdWSFROwUW J0KA== X-Gm-Message-State: APjAAAVOyHVIviwEnTCm3qTLW/qr566cOHo4wa+s5iWoRIjA5kz2cnhK FaXwMObu+aBmdpSgnFqiC2VVY/5S5k7hf8Moah+ECw== X-Received: by 2002:a37:b444:: with SMTP id d65mr20940708qkf.125.1553551853273; Mon, 25 Mar 2019 15:10:53 -0700 (PDT) Date: Mon, 25 Mar 2019 15:09:48 -0700 In-Reply-To: <20190325220954.29054-1-matthewgarrett@google.com> Message-Id: <20190325220954.29054-22-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190325220954.29054-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog Subject: [PATCH 21/27] Lock down /proc/kcore From: Matthew Garrett To: jmorris@namei.org Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, James Morris , Matthew Garrett 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 From: David Howells Disallow access to /proc/kcore when the kernel is locked down to prevent access to cryptographic data. Signed-off-by: David Howells Reviewed-by: James Morris Signed-off-by: Matthew Garrett --- fs/proc/kcore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index bbcc185062bb..d50ebfbf3dbb 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -518,6 +518,8 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) static int open_kcore(struct inode *inode, struct file *filp) { + if (kernel_is_locked_down("/proc/kcore")) + return -EPERM; if (!capable(CAP_SYS_RAWIO)) return -EPERM; -- 2.21.0.392.gf8f6787159e-goog