Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3321306pxv; Mon, 28 Jun 2021 01:48:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyirPpwfR0qeWy01lzDKKGrpj/QHqFPYMQ5louo5+cOGHTSENLLZVn9qGdWhYjpBOopgpy5 X-Received: by 2002:a5e:aa07:: with SMTP id s7mr4374921ioe.186.1624870138801; Mon, 28 Jun 2021 01:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624870138; cv=none; d=google.com; s=arc-20160816; b=L727pevW+RvezlSg/v3CUMzjGIq9Y+NxvaNXK36gYbkuVgHXqwgVY69mb1G4yKuQQm g3bvLBzTEKPwogn2IpKgh7j2zdKls/uegSJhiV/BWdjkV1dIFI86sIs5HAUesLnPS9Qs 259vd4PffLt462jujyfjeRorp3Ph8bgj3Ec5cNzCmkklpbKzhjBDGryzmLg/8X8QBPHx f0BcQF6V+XyoLXQusQlcnNA1Br0zwn78p/S+5+3xe1Y7snaO+aKzreyB6Q+oZOq9e471 3702wRE3dhQbs/kGGT84XPdVelvdAVE4v3z4vXLlPGrhiCxrEBhJ9oeBheDi4tAlbizd QPOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7X+oYCN7RPY8lXKzDz/9UXNfHGRRus0cqTZT4qeg3ZQ=; b=OHoOi40BmApZEZgWGYZVG0OSE/Xltx/ID7YH9ovSWBnUtoTrRnAEuZMXBUj/UbGpkB iMRTkiJ8BIUP7rhMhRq3XvR9Lp/gkqa20eiM4xx7C5pn5J0Rydsd/fIgPOQVGm7GQ5yB gEo4WiRnoFcna2PMw6pqk668Ie21goqeYLdfipwZ5Wx/4tBBg0bDZ4Cbow3WWOarsUO1 1U+2FIStnCvWNGy28xDMYzFAPy0Sn98iOLTLveK0UBSYq+vQKn9v8MMJUec5k6fg21+i 8K89p5SY+NigeJvCZPZw6jLamlQhtLyhxZIi/l/TNnTgIgaym/33Uad5V5RH6eJYXtWF MRtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xToNot36; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si16326499jao.68.2021.06.28.01.48.47; Mon, 28 Jun 2021 01:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xToNot36; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbhF1Itl (ORCPT + 99 others); Mon, 28 Jun 2021 04:49:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:34164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231683AbhF1Itk (ORCPT ); Mon, 28 Jun 2021 04:49:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 357A36108B; Mon, 28 Jun 2021 08:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624870035; bh=fwqDYD3WVqhCOOp5GXfpIJP5FpsuNHICvD28AiRGpmU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xToNot36Z0FTctWX4O4yKCtB4CNUuLiel82y2cNUAPBd6LtSAfAv7o+SOHFB/E0DP Cy134+nqFVHFGGmMopVowg+kj/577kRoRXbmzjqW6NFUbkkpZVUQAx4sz3xrNQIBgV jDuqrDTeuMcxiGKjE8dqmQ3Yp1DdTTB3+sqcMfxE= Date: Mon, 28 Jun 2021 10:47:13 +0200 From: Greg KH To: Roberto Sassu Cc: "zohar@linux.ibm.com" , "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC][PATCH 04/12] digest_lists: Objects Message-ID: References: <20210625165614.2284243-1-roberto.sassu@huawei.com> <20210625165614.2284243-5-roberto.sassu@huawei.com> <22fff08f1a70460da814d3f21b497f8b@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22fff08f1a70460da814d3f21b497f8b@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 28, 2021 at 08:14:41AM +0000, Roberto Sassu wrote: > > From: Greg KH [mailto:gregkh@linuxfoundation.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 > > > + * > > > + * 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