Received: by 10.192.165.156 with SMTP id m28csp935177imm; Wed, 11 Apr 2018 09:30:53 -0700 (PDT) X-Google-Smtp-Source: AIpwx48v4QGtkPlHB6wGgNMgiHkLgE74MzAdQwi+Gtij2hSIOuQFIEDa05H+8P8d10Hdb6DXwWJe X-Received: by 10.101.98.136 with SMTP id f8mr3940096pgv.41.1523464253731; Wed, 11 Apr 2018 09:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523464253; cv=none; d=google.com; s=arc-20160816; b=Twzq0bP0iLdezCg3YZ4v5YdTHWOTvbmNUks7mV3Y+f6mgzHrVtZdU4VpG8+bfCNhIU nzwupBwK8njk6BUuI8+qwlAsoI6L4sVgQJddaNiZQnJ4pEBvYffSM6JArBYpz/nx7oUV g4Ba3uexwIvfhaRxR9woVS6g6f5ElwQX4iAWTRQYiTG5kKE17xPSaHXsv9Ypi+FNh9on 6Iv0e1e21praK5IIt1NwpwecEwUevj03EbIK2MU/3RqZLsoFNakb+OHN0Sn91liVMEiJ DALEhU5NrnVrSPyZJNdoXbkWHc5MLfMJ1qDzd5FKy2ka0QJoQM8u+KXdOgFvRS+S8DmE vxPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:arc-authentication-results; bh=sYplSHFq0LfSLA8IoNoMkG3Au3CjAwDatoaI9MXtFv4=; b=ifuPNRUDc0OwitNM9c+gei+sJmUkyAsy1qfr++98TdEEGhPVJfXodJo3dJ8vvTePu0 doyOfGjrUNdtRCZLFdcQycNotaU13mQvnRFukYonZ9/rFcSSdOT+A4HX5RwEbjSIAatW Zr346X1hp4vyA954rgPMloNhz3HSqU0TPNZPQ20wz8LiRHi8rgxdyczI7+RjXqn6ysDq z7J7Pi3pfPlRgEfe+IcCN4DfrcCKoFbvhOo+M+lC7I1LEHHjk80gcIFwvTjmj/hbBJqr zBbzlvveuJwXxxpseMx+EqdxD+GYh3LmQ/8Vf9DWe3jUVf7P55GLvQVkOsSBGf18wDwo YY8g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7-v6si1409929plt.660.2018.04.11.09.30.16; Wed, 11 Apr 2018 09:30:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754335AbeDKQ0x (ORCPT + 99 others); Wed, 11 Apr 2018 12:26:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754316AbeDKQ0v (ORCPT ); Wed, 11 Apr 2018 12:26:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 732FF8DC22; Wed, 11 Apr 2018 16:26:50 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-8.rdu2.redhat.com [10.10.120.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9CD53BDC56; Wed, 11 Apr 2018 16:26:49 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 20/24] Lock down /proc/kcore From: David Howells To: torvalds@linux-foundation.org Cc: linux-man@vger.kernel.org, linux-api@vger.kernel.org, jmorris@namei.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, linux-security-module@vger.kernel.org Date: Wed, 11 Apr 2018 17:26:49 +0100 Message-ID: <152346400916.4030.1623673477529314083.stgit@warthog.procyon.org.uk> In-Reply-To: <152346387861.4030.4408662483445703127.stgit@warthog.procyon.org.uk> References: <152346387861.4030.4408662483445703127.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 11 Apr 2018 16:26:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 11 Apr 2018 16:26:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/proc/kcore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index d1e82761de81..cdebdee81719 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -546,6 +546,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;