[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNmMkUwaPj0Xgh2r@kroah.com>
Date: Mon, 28 Jun 2021 10:47:13 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Roberto Sassu <roberto.sassu@...wei.com>
Cc: "zohar@...ux.ibm.com" <zohar@...ux.ibm.com>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH 04/12] digest_lists: Objects
On Mon, Jun 28, 2021 at 08:14:41AM +0000, Roberto Sassu wrote:
> > From: Greg KH [mailto:gregkh@...uxfoundation.org]
> > Sent: Sunday, June 27, 2021 12:56 PM
> > On Fri, Jun 25, 2021 at 06:56:06PM +0200, Roberto Sassu wrote:
> > > +++ b/security/integrity/digest_lists/digest_lists.h
> > > @@ -0,0 +1,117 @@
> > > +/* SPDX-License-Identifier: GPL-2.0 */
> > > +/*
> > > + * Copyright (C) 2005,2006,2007,2008 IBM Corporation
> > > + * Copyright (C) 2017-2021 Huawei Technologies Duesseldorf GmbH
> > > + *
> > > + * Author: Roberto Sassu <roberto.sassu@...wei.com>
> > > + *
> > > + * This program is free software; you can redistribute it and/or
> > > + * modify it under the terms of the GNU General Public License as
> > > + * published by the Free Software Foundation, version 2 of the
> > > + * License.
> > > + *
> > > + * File: digest_lists.h
> > > + * Unexported definitions for digest lists.
> >
> > Unexported to whom?
>
> Hi Greg
>
> I meant not placed in include/linux.
That's obvious based on the location of the file :)
> > > +
> > > +static inline struct compact_list_hdr *get_hdr(
> > > + struct digest_list_item *digest_list,
> > > + loff_t hdr_offset)
> > > +{
> > > + return (struct compact_list_hdr *)(digest_list->buf + hdr_offset);
> > > +}
> >
> > pointer math feels rough, are you shure you want to do this this way?
>
> Maybe, I could change digest_list_item_ref to:
>
> struct digest_list_item_ref {
> struct digest_list_item *digest_list;
> u8 *digest;
> struct compact_list_hdr *hdr;
> };
>
> where digest and hdr are calculated in the same way.
That works better, no need to do pointer math if you do not have to.
thanks,
greg k-h
Powered by blists - more mailing lists