Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4528141imb; Wed, 6 Mar 2019 16:02:40 -0800 (PST) X-Google-Smtp-Source: APXvYqyF7y+gmCRX2XDjOlGL+eiL0XCHfk+y7ij0jFGoM/AzQBrFInsn46jjoBJnGsAGHUAJKi1r X-Received: by 2002:a63:e952:: with SMTP id q18mr8446442pgj.156.1551916960560; Wed, 06 Mar 2019 16:02:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551916960; cv=none; d=google.com; s=arc-20160816; b=aa9KJKTzxUlA6gZo+zJb2ZdxoUqNR6fom713hXpgF9GQ6oI4zwTCB96cMnuR6Jri2l Hqa2rVxl3FjtuPqVl0+jgolU7zv7pWvXpbH5oQq2FpoltWLE+YJepNqk88KXVgGnYXtb 4vY/xUPG/Newmnfe+zMolcuLwHXeUK8Sg/uMb1fp1JGom0sOxWZiC6ESdqfmqvt0kgVS MYjir3qxRiG/CB3111ysD2PWgPGH6mFsBVI7uHnWjjVBXSptUm2FGAqu0AxsQ+FOf376 xi8bnlIGYyIHKMzQwG1tk+OD46jgczmZoS3Xa46hrMB0fS9u7y5NT4W/bD+zuodPCPUJ g5FQ== 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=zcieI5+oJsXOBRD2KKmNlRR+gsKSY7mBPeZzRy6NCSc=; b=BLY2BAmFmCSPo7CP4AS5nb8gLiVotV7aPUsdnXNjfjI9o/Q4RYM9HcJ+SZNfu1hIe0 kbCiE6Ns8EHn44eIqho2qU8byu6WT56p8/eXumGj9GIXVnYoZt7wR5Tn6YvFm5znnG7u qRzrcgVs+6AaZzWpvfG7M6XdMchnfr+7TZq3S5nX6trjH97aRSg45hVjx638RSSNMPHa BV8wkmBxHTMD7WsWlcku8l54t5MVOd0AmjLUcc7KrQxTPkOOZGGGLRERWKHZXV/BJ0PH vvdI7WWMO/MjZ71KzPwI/VNZLgbup5baL/FXlEupbCD3/Hbom3vqIAXrxkX4hN+fdE9q 9KUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=O1ibSFci; 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 n6si2529985pgj.96.2019.03.06.16.02.25; Wed, 06 Mar 2019 16:02:40 -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=@google.com header.s=20161025 header.b=O1ibSFci; 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 S1726696AbfCGAA0 (ORCPT + 99 others); Wed, 6 Mar 2019 19:00:26 -0500 Received: from mail-qk1-f202.google.com ([209.85.222.202]:34194 "EHLO mail-qk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726679AbfCGAAY (ORCPT ); Wed, 6 Mar 2019 19:00:24 -0500 Received: by mail-qk1-f202.google.com with SMTP id y6so11650327qke.1 for ; Wed, 06 Mar 2019 16:00:24 -0800 (PST) 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=zcieI5+oJsXOBRD2KKmNlRR+gsKSY7mBPeZzRy6NCSc=; b=O1ibSFciJav1PBiNgfW7eudRgTugTEl+TugUvK9qs+q2PFX0lyPloPkpzQwzw61I64 Q2zx5/02BIZdytE7FQiwVUDn2df256UDJt3cpW+z1UhfXc+rC+66FD0K/p4em9inKb8J /XFuvm5TXkQ6iT7dbSpy6iXTYwfeRN0PYs6etedNN5+u7UuUuogetkzOVadi+RL0eXft opqc9XF0yWDwaofLK3Zuk8uGos6c9ZFIxHG3yQ1SW4U/+mUBQBslM9ZYHjnaB77B3jQD Nw0yLYzxPB66JJn3zzoVdET/cQayg7nSTwBR75/2YCgJarOi/6b98ytYorvyqE+K2ES0 dS0Q== 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=zcieI5+oJsXOBRD2KKmNlRR+gsKSY7mBPeZzRy6NCSc=; b=JU4dPmKu9yFE+w3JIZCYqSUfyTVuqSKl6PRSgJabjRpQRUNUghdtYGxsHFqaHq1nG3 hGJLAjs1rXhag923Nuzs7hte3QH/ZADMMUIxfeoYdssxs/FIVAHa/9TrGOSag1gmM8Js 6CW98hH4LidZSCozobGKtHnErdWCxqqXqCkdvoMxWiFhwpRU6rYJuiPPIaozQfuUst4w 3ef1WnFfiv83oRmUULrz22egMojy9C55+vxGFc5eMrsVizb4yxKuk4p/EwqKCfxgLM2L 2n0eL6LL1slyVP7Xk9VkC3mpbgnZHB0NEBmnzuGs3dmKbiwpTzNf3OkBmnpq6X7rt5NC ImoQ== X-Gm-Message-State: APjAAAVWdnv9M+6N8jGKV0AygtLVM5yZOi86lIK01pgUEQGIuHWUaV6q 9IW2CmCfwB1EdMEPNRgtNcz7VwfNSPsRDrnG6uSubw== X-Received: by 2002:aed:37c4:: with SMTP id j62mr5902579qtb.19.1551916824091; Wed, 06 Mar 2019 16:00:24 -0800 (PST) Date: Wed, 6 Mar 2019 15:59:08 -0800 In-Reply-To: <20190306235913.6631-1-matthewgarrett@google.com> Message-Id: <20190306235913.6631-23-matthewgarrett@google.com> Mime-Version: 1.0 References: <20190306235913.6631-1-matthewgarrett@google.com> X-Mailer: git-send-email 2.21.0.352.gf09ad66450-goog Subject: [PATCH 22/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 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.352.gf09ad66450-goog