Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp376890imm; Fri, 21 Sep 2018 01:35:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZTpNdGBlFHHp/CNVSAB8hUhoKGHO0KYB/Qo+3RVYf0REj8iPNNk428vrpDY3OEAy23D8LS X-Received: by 2002:a63:5c10:: with SMTP id q16-v6mr40139110pgb.452.1537518908709; Fri, 21 Sep 2018 01:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537518908; cv=none; d=google.com; s=arc-20160816; b=g28hMxlr9phQKt+k3KIY6vMVgq6C9PxRPuXrpFSmkivA8X2D4A/34t7S61jxqE6i1S f2WfPe/hEWFILWZSILYilowtVD4ca4vxh6JiuukOhUK8baD3inNTV32gOrdj2c1XwsWC l8o2yS+SRUx7L5bqHkeo7TRI6HHhKG82PPsV0/wi9ImFrsk65O4zl33ki8l5X/vhvUjM Xo78kl6aHEhYz9+Eq+6vYsYldkVjSDvGnWksP2R2g7eCyI/qBOjI7Ch/D1HbemapueqR 39VKNsspowHwHk7tJqBEp5xuUgKU/rfHPdfhUEuM4sQIHnsW0qhrHlFBbHu9L33swO07 G4jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=zmrGPCPiNjpNGLoUoBk+ZUi59gef//h9vvbVWTlxW8A=; b=mBKO4gwVhLmVedI+iue/Yoxwip69a/ooBMEf10l8AD1a0u/29SnzjYXVTRid6FNb+W J+/aKYBWepSjVqTXuSCvaLsAP/nlx9lHHwZ2rKOe5mX22cpWGh8pvhKK/ZcFyqqkG8hY +djTh/PucHz/CqG/594R2D/4hBGFQT1rmOcUNYJ//CwdhJq6T/X2kXtnCK+4j/IXLM7O M0mQl07Xq7NqbG6qYy6kDy3jkpOSVWVIoYw1WIkewNNBXWN/y/eeIYMnJYHIz3COexDh lBiFwlM6Axc/qjUF9qa2OA9xG1CTa80BGu+A6pbL68Th8LmofgAQtpEGNxUhkfAaBNr0 Y7WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=GsPmPR31; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y28-v6si362518pge.487.2018.09.21.01.34.51; Fri, 21 Sep 2018 01:35:08 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=GsPmPR31; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389298AbeIUOWd (ORCPT + 99 others); Fri, 21 Sep 2018 10:22:33 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:51566 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbeIUOWd (ORCPT ); Fri, 21 Sep 2018 10:22:33 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8L8Y9lH176458; Fri, 21 Sep 2018 08:34:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=zmrGPCPiNjpNGLoUoBk+ZUi59gef//h9vvbVWTlxW8A=; b=GsPmPR31lQ53pWqg8XcRs6y9Opk4pyIUGcZmQAo+wFiXFDXOfJF9Bgd/LrgSoR9N8Xsg 1k0Nk1RpKvF2K5XUzu/3AG2I6DvGweCs2MqXCeVIEAMrJIcFtKsFKzSIrJGRqEb7Dxfw yG+HxUGmDnLisceUefi7sE+rn4BeMogmzaf/3iUC30bWyP6uJ3I5WELrMzS3kh6//TPt thkLMhYxA66FuJ9m4Gz0tbEC+3VwbWZKWn3BGE0oA78Lks4gjrCKWDbS8hGpYZ8paEUl pl89gcjE2dSzeYVKehkbAyqfrud2U0qOff3oS+TsXROUbZVIepDl8PO5DE+bM2q9Oawu 6g== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2mmkm21s5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Sep 2018 08:34:39 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8L8YcmG010622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Sep 2018 08:34:38 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w8L8YbfM022802; Fri, 21 Sep 2018 08:34:38 GMT Received: from mwanda (/197.232.248.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 21 Sep 2018 01:34:37 -0700 Date: Fri, 21 Sep 2018 11:34:29 +0300 From: Dan Carpenter To: kbuild@01.org, Nayna Jain Cc: kbuild-all@01.org, linux-integrity@vger.kernel.org, zohar@linux.ibm.com, linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, jforbes@redhat.com, Nayna Jain Subject: Re: [PATCH v3 3/6] ima: refactor ima_init_policy() Message-ID: <20180921083429.c7sikis5bzxdifny@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180919075522.7684-4-nayna@linux.vnet.ibm.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9022 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809210090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nayna, Thank you for the patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Nayna-Jain/Add-support-for-architecture-specific-IMA-policies/20180920-035110 smatch warnings: security/integrity/ima/ima_policy.c:489 add_rules() warn: should this be a bitwise op? # https://github.com/0day-ci/linux/commit/84a2e186f940ebc6c34e6d276e55f665167a5bb8 git remote add linux-review https://github.com/0day-ci/linux git remote update linux-review git checkout 84a2e186f940ebc6c34e6d276e55f665167a5bb8 vim +489 security/integrity/ima/ima_policy.c 6f0911a6 Mimi Zohar 2018-04-12 477 84a2e186 Nayna Jain 2018-09-19 478 static void add_rules(struct ima_rule_entry *entries, int count, 84a2e186 Nayna Jain 2018-09-19 479 enum policy_rule_list file) 84a2e186 Nayna Jain 2018-09-19 480 { 84a2e186 Nayna Jain 2018-09-19 481 int i = 0; 84a2e186 Nayna Jain 2018-09-19 482 84a2e186 Nayna Jain 2018-09-19 483 for (i = 0; i < count; i++) { 84a2e186 Nayna Jain 2018-09-19 484 struct ima_rule_entry *entry; 84a2e186 Nayna Jain 2018-09-19 485 84a2e186 Nayna Jain 2018-09-19 486 if (file && IMA_DEFAULT_POLICY) ^^^^^^^^^^^^^^^^^^^^^^^^^^ 84a2e186 Nayna Jain 2018-09-19 487 list_add_tail(&entries[i].list, &ima_default_rules); 84a2e186 Nayna Jain 2018-09-19 488 84a2e186 Nayna Jain 2018-09-19 @489 if (file && IMA_CUSTOM_POLICY) { ^^^^^^^^^^^^^^^^^^^^^^^^^ It does look like it should be "if (file & IMA_CUSTOM_POLICY) {" but I haven't looked at the context besides what's here in this email. 84a2e186 Nayna Jain 2018-09-19 490 entry = kmemdup(&entries[i], sizeof(*entry), 84a2e186 Nayna Jain 2018-09-19 491 GFP_KERNEL); 84a2e186 Nayna Jain 2018-09-19 492 if (!entry) 84a2e186 Nayna Jain 2018-09-19 493 continue; 84a2e186 Nayna Jain 2018-09-19 494 84a2e186 Nayna Jain 2018-09-19 495 INIT_LIST_HEAD(&entry->list); 84a2e186 Nayna Jain 2018-09-19 496 list_add_tail(&entry->list, &ima_policy_rules); 84a2e186 Nayna Jain 2018-09-19 497 } 84a2e186 Nayna Jain 2018-09-19 498 if (entries[i].action == APPRAISE) 84a2e186 Nayna Jain 2018-09-19 499 temp_ima_appraise |= ima_appraise_flag(entries[i].func); 84a2e186 Nayna Jain 2018-09-19 500 if (entries[i].func == POLICY_CHECK) 84a2e186 Nayna Jain 2018-09-19 501 temp_ima_appraise |= IMA_APPRAISE_POLICY; 84a2e186 Nayna Jain 2018-09-19 502 } 84a2e186 Nayna Jain 2018-09-19 503 } 84a2e186 Nayna Jain 2018-09-19 504 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation