Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3377605imm; Thu, 17 May 2018 07:53:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoXJTDCDxzCvsWepALn0G2/PQhRNi05h7rP5SYEyRfUEW06qO0GmzbDR15j/PKz6bE5NQaI X-Received: by 2002:a62:ba09:: with SMTP id k9-v6mr5440520pff.245.1526568781185; Thu, 17 May 2018 07:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526568781; cv=none; d=google.com; s=arc-20160816; b=ULVHbmMGupYPXu1P+6iVxQkAXDNi1AY/E0eUGJvYbydRbjeO85p6RAJkxr9QV5RKeg Gx8u3nkx2ichyt45TBdALl/nLbZNMvVBHwVgZc+tfgYq6HAlf+1IeETyGaUvhw9H5aHv XkHkClfEvYofjFNfbzm7dlI7B6Cw4+Ee2ZXs20rwQpKeghPPNwxgHFa3v2kf4XPSHQzu oEaw0kHpb5h7byc+e45fO88BKlMnMqFZytq+Gy76QNaT4F4NeQ+FkPDwKUSZKYEq9ZkO uLnsRgOllhFCdFoItMf1hceLljn8J5EcqfTsgEzOnoHqCb3uG86ufw/dTa8EQPMtgveF Ah/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=KpnNycjncj9Lb4iRUlPwW94OYbHEqlEdC5wTzp0JBkw=; b=xrhHzB+Hz3HR4k8heP0Gu5PtXktLKRI4vwWmzZDpF0gkdBuGIf6hm65devhZciqpYI Wwm/V5F4ZHNcK3updzhG7e2lwEHUHOZqI4gXOHCDKlL82oNhRns/YZWXYqbPnP6hV+9v RlqMxzoSlRBYmKU0JUG9ac+G5nGEWDp4xT4+xu8GR0nVLhiGdLck30ZErtWH1yL6fX/C CgIm+5nSMb1nLVYimc66IwrcujIC4j+dnjl1lT3uE7rWgJR5aOMIADaKnixwWBDWOSGV RxBMYmy7MTpplCjn9gmVBoMSR9L4ZsVo6/glypLHY/wJN27sfpr+S1ovZCisMbH8Qo0D JEkw== 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 a3-v6si3565849plc.574.2018.05.17.07.52.47; Thu, 17 May 2018 07:53:01 -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 S1752424AbeEQOtf (ORCPT + 99 others); Thu, 17 May 2018 10:49:35 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37042 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbeEQOtd (ORCPT ); Thu, 17 May 2018 10:49:33 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4HEj0Uv012602 for ; Thu, 17 May 2018 10:49:33 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j1bf0scd6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 May 2018 10:49:32 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 17 May 2018 15:49:30 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 17 May 2018 15:49:26 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4HEnQaq6685168; Thu, 17 May 2018 14:49:26 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1B2B4C046; Thu, 17 May 2018 15:41:14 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8ACCA4C05C; Thu, 17 May 2018 15:41:13 +0100 (BST) Received: from localhost.ibm.com (unknown [9.80.108.64]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 17 May 2018 15:41:13 +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 Subject: [PATCH v2 0/9] kexec/firmware: support system wide policy requiring signatures Date: Thu, 17 May 2018 10:48:41 -0400 X-Mailer: git-send-email 2.7.5 X-TM-AS-GCONF: 00 x-cbid: 18051714-0044-0000-0000-000005538AC9 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051714-0045-0000-0000-000028950007 Message-Id: <1526568530-9144-1-git-send-email-zohar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-17_08:,, 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=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805170137 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org IMA-appraisal is mostly being used in the embedded or single purpose closed system environments. In these environments, both the Kconfig options and the userspace tools can be modified appropriately to limit syscalls. For stock kernels, userspace applications need to continue to work with older kernels as well as with newer kernels. In this environment, the customer needs the ability to define a system wide IMA policy, such as requiring all kexec'ed images, firmware, kernel modules to be signed, without being dependent on either the Kconfig options or the userspace tools.[1] This patch set allows the customer to define a policy which requires the kexec'ed kernel images, firmware, and/or kernel modules to be signed. New to this patch set is the ability to configure a build time IMA policy, which is automatically loaded at run time without needing to specify it on the boot command line. The build time policy rules persist after loading a custom kernel policy. [1] kexec-tools suupports the new syscall based on a flag (-s). Changelog v3: - combined "kexec: limit kexec_load syscall" and "firmware: kernel signature verification" patch sets. - add support for build time policy. - defined generic security_kernel_read_blob() wrapper for security_kernel_read_file(). Suggested by Luis. - removed the CONFIG_CFG80211_REQUIRE_SIGNED_REGDB ifdef. If both REGDB and an IMA-appraisal policy require signed firmware, for now require both signatures. Subsequent patches might change this. - Still unclear if the pre-allocated firmware buffer can be accessed prior to the signature verification completes. Mimi Zohar (9): ima: based on policy verify firmware signatures (pre-allocated buffer) ima: fix updating the ima_appraise flag security: define security_kernel_read_blob() wrapper kexec: add call to LSM hook in original kexec_load syscall ima: based on policy require signed kexec kernel images firmware: add call to LSM hook before firmware sysfs fallback ima: based on policy require signed firmware (sysfs fallback) ima: add build time policy ima: based on policy prevent loading firmware (pre-allocated buffer) drivers/base/firmware_loader/fallback.c | 7 +++ include/linux/fs.h | 1 + include/linux/security.h | 6 +++ kernel/kexec.c | 11 +++++ security/integrity/ima/Kconfig | 58 +++++++++++++++++++++++++ security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_main.c | 29 +++++++++++++ security/integrity/ima/ima_policy.c | 76 +++++++++++++++++++++++++++------ security/security.c | 6 +++ 9 files changed, 183 insertions(+), 12 deletions(-) -- 2.7.5