Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1996353imm; Thu, 24 May 2018 04:13:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo8Iec+QsNA7I+s7g3K6xtvc+v8uIR4cwlf/DoArVeXY8z/q7r66kIbtAAfc5h/aTwPmPpe X-Received: by 2002:a17:902:868b:: with SMTP id g11-v6mr6751572plo.305.1527160433250; Thu, 24 May 2018 04:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160433; cv=none; d=google.com; s=arc-20160816; b=IRXFexgMeg3kM4JB0eLEReTVR1sthdIt5FXTaSDO5CS01Q/xqsNPmjkil94OwC1HeN 8dzgkxpNcq27cB2uW6GQElaGwVpEB5c1mQXcqii+A1AWT58uq3Uff/VjDw85DyOUpeom 8BQwg3qKaD1VUGjc4e+MEF6JaxEeBM8Qx27oT29J6V8hPFI3TTpLx4pOxxg1ZAdcQgEJ gnCZ2iAtp51v7b7YecjW3DH5YfsQDL28DtoQT7Bo9dmnkjNytBKr+sIfFewYDz7rGYUl ipiZ043ff+TDewThcyRwdasipn1lk58FpY3pgKqROMXKJ1rOH7p1fGv5zf2PTzz9w15A ju+w== 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=rhCnad8BN4LqIv5oFjw/+mfkZ6M9UFZAny3CpcVamGs=; b=FYOGZKpVB/OBES8Y7ZqcLH7rfoJCd6EeOmgTlvCwrTBlbl9vEP8ietDO6y2lJ0F8JD 1zJWSncZqMRnv0SqW4xboFCQ/LgVG9aHpgte/AVODNwfwVMCnSiAWg7vu8hO38Usovgj hJrhvbsq39bjnj22BE1C4HJp+y6a7GxZMzhQhtpvnpDX/vQ+j1Uh50ISplKJfkXuvNWD i0bhtnIuzfVF36gHRPBAA0fRgRXSESwb8VI8c1TTEFvkjW3tx50X0yKd6tNfgUXhQ5ir Mq4nPCZGCKIS/2EFt/Hgzi95XjntsNdrfU8oOrgQM+180ASMocu3/6J/LVJ9mwicOuPh l3TA== 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 j10-v6si20856742plg.396.2018.05.24.04.13.38; Thu, 24 May 2018 04:13: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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033035AbeEXLM7 (ORCPT + 99 others); Thu, 24 May 2018 07:12:59 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51730 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032903AbeEXLKa (ORCPT ); Thu, 24 May 2018 07:10:30 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4OB08oN114052 for ; Thu, 24 May 2018 07:10:29 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2j5s7xr9e4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 24 May 2018 07:10:29 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 24 May 2018 12:10:25 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 24 May 2018 12:10:21 +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 w4OBALU911403628; Thu, 24 May 2018 11:10:21 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D4E611C052; Thu, 24 May 2018 12:01:25 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 456EF11C04C; Thu, 24 May 2018 12:01:24 +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:24 +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 v3 0/7] kexec/firmware: support system wide policy requiring signatures Date: Thu, 24 May 2018 07:09:29 -0400 X-Mailer: git-send-email 2.7.5 X-TM-AS-GCONF: 00 x-cbid: 18052411-0012-0000-0000-000005DA20EA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18052411-0013-0000-0000-000019576F9C Message-Id: <1527160176-29269-1-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 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: Based on James' feedback: - Renamed security_kernel_read_file() to security_kernel_read_data(). - Cleaned up ima_read_data(), replacing if's with switch. Changelog v2: - 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 Mimi Zohar (7): security: rename security_kernel_read_file() hook 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 ++++ fs/exec.c | 2 +- include/linux/fs.h | 1 + include/linux/ima.h | 4 +-- include/linux/security.h | 4 +-- kernel/kexec.c | 8 +++++ kernel/module.c | 2 +- security/integrity/ima/Kconfig | 58 +++++++++++++++++++++++++++++++++ security/integrity/ima/ima.h | 1 + security/integrity/ima/ima_main.c | 39 ++++++++++++++++++---- security/integrity/ima/ima_policy.c | 48 +++++++++++++++++++++++++-- security/loadpin/loadpin.c | 2 +- security/security.c | 6 ++-- 13 files changed, 162 insertions(+), 20 deletions(-) -- 2.7.5