Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp817373ybi; Fri, 14 Jun 2019 03:58:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYAfVuxAY8rIj05TAISOQLg/GxVd3wsliHo7EVWiFZCS78lhsYPGeVtCFCpgGvNxYIcdGD X-Received: by 2002:a17:902:8d89:: with SMTP id v9mr70501625plo.99.1560509900879; Fri, 14 Jun 2019 03:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560509900; cv=none; d=google.com; s=arc-20160816; b=ma8UbO2lE4KyKo6HMx5UZMSJBd3gsxkfIIszfwNErKx/4B32ipYPoHOGhvC6JVbgyv KFEsLmdK2Rl+4gWYwEngegVrBTGEtRAK1n6ocw0sfHCX7+plOXh7FFnQpl5iZsdMwubu 7GwN46YDftepJ0u9Esbtr3x+RcL5xtka9kEO+qrkVqr0wIMROhuSYkVltRiYXY2GzTXl eg03A/CTUnYRf+TMd99GZ/izqKs/hYD2zpQ0idLICbhIPIkIWMN93O36mj6t/SkKE7pe cLlxBK4GEvOWMIx4UEuKBFiPFksrWxBmgj4tMVgqIEufb4/Uyqb/KRPce3nrkna3RZWN a01g== 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=wZnEfM2Ju+/U2oVMYBSCCK4oT7ypGk8gHr8tTpbaYPY=; b=Po15P57IAwtBfXH6DPLZpUq7+9YyNTA2v/jdqd6LhtPkyaqkK5p7p6nQQKN1V3jOD8 CXoP/e9ZswKABj/dI6mSjLuKH3q6iT/Abl3/ZGncAyZ5ksEbytTB3E/uy6gi9N9b470M NDkUSUm/WKi1UoJPsvGb4MlDrUVRUsxZk2B3CBq/t8USbiFG1eySsJ6bGgNVLj6HvfBO uToRxgdyY1GLFXNLRNDwG2kIPZc4ILs2JC+VNf4yjoDZzDyCxq30zHs8EV0cA3UmrrRQ mmKqxkifWKexAXAtnLgjfd31fGBym/txLZvDOZxt2MAHKc53a2xcYHgdKlrFcitqXkU5 nD+g== 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 l23si2329886pgb.333.2019.06.14.03.58.05; Fri, 14 Jun 2019 03:58:20 -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 S1727328AbfFNK6A (ORCPT + 99 others); Fri, 14 Jun 2019 06:58:00 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:47148 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727262AbfFNK6A (ORCPT ); Fri, 14 Jun 2019 06:58:00 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5EAvnPc143650 for ; Fri, 14 Jun 2019 06:57:59 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t4a9tr054-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 14 Jun 2019 06:57:58 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Jun 2019 11:57:56 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 14 Jun 2019 11:57:53 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5EAvq1P34210172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2019 10:57:52 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7753A4C04A; Fri, 14 Jun 2019 10:57:52 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8073A4C040; Fri, 14 Jun 2019 10:57:51 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.81.115]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 14 Jun 2019 10:57:51 +0000 (GMT) Subject: Re: [PATCH V8 2/3] Define a new ima template field buf From: Mimi Zohar To: Prakhar Srivastava , linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Cc: roberto.sassu@huawei.com, vgoyal@redhat.com Date: Fri, 14 Jun 2019 06:57:40 -0400 In-Reply-To: <1560455980.4805.57.camel@linux.ibm.com> References: <20190612221549.28399-1-prsriva02@gmail.com> <20190612221549.28399-3-prsriva02@gmail.com> <1560455980.4805.57.camel@linux.ibm.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: 19061410-0008-0000-0000-000002F3B999 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061410-0009-0000-0000-00002260C358 Message-Id: <1560509860.4171.13.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-14_05:,, 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-1906140091 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prakhar, > > diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c > > index ea7d8cbf712f..83ca99d65e4b 100644 > > --- a/security/integrity/ima/ima_api.c > > +++ b/security/integrity/ima/ima_api.c > > @@ -140,7 +140,7 @@ void ima_add_violation(struct file *file, const unsigned char *filename, > > struct ima_template_entry *entry; > > struct inode *inode = file_inode(file); > > struct ima_event_data event_data = {iint, file, filename, NULL, 0, > > - cause}; > > + cause, NULL, 0}; > > This change here and > > > int violation = 1; > > int result; > > > > @@ -296,7 +296,7 @@ void ima_store_measurement(struct integrity_iint_cache *iint, > > struct inode *inode = file_inode(file); > > struct ima_template_entry *entry; > > struct ima_event_data event_data = {iint, file, filename, xattr_value, > > - xattr_len, NULL}; > > + xattr_len, NULL, NULL, 0}; > > here and  > > > int violation = 0; > > > > if (iint->measured_pcrs & (0x1 << pcr)) > > diff --git a/security/integrity/ima/ima_init.c b/security/integrity/ima/ima_init.c > > index 993d0f1915ff..c8591406c0e2 100644 > > --- a/security/integrity/ima/ima_init.c > > +++ b/security/integrity/ima/ima_init.c > > @@ -50,7 +50,7 @@ static int __init ima_add_boot_aggregate(void) > > struct ima_template_entry *entry; > > struct integrity_iint_cache tmp_iint, *iint = &tmp_iint; > > struct ima_event_data event_data = {iint, NULL, boot_aggregate_name, > > - NULL, 0, NULL}; > > + NULL, 0, NULL, NULL, 0}; > > here, don't belong in this patch.  It belongs in "IMA: support for per > policy rule template formats", in case it should ever be backported. >  Please post this as a separate patch, that will be squashed with > "IMA: support for per policy rule template formats". Might mistake.  I should have picked up Thaigo's "ima: Use designated initializers for struct ima_event_data".  Please drop these changes instead. thanks, Mimi > > > int result = -ENOMEM; > > int violation = 0; > > struct { >