Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp106529ybt; Thu, 25 Jun 2020 16:35:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnExvHulXFNT0JfMKDxpmPnVuEhQNjQC66sOgDRnuSEg9Vbe++jl1fVdpycyLkWhqiSW9r X-Received: by 2002:aa7:c80c:: with SMTP id a12mr703781edt.140.1593128131971; Thu, 25 Jun 2020 16:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593128131; cv=none; d=google.com; s=arc-20160816; b=LwCmlg0+vrzeDvNWBbxfOBm6KZNXHyWLe/ZUwd55xGJo0C0ZL+3U60pKvMSvRZjGNJ m8AKZCO84MPtNph6pXEzHLXZG8ygQj9dahwcyZMOINhOjvLijcajfWv6Nw1uj8AKg8Nv nbpWWy9ybIcLn2WuOE3UGa5/24xrjqobjtNmsDNcTttSnj9rql9qoEhl+m9o0j5bO7+e jSJ+1ST4irAHUM1OLjDKtp02OIkC1rWDc/HnggmhNTSgg9vZ6BVDs/z0cuNdUiF1ce9W /P3gwguBOD7B8AN3gGz12lPCR0ZoTYT63cbO2q6gAZfmlIZObQbNS/mNAHaq39OsSUyF ErrA== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=+zbzyqmwNW+MZGSVnK2gerVf4nxIlvMuZCqpG8SzIGY=; b=DIhmCx9nzNp15AtUN8cCtwx1Otpt5vFCKfeTGyq1JQNcUBPoB7nhF6MYJPWDaijahY 3zNwIytsKq1FYZ4vKVYAiDv8TmP9sOLVtrPrWfnpflSODfplS60vQdFjYdli2bKhOD6p FKBy3zpa7L3FjoDqXS86CtWafDpeuZp1tWX9WmISM1DiM2gJmYHh19Uwk/7Q8E0K1SeT JZ2Z5Gn1eViihrAaUQhTc1f0IdUzNaNf1edlwWvBBOPut01YtjnmirjF0IPlhaZSHBwm KjN72Jr7u573woSsA9ebMf7E/WR4yLS4bRUrukssI837zC8BqKR11joZWnzvXXJepPVy 8efA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id m6si432849eda.275.2020.06.25.16.35.06; Thu, 25 Jun 2020 16:35:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2404924AbgFYUqM (ORCPT + 99 others); Thu, 25 Jun 2020 16:46:12 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:31132 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404043AbgFYUqM (ORCPT ); Thu, 25 Jun 2020 16:46:12 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05PKW7w8021271; Thu, 25 Jun 2020 16:46:08 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 31vts11wct-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jun 2020 16:46:07 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 05PKWT0V022398; Thu, 25 Jun 2020 16:46:07 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 31vts11wc1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jun 2020 16:46:07 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05PKe74e025831; Thu, 25 Jun 2020 20:46:05 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma02fra.de.ibm.com with ESMTP id 31uusk12ee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jun 2020 20:46:04 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05PKk2j936110568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Jun 2020 20:46:02 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E509A4060; Thu, 25 Jun 2020 20:46:02 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5848DA405B; Thu, 25 Jun 2020 20:46:01 +0000 (GMT) Received: from localhost.localdomain (unknown [9.85.142.225]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 25 Jun 2020 20:46:01 +0000 (GMT) Message-ID: <1593117960.27152.387.camel@linux.ibm.com> Subject: Re: [PATCH 10/12] ima: Move validation of the keyrings conditional into ima_validate_rule() From: Mimi Zohar To: Tyler Hicks , Dmitry Kasatkin Cc: James Morris , "Serge E . Hallyn" , Lakshmi Ramasubramanian , Prakhar Srivastava , linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Date: Thu, 25 Jun 2020 16:46:00 -0400 In-Reply-To: <20200625195017.GA4694@sequoia> References: <20200623003236.830149-1-tyhicks@linux.microsoft.com> <20200623003236.830149-11-tyhicks@linux.microsoft.com> <20200625195017.GA4694@sequoia> 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: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-25_16:2020-06-25,2020-06-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 cotscore=-2147483648 adultscore=0 mlxscore=0 malwarescore=0 clxscore=1015 phishscore=0 suspectscore=0 spamscore=0 impostorscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006250116 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c > > index 514baf24d6a5..ae2ec2a9cdb9 100644 > > --- a/security/integrity/ima/ima_policy.c > > +++ b/security/integrity/ima/ima_policy.c > > @@ -999,6 +999,12 @@ static bool ima_validate_rule(struct ima_rule_entry *entry) > > case KEXEC_KERNEL_CHECK: > > case KEXEC_INITRAMFS_CHECK: > > case POLICY_CHECK: > > + if (entry->flags & ~(IMA_FUNC | IMA_MASK | IMA_FSMAGIC | > > + IMA_UID | IMA_FOWNER | IMA_FSUUID | > > + IMA_INMASK | IMA_EUID | IMA_PCR | > > + IMA_FSNAME)) > > I accidentally left these out: > > (IMA_DIGSIG_REQUIRED | IMA_PERMIT_DIRECTIO | IMA_MODSIG_ALLOWED | IMA_CHECK_BLACKLIST) > > I'll add them in v2. Thanks, I noticed when skimming the patches the first time around. Mimi