Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1995114imm; Thu, 24 May 2018 04:12:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqngwBUlTOkE5hvh27Ci2OioO4+3Z9eBjDMpZ5vdtDKspel1bOkJHPF7v0lWwNGTtQjvw8b X-Received: by 2002:a17:902:5602:: with SMTP id h2-v6mr7039194pli.115.1527160361346; Thu, 24 May 2018 04:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160361; cv=none; d=google.com; s=arc-20160816; b=rnEnqe7UKHWaFV/1htvSKM+tYFJOebyjZp4zDO2j8mmtdHFx0YgbNjkVV5QRp9PlAs bglZ2Ko9Obj9WLI4MLXgQptvP1QukyIOWvj9ME77KMAOW4xAyR4UKxMniGhFwJT38G4W ZcRqyhBzNnH2W6rH+hQgaHh9tVwB5y052LnCxvwjYzPIfgdpj9Vt1U2hXd7U+iyUnWdy fuyEqFgKMXlNt1VWIkhZiO/LPRR+U9DPkirTToOfpCbpKQnVlutz+nQxuCq5YIbR/CsG +XFPp9NWT1+UJQpRwIllGFd7+uEqb41rPVTYpq5WeAs/7/slP6WoeOQl4SOePM56wIvI zV5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=EQBq6OVkL1ZRN+XfVpW/KLZnGClndlBK2p9DrFKhIT8=; b=MAjVITy5ag7T/twBdDlUpLQtFUdN9GNK70crMbQPsOHOqJecAJsvYv5tNjGg4Bjn4p +Mz9MGyqssYfBDatwzjP90qQE0N62I2zV1HQy9ycSt+ZgNWr0GEpXQ9ESNch1uGluaNM Hl8EUYnhAep+9w5zkR2Vx3bWUvdbwutzT6V9a83lON48OBDoAMbAo3bun2Eoq7ptPZ7+ pUiGktWdip0n55S7rctCLDBhbtVGXC7d5CT3HfT7Y2jIZt3qerDuUE+IuE13qsklTQyh r7KMNbuE+VNS9xoNBfUaCJZ803ql+aizF1ZqAeQ7ixtaE7UcUdHNewwvRKWNN1bFidOQ nDEw== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay9-v6si22459007plb.259.2018.05.24.04.12.26; Thu, 24 May 2018 04:12:41 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033084AbeEXLLs (ORCPT + 99 others); Thu, 24 May 2018 07:11:48 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49780 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032915AbeEXLLn (ORCPT ); Thu, 24 May 2018 07:11:43 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4OB0OHk120230 for ; Thu, 24 May 2018 07:11:42 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j5s4s8f4a-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 May 2018 07:11:31 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 24 May 2018 12:10:39 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 24 May 2018 12:10:36 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4OBAaQo11731424; Thu, 24 May 2018 11:10:36 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5AD8E11C04A; Thu, 24 May 2018 12:01:40 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A44F811C050; Thu, 24 May 2018 12:01:38 +0100 (BST) Received: from localhost.ibm.com (unknown [9.80.85.225]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 24 May 2018 12:01:38 +0100 (BST) From: Mimi Zohar To: linux-integrity@vger.kernel.org Cc: Mimi Zohar , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, David Howells , "Luis R . Rodriguez" , Eric Biederman , kexec@lists.infradead.org, Andres Rodriguez , Greg Kroah-Hartman , Ard Biesheuvel , "Luis R . Rodriguez" , Matthew Garrett Subject: [PATCH v3 5/7] ima: based on policy require signed firmware (sysfs fallback) Date: Thu, 24 May 2018 07:09:34 -0400 X-Mailer: git-send-email 2.7.5 In-Reply-To: <1527160176-29269-1-git-send-email-zohar@linux.vnet.ibm.com> References: <1527160176-29269-1-git-send-email-zohar@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18052411-0040-0000-0000-0000043D6275 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052411-0041-0000-0000-000026429F34 Message-Id: <1527160176-29269-6-git-send-email-zohar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-24_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805240132 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With an IMA policy requiring signed firmware, this patch prevents the sysfs fallback method of loading firmware. Signed-off-by: Mimi Zohar Cc: Luis R. Rodriguez Cc: David Howells Cc: Matthew Garrett --- security/integrity/ima/ima_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index fbbcc02a1380..dd1f263f950a 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -451,10 +451,17 @@ int ima_read_data(struct file *file, enum kernel_read_file_id read_id) pr_err("impossible to appraise a kernel image without a file descriptor; try using kexec_file syscall.\n"); return -EACCES; /* INTEGRITY_UNKNOWN */ } + break; + case READING_FIRMWARE_FALLBACK_SYSFS: + if (ima_appraise & IMA_APPRAISE_FIRMWARE) { + pr_err("Prevent firmware sysfs fallback loading.\n"); + return -EACCES; /* INTEGRITY_UNKNOWN */ + } default: break; } return 0; + } static int read_idmap[READING_MAX_ID] = { -- 2.7.5