Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp637390ybm; Tue, 21 May 2019 00:33:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXVgVoOoz3kMzDoaqhhfqy0btfHhNejDIBzmLIokUbKAX0oYaXE5XlxMS5ScwOMXcYHZ7f X-Received: by 2002:a17:902:9343:: with SMTP id g3mr80304366plp.260.1558424028189; Tue, 21 May 2019 00:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558424028; cv=none; d=google.com; s=arc-20160816; b=qMp9QTUnbBdOBsEaKWeUfhNwxiak0XjQ4F0/zI7f2FC35wjtmmDgcF7rF4gG+E31K5 sJXzoX0tWmvqGJ/3Vj3jwgBenrLvEaHQ5YYkTHuU7UvggMgE90ruJK34K8njiLiZ1m+j II1X/ZthWN5yPKnWwmDfv+YaPvwboozE5ZoWABx8Rb4ePSHSwMdw6ADJC3gKAa0mFrDZ XwLDV7F2rKrdjEWKH130Xl8v1vpD4+5kfnX7ZMWJQNlaUBbPjzN6dJG2htlWl5xj1CSU ZgoJ3PasV0TeuQIpXdKqxxbIA/XWb7LICblXbDygQqHtAvLdE3GocYimxqs/e2f0bAba a5zw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=2hPUB02zajL89Bgj7UQDLcd22znzDDYfVTCpwVHfyt8=; b=FonaW7+UxMI2nPIesfSiBsUC+0eJN82xIUT7WLPMDC0TLaBmuNKXLe/WSC8c89W/Vu NLkc9C63N3ppciC44bHXwAR7JQ8ygVIeeDIEbUhYnEdR6A8KxeUbYnX0FFMfUPZKb3mg NBK8hDVpCw9YEyZvFl2rM5XereBzdhdOKKK6rSKehU3c3YGitfks13v7zG5MH87mEC/p a8ZUln6t9DgZWMLlVfNe+iwiJ+bdIHgDGWYA9FEhx924ui04Y3Ej6l0l92Z/ywCrpbSQ 1T/w6vjnxxhrvJzk/pUAJn5G7Qnr2AGwpMi7R5VxXI7xKwGJ3TS1AULkPXyhBoXXnKpj u7ig== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si19865482pgb.30.2019.05.21.00.33.32; Tue, 21 May 2019 00:33:48 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726391AbfEUHc3 (ORCPT + 99 others); Tue, 21 May 2019 03:32:29 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:32960 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725790AbfEUHc2 (ORCPT ); Tue, 21 May 2019 03:32:28 -0400 Received: from LHREML714-CAH.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 5A34E89645266B1E4F09; Tue, 21 May 2019 08:32:27 +0100 (IST) Received: from [10.220.96.108] (10.220.96.108) by smtpsuk.huawei.com (10.201.108.37) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 21 May 2019 08:32:19 +0100 Subject: Re: [PATCH 4/4] ima: only audit failed appraisal verifications To: Mimi Zohar , , CC: , , , , , References: <20190516161257.6640-1-roberto.sassu@huawei.com> <20190516161257.6640-4-roberto.sassu@huawei.com> <1558387225.4039.78.camel@linux.ibm.com> From: Roberto Sassu Message-ID: <4280cbe7-6596-1827-4358-fb45d7c13f25@huawei.com> Date: Tue, 21 May 2019 09:32:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1558387225.4039.78.camel@linux.ibm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.220.96.108] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/20/2019 11:20 PM, Mimi Zohar wrote: > 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? Ok. It is fine for me to discard the patch. Roberto -- HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Bo PENG, Jian LI, Yanli SHI