Received: by 10.192.165.156 with SMTP id m28csp937322imm; Wed, 11 Apr 2018 09:32:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx48rMV4j2IyNCW63zo2DMSb9zbMYdS+/Hoc9J7frKUP79lYXKnx6MB3rxUAHU5pWomLUho3Q X-Received: by 10.99.60.79 with SMTP id i15mr3888063pgn.399.1523464375814; Wed, 11 Apr 2018 09:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523464375; cv=none; d=google.com; s=arc-20160816; b=y3cDttUg8EdiN4kNkC0UfAFgZFh5jsCfgOSYYg7/HzsT+JbhZVLEnMmkKJWnqMCR42 uvmp0cQEg14emi6seBhOC6p/cbdIPVW5pDwbFQjOaEYKEj035pF4BDvUWxYp8oTDowPh K24Y4hmKfL6/vsuFbTns5OELWSQsssxQ8/8uc38gX/vrAZ4k0st0Jrca51pkMF8JfBqP WKKNF73QayGSiajTH7+vxMyNZF6jWj/9jKqHsJ7U5AENCl4r32GI7rxy/JdPanJYlFWT D8VMG/3Ka0rLWpIE64omoOzWtf9UaWUI+3uUe+gI5NOIHieeNRudetur3uNeOLzFtP+m FQ3w== 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=2De9tmF9zCLsb0srop9CPbDZ3ICgXQCPEnRko3ghVkQ=; b=ciPIp9cSnzE4U1J8TP83NaRJIMwxvuBfjr9CnZrmt0SrvE09oOT0BydPXS5OksKWKD oF5PkpvgLzH7ux+/tWZ9OTbLpVurb4Pj/KaT0O9e3ML5CKKKKQMvMYGm+IBfZjeUCyvg X5n1phKLu+qKVjvjByH7cfVSZwDgYL1RMbJhpQMBIQ9Q/kct/bFJaEfyCu3mGNaUSYJw ahN1uXisehM9jWTbiaacthp2g73ariQGprDzscXhaTTjBHgTOFghN4FTK7GrKNCIVWYx m9bsN3u64HFzlVYDMd6iRmax7OUm6+UDXbTl0QU1NLWIkL2je8Bb2otucO2iovGJlhqH wluw== 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 b33-v6si1460180plb.503.2018.04.11.09.32.18; Wed, 11 Apr 2018 09:32:55 -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 S1754222AbeDKQ0W (ORCPT + 99 others); Wed, 11 Apr 2018 12:26:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54372 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753424AbeDKQ0S (ORCPT ); Wed, 11 Apr 2018 12:26:18 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 433464182D5A; Wed, 11 Apr 2018 16:26:18 +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 6DFDD2026E03; Wed, 11 Apr 2018 16:26:17 +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 15/24] acpi: Disable APEI error injection if the kernel is locked down 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:17 +0100 Message-ID: <152346397696.4030.2692221040490871671.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.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 11 Apr 2018 16:26:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 11 Apr 2018 16:26:18 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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 From: Linn Crosetto ACPI provides an error injection mechanism, EINJ, for debugging and testing the ACPI Platform Error Interface (APEI) and other RAS features. If supported by the firmware, ACPI specification 5.0 and later provide for a way to specify a physical memory address to which to inject the error. Injecting errors through EINJ can produce errors which to the platform are indistinguishable from real hardware errors. This can have undesirable side-effects, such as causing the platform to mark hardware as needing replacement. While it does not provide a method to load unauthenticated privileged code, the effect of these errors may persist across reboots and affect trust in the underlying hardware, so disable error injection through EINJ if the kernel is locked down. Signed-off-by: Linn Crosetto Signed-off-by: David Howells Reviewed-by: "Lee, Chun-Yi" cc: linux-acpi@vger.kernel.org --- drivers/acpi/apei/einj.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index b38737c83a24..6d71e1e97b20 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -518,6 +518,9 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, int rc; u64 base_addr, size; + if (kernel_is_locked_down("ACPI error injection")) + return -EPERM; + /* If user manually set "flags", make sure it is legal */ if (flags && (flags & ~(SETWA_FLAGS_APICID|SETWA_FLAGS_MEM|SETWA_FLAGS_PCIE_SBDF)))