Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp190951ybm; Mon, 20 May 2019 14:23:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvBVHxJFFLnZFPaGthOveQHSTEKhOj+nGbOIYv7GpHvRB5zex/eIljvV0Qkolp8BKikRni X-Received: by 2002:a17:902:9a84:: with SMTP id w4mr16868484plp.241.1558387426395; Mon, 20 May 2019 14:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558387426; cv=none; d=google.com; s=arc-20160816; b=L7jTBYoHqVnjUfjoH/EPkruVMLmv3+yee+Az5HanoKhxUJ960AaVV44Qh0JnfbXyeC Q0uJG7cL6eTFnktmnsPaG3l0NBA9vkYPeZCWza2IElD/38g/6jh+TdCWUQQ4y5powmli pw6klwAiopwbKRFbBEzsqP8/O907YyWchzVnr136XExWMMhebhDsw5BU178FQWjoQ8qE ZDHAa8BqfZIZMsbjR92zpwXoE2ZAK32SZN8PV8e93ydimr3m3sPRe4AM15N+XJoh50O1 LQTHOqi/59BatlNnpKrmUC+AAx90aJn9afffc4hYvkaHKDauzM2HhN236jAW9uqr4H+s LJuA== 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=egts39MI5tanP48/6zyExLMbrbBCf2Dnj7NnaoiG1bs=; b=H8Y09eakThrHIhAqg9wScxZYGMMzc8fllaVSvJYUrcQ4UBz8mxw3j9oTvVE/gQns/g mny9L/8Y1ozgS2P848TJI12A4IyoB9eVzZe1qr0QNO4mSwEXHPdH9I8CkQgg3lGDPa6/ acgvD91fPAB6pVs57UGXrt/7ZviGHjxOQ9CjYoiOO9xSEsXtRQYt8DQiLfMKTiKMApfE IqOBbIj3w2pEvpC0QsfQEHCXCt+Y4Uw3h+SVqeshEaAWbbXKx3sLRihGHJpZqNvJ+NUm XDARxSplN+n5y9yKiMEqFupzroTch6X78ech4oedgWGiGEvjQnJ4jCcsPLNI7j8ObHof 3fxQ== 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 y10si18788323plk.330.2019.05.20.14.23.31; Mon, 20 May 2019 14:23:46 -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 S1727183AbfETVUq (ORCPT + 99 others); Mon, 20 May 2019 17:20:46 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37292 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726879AbfETVUo (ORCPT ); Mon, 20 May 2019 17:20:44 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4KL32wR152245 for ; Mon, 20 May 2019 17:20:43 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2sm0tvf13k-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 20 May 2019 17:20:42 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 May 2019 22:20:40 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) 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) Mon, 20 May 2019 22:20:38 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4KLKbil60686518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 May 2019 21:20:37 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24E49AE051; Mon, 20 May 2019 21:20:37 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE5F9AE04D; Mon, 20 May 2019 21:20:35 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.80.109]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 20 May 2019 21:20:35 +0000 (GMT) Subject: Re: [PATCH 4/4] ima: only audit failed appraisal verifications From: Mimi Zohar To: Roberto Sassu , dmitry.kasatkin@huawei.com, mjg59@google.com Cc: linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com, stable@vger.kernel.org Date: Mon, 20 May 2019 17:20:25 -0400 In-Reply-To: <20190516161257.6640-4-roberto.sassu@huawei.com> References: <20190516161257.6640-1-roberto.sassu@huawei.com> <20190516161257.6640-4-roberto.sassu@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: 19052021-0020-0000-0000-0000033EB794 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19052021-0021-0000-0000-00002191919C Message-Id: <1558387225.4039.78.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-20_08:,, 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-1905200132 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-05-16 at 18:12 +0200, Roberto Sassu wrote: > This patch ensures that integrity_audit_msg() is called only when the > status is not INTEGRITY_PASS. > > Fixes: 8606404fa555c ("ima: digital signature verification support") > Signed-off-by: Roberto Sassu > Cc: stable@vger.kernel.org > --- > security/integrity/ima/ima_appraise.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c > index a32ed5d7afd1..f5f4506bcb8e 100644 > --- a/security/integrity/ima/ima_appraise.c > +++ b/security/integrity/ima/ima_appraise.c > @@ -359,8 +359,9 @@ int ima_appraise_measurement(enum ima_hooks func, > status = INTEGRITY_PASS; > } > > - integrity_audit_msg(AUDIT_INTEGRITY_DATA, inode, filename, > - op, cause, rc, 0); > + if (status != INTEGRITY_PASS) > + integrity_audit_msg(AUDIT_INTEGRITY_DATA, inode, > + filename, op, cause, rc, 0); For some reason, the integrity verification has failed.  In some specific cases, we'll let it pass, but do we really want to remove any indication that it failed in all cases? Mimi > } else { > ima_cache_flags(iint, func); > }