Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp328650ybi; Fri, 7 Jun 2019 08:42:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTBfdC7t8U2Ei62OaWhtplpxj1QW7vpwr0A/Q0AKdfPha53Dtp6QhGOZY6pt936X2n8rlR X-Received: by 2002:a63:4714:: with SMTP id u20mr3382718pga.347.1559922173882; Fri, 07 Jun 2019 08:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559922173; cv=none; d=google.com; s=arc-20160816; b=RYWVVMc3j/u40b0I1mZbu5ZpOqAHdump0kTVK6t09JY2I4u6gbIGSJXTgsLcaeu4fC hGHLeBd7hwEsnlJ0LqQz/kC52fEGgqQ7hw38zHJwRPV2szx558Z0BNuGruBcw1Qq+Ss4 wjFdPRcutzFzXU0szgLWxHhD4IA/dzav4YzTY6pqM6+nZvb/AWXxjnI3mpxiHBJYe2yS nVyKuOhZsMBwdU/dobUhzyYja+jWJjYEwB9PDPV6lvepV8KJm5xNAOsGMQKPVH6NKn57 EfML9eY0b4/HZhmmsMRkYGR/o3rf5hAVXI2tUKAyEJRPoRCrrxx0gxI+Nn0Pcplycfqb cWEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject; bh=3Yd7jvVOPai+23TPJQy21AB5PsgCh9gcHOtUGL4OR6Q=; b=rT1CqpNUqmo1zVVoETNmI6di11gOBAMYM0VzAPqd0/BjixnEM1WAdXP5KWs8R2He/E muTa85pge1GNccVLNWIGvY08k8yfxRXYSwAra8Gg++rMKRfzNq+jxter15QWEsNsJTbp EuDwq6D26IEWbK0bmryRonSnjvL+NJgTS3zrg9Ifnoej3COsgUZMQFiAPWflUfaLWZYn Eph528KrseYIyOU4U7XHHlGFnhF1rsQPGZUOVBsdEm2EBHcu6+/TCQBJZlpP2xomvVkY XI/Tu+5FNa5RLRCPtiB29w26kcKvDQG+x8KW1bJbt64arrVYwVruMdvNT8uJa874cJiL orVA== 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 l23si2063380pff.2.2019.06.07.08.42.36; Fri, 07 Jun 2019 08:42: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 S1729930AbfFGP0S (ORCPT + 99 others); Fri, 7 Jun 2019 11:26:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:52882 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729878AbfFGP0R (ORCPT ); Fri, 7 Jun 2019 11:26:17 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x57FIt85005515 for ; Fri, 7 Jun 2019 11:26:16 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2syst4td2g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 07 Jun 2019 11:26:15 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Jun 2019 16:26:11 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 7 Jun 2019 16:26:09 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x57FQ89940304766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Jun 2019 15:26:08 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B397A4062; Fri, 7 Jun 2019 15:26:08 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 066E1A405B; Fri, 7 Jun 2019 15:26:07 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.81.48]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 7 Jun 2019 15:26:06 +0000 (GMT) Subject: Re: [PATCH v3 2/2] ima: add enforce-evm and log-evm modes to strictly check EVM status From: Mimi Zohar To: Roberto Sassu , dmitry.kasatkin@huawei.com, mjg59@google.com Cc: linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com Date: Fri, 07 Jun 2019 11:25:56 -0400 In-Reply-To: <773c3301-7861-f28b-813a-1f2ff657bae8@huawei.com> References: <20190606112620.26488-1-roberto.sassu@huawei.com> <20190606112620.26488-3-roberto.sassu@huawei.com> <1559917462.4278.253.camel@linux.ibm.com> <93459fe8-f9b6-fe45-1ca7-2efb8854dc8b@huawei.com> <1559920112.4278.264.camel@linux.ibm.com> <773c3301-7861-f28b-813a-1f2ff657bae8@huawei.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19060715-0020-0000-0000-000003481BC5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19060715-0021-0000-0000-0000219B3678 Message-Id: <1559921156.4278.276.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-07_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906070107 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-06-07 at 17:14 +0200, Roberto Sassu wrote: > On 6/7/2019 5:08 PM, Mimi Zohar wrote: > > On Fri, 2019-06-07 at 16:40 +0200, Roberto Sassu wrote: > >>> On Thu, 2019-06-06 at 13:26 +0200, Roberto Sassu wrote: > > > >>>> Although this choice appears legitimate, it might not be suitable for > >>>> hardened systems, where the administrator expects that access is denied if > >>>> there is any error. An attacker could intentionally delete the EVM keys > >>>> from the system and set the file digest in security.ima to the actual file > >>>> digest so that the final appraisal status is INTEGRITY_PASS. > >>> > >>> Assuming that the EVM HMAC key is stored in the initramfs, not on some > >>> other file system, and the initramfs is signed, INTEGRITY_UNKNOWN > >>> would be limited to the rootfs filesystem. > >> > >> There is another issue. The HMAC key, like the public keys, should be > >> loaded when appraisal is disabled. This means that we have to create a > >> trusted key at early boot and defer the unsealing. > > > > There is no need for IMA to appraise the public key file signature, > > since the certificate is signed by a key on the builtin/secondary > > trusted keyring.  With CONFIG_IMA_LOAD_X509 enabled, the public key > > can be loaded onto the IMA keyring with IMA-appraisal enabled, but > > without verifying the file signature. > > Yes, but access to the files containing the master key and the EVM key > is denied if appraisal is enabled. This is a key loading ordering issue.  Assuming you load the IMA key first, you should be able to verify the master and EVM keys. Mimi