From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 325CA21A16ED8 for ; Thu, 18 May 2017 16:17:23 -0700 (PDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4IN8quj008906 for ; Thu, 18 May 2017 19:17:22 -0400 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ahjca6a02-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 18 May 2017 19:17:22 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 May 2017 09:17:19 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4INH97M1114538 for ; Fri, 19 May 2017 09:17:17 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v4INGbrD017950 for ; Fri, 19 May 2017 09:16:38 +1000 Subject: Re: [PATCH 16/23] ima/policy: switch to use uuid_t From: Mimi Zohar Date: Thu, 18 May 2017 19:16:14 -0400 In-Reply-To: <20170518062705.25902-17-hch@lst.de> References: <20170518062705.25902-1-hch@lst.de> <20170518062705.25902-17-hch@lst.de> Mime-Version: 1.0 Message-Id: <1495149374.3404.3.camel@linux.vnet.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Christoph Hellwig , Andy Shevchenko , Amir Goldstein , linux-fsdevel@vger.kernel.org Cc: linux-xfs@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, David Howells , Shaohua Li , Steven Whitehouse List-ID: On Thu, 2017-05-18 at 08:26 +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Thanks! Acked-by: Mimi Zohar > --- > security/integrity/ima/ima_policy.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c > index 49fbc3e8f012..da3e7d50e0d7 100644 > --- a/security/integrity/ima/ima_policy.c > +++ b/security/integrity/ima/ima_policy.c > @@ -61,7 +61,7 @@ struct ima_rule_entry { > enum ima_hooks func; > int mask; > unsigned long fsmagic; > - u8 fsuuid[16]; > + uuid_t fsuuid; > kuid_t uid; > kuid_t fowner; > bool (*uid_op)(kuid_t, kuid_t); /* Handlers for operators */ > @@ -244,7 +244,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, > && rule->fsmagic != inode->i_sb->s_magic) > return false; > if ((rule->flags & IMA_FSUUID) && > - memcmp(rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) > + memcmp(&rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) > return false; > if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid)) > return false; > @@ -711,13 +711,12 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) > case Opt_fsuuid: > ima_log_string(ab, "fsuuid", args[0].from); > > - if (memchr_inv(entry->fsuuid, 0x00, > - sizeof(entry->fsuuid))) { > + if (uuid_is_null(&entry->fsuuid)) { > result = -EINVAL; > break; > } > > - result = uuid_to_bin(args[0].from, (uuid_t *)&entry->fsuuid); > + result = uuid_to_bin(args[0].from, &entry->fsuuid); > if (!result) > entry->flags |= IMA_FSUUID; > break; > @@ -1086,7 +1085,7 @@ int ima_policy_show(struct seq_file *m, void *v) > } > > if (entry->flags & IMA_FSUUID) { > - seq_printf(m, "fsuuid=%pU", entry->fsuuid); > + seq_printf(m, "fsuuid=%pU", &entry->fsuuid); > seq_puts(m, " "); > } > _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mimi Zohar Subject: Re: [PATCH 16/23] ima/policy: switch to use uuid_t Date: Thu, 18 May 2017 19:16:14 -0400 Message-ID: <1495149374.3404.3.camel@linux.vnet.ibm.com> References: <20170518062705.25902-1-hch@lst.de> <20170518062705.25902-17-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170518062705.25902-17-hch-jcswGhMUV9g@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: Christoph Hellwig , Andy Shevchenko , Amir Goldstein , linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-raid-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells , Shaohua Li , Steven Whitehouse List-Id: linux-raid.ids On Thu, 2017-05-18 at 08:26 +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Thanks! Acked-by: Mimi Zohar > --- > security/integrity/ima/ima_policy.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c > index 49fbc3e8f012..da3e7d50e0d7 100644 > --- a/security/integrity/ima/ima_policy.c > +++ b/security/integrity/ima/ima_policy.c > @@ -61,7 +61,7 @@ struct ima_rule_entry { > enum ima_hooks func; > int mask; > unsigned long fsmagic; > - u8 fsuuid[16]; > + uuid_t fsuuid; > kuid_t uid; > kuid_t fowner; > bool (*uid_op)(kuid_t, kuid_t); /* Handlers for operators */ > @@ -244,7 +244,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, > && rule->fsmagic != inode->i_sb->s_magic) > return false; > if ((rule->flags & IMA_FSUUID) && > - memcmp(rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) > + memcmp(&rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) > return false; > if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid)) > return false; > @@ -711,13 +711,12 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) > case Opt_fsuuid: > ima_log_string(ab, "fsuuid", args[0].from); > > - if (memchr_inv(entry->fsuuid, 0x00, > - sizeof(entry->fsuuid))) { > + if (uuid_is_null(&entry->fsuuid)) { > result = -EINVAL; > break; > } > > - result = uuid_to_bin(args[0].from, (uuid_t *)&entry->fsuuid); > + result = uuid_to_bin(args[0].from, &entry->fsuuid); > if (!result) > entry->flags |= IMA_FSUUID; > break; > @@ -1086,7 +1085,7 @@ int ima_policy_show(struct seq_file *m, void *v) > } > > if (entry->flags & IMA_FSUUID) { > - seq_printf(m, "fsuuid=%pU", entry->fsuuid); > + seq_printf(m, "fsuuid=%pU", &entry->fsuuid); > seq_puts(m, " "); > } > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37872 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755375AbdERXRY (ORCPT ); Thu, 18 May 2017 19:17:24 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4IN8qCT008967 for ; Thu, 18 May 2017 19:17:24 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ahjca6a0y-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 18 May 2017 19:17:23 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 May 2017 09:17:20 +1000 Subject: Re: [PATCH 16/23] ima/policy: switch to use uuid_t From: Mimi Zohar Date: Thu, 18 May 2017 19:16:14 -0400 In-Reply-To: <20170518062705.25902-17-hch@lst.de> References: <20170518062705.25902-1-hch@lst.de> <20170518062705.25902-17-hch@lst.de> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Message-Id: <1495149374.3404.3.camel@linux.vnet.ibm.com> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Christoph Hellwig , Andy Shevchenko , Amir Goldstein , linux-fsdevel@vger.kernel.org Cc: Shaohua Li , Dan Williams , David Howells , Steven Whitehouse , linux-xfs@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org On Thu, 2017-05-18 at 08:26 +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Thanks! Acked-by: Mimi Zohar > --- > security/integrity/ima/ima_policy.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c > index 49fbc3e8f012..da3e7d50e0d7 100644 > --- a/security/integrity/ima/ima_policy.c > +++ b/security/integrity/ima/ima_policy.c > @@ -61,7 +61,7 @@ struct ima_rule_entry { > enum ima_hooks func; > int mask; > unsigned long fsmagic; > - u8 fsuuid[16]; > + uuid_t fsuuid; > kuid_t uid; > kuid_t fowner; > bool (*uid_op)(kuid_t, kuid_t); /* Handlers for operators */ > @@ -244,7 +244,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, > && rule->fsmagic != inode->i_sb->s_magic) > return false; > if ((rule->flags & IMA_FSUUID) && > - memcmp(rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) > + memcmp(&rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) > return false; > if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid)) > return false; > @@ -711,13 +711,12 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) > case Opt_fsuuid: > ima_log_string(ab, "fsuuid", args[0].from); > > - if (memchr_inv(entry->fsuuid, 0x00, > - sizeof(entry->fsuuid))) { > + if (uuid_is_null(&entry->fsuuid)) { > result = -EINVAL; > break; > } > > - result = uuid_to_bin(args[0].from, (uuid_t *)&entry->fsuuid); > + result = uuid_to_bin(args[0].from, &entry->fsuuid); > if (!result) > entry->flags |= IMA_FSUUID; > break; > @@ -1086,7 +1085,7 @@ int ima_policy_show(struct seq_file *m, void *v) > } > > if (entry->flags & IMA_FSUUID) { > - seq_printf(m, "fsuuid=%pU", entry->fsuuid); > + seq_printf(m, "fsuuid=%pU", &entry->fsuuid); > seq_puts(m, " "); > } > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932626AbdERXR1 (ORCPT ); Thu, 18 May 2017 19:17:27 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46196 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755243AbdERXRY (ORCPT ); Thu, 18 May 2017 19:17:24 -0400 Subject: Re: [PATCH 16/23] ima/policy: switch to use uuid_t From: Mimi Zohar To: Christoph Hellwig , Andy Shevchenko , Amir Goldstein , linux-fsdevel@vger.kernel.org Cc: Shaohua Li , Dan Williams , David Howells , Steven Whitehouse , linux-xfs@vger.kernel.org, linux-raid@vger.kernel.org, linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org Date: Thu, 18 May 2017 19:16:14 -0400 In-Reply-To: <20170518062705.25902-17-hch@lst.de> References: <20170518062705.25902-1-hch@lst.de> <20170518062705.25902-17-hch@lst.de> 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-MML: disable x-cbid: 17051823-0040-0000-0000-00000319CA20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051823-0041-0000-0000-00000C92796E Message-Id: <1495149374.3404.3.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-18_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705180159 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-05-18 at 08:26 +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig Thanks! Acked-by: Mimi Zohar > --- > security/integrity/ima/ima_policy.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c > index 49fbc3e8f012..da3e7d50e0d7 100644 > --- a/security/integrity/ima/ima_policy.c > +++ b/security/integrity/ima/ima_policy.c > @@ -61,7 +61,7 @@ struct ima_rule_entry { > enum ima_hooks func; > int mask; > unsigned long fsmagic; > - u8 fsuuid[16]; > + uuid_t fsuuid; > kuid_t uid; > kuid_t fowner; > bool (*uid_op)(kuid_t, kuid_t); /* Handlers for operators */ > @@ -244,7 +244,7 @@ static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, > && rule->fsmagic != inode->i_sb->s_magic) > return false; > if ((rule->flags & IMA_FSUUID) && > - memcmp(rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) > + memcmp(&rule->fsuuid, inode->i_sb->s_uuid, sizeof(rule->fsuuid))) > return false; > if ((rule->flags & IMA_UID) && !rule->uid_op(cred->uid, rule->uid)) > return false; > @@ -711,13 +711,12 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry) > case Opt_fsuuid: > ima_log_string(ab, "fsuuid", args[0].from); > > - if (memchr_inv(entry->fsuuid, 0x00, > - sizeof(entry->fsuuid))) { > + if (uuid_is_null(&entry->fsuuid)) { > result = -EINVAL; > break; > } > > - result = uuid_to_bin(args[0].from, (uuid_t *)&entry->fsuuid); > + result = uuid_to_bin(args[0].from, &entry->fsuuid); > if (!result) > entry->flags |= IMA_FSUUID; > break; > @@ -1086,7 +1085,7 @@ int ima_policy_show(struct seq_file *m, void *v) > } > > if (entry->flags & IMA_FSUUID) { > - seq_printf(m, "fsuuid=%pU", entry->fsuuid); > + seq_printf(m, "fsuuid=%pU", &entry->fsuuid); > seq_puts(m, " "); > } >