Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2623279pxv; Sun, 27 Jun 2021 03:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya5emdGsDxH2MliLNJ6+eY6GGG0HHTMpbWBplnRO4JTnrJ0FfttdAntcrQR1utKC9BbkCs X-Received: by 2002:a02:b393:: with SMTP id p19mr1780247jan.69.1624791276843; Sun, 27 Jun 2021 03:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624791276; cv=none; d=google.com; s=arc-20160816; b=aawcntTMwNfvAJaYpevRDprUejAVRkBWy41vK2oG92EbVbz7PC1JRpXXQDikQB6k84 cq5DkAhUBFOUHcpRL47USrPEYCk/wopvaMZSYbVvV0C8S69MdDc3UHaP+l8UwjRCUZeb eC76UGcNj47BZtgeTTCRvZABVIcwt5bZNE8K1wmL9qf6VkG0jKRDU6SpZq6G9mMyFJmW l5cJAOT17MncJ18K+3MPHnUmudepKk6o9CkCGnP/9MYGzlu8Q2XwzCppheslDaKYlcgM NA2ln46PNL2VCpLo3v+CLz57iP7wZyP7sAtVGnFGalrUyy4dtBgwugjM+mS1IQwWBZgH TRoA== 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=24qDoTs6LHWvLZHcKRe/YoRCckJG839ROqVDfcCRcMk=; b=QYDGUZBbKt2gJ/BDSaFSVHjx1GrpzW/LxyQHPw8BwaGYCGQXkuD7abFKCDo2U3j/Nw xvajHfin1SzkTHVKtxPfkNCtts4clXEWtBBGvSgC0ArGv7DP/wxBygaHC2bYZZyBydK/ 08uj9LSL3f9vuBnJZmbqdG2ECbySqU0IwVMyFRP7rsOcR6RxcKlDdLhgHazMAy9YufRY /mQVjZ0S6tUMdbBbiL212j4MTAQ3yjD9gKLiZtnnWAFDo2A292rdbaI5R8Omw2/cjMT0 G2W9bLlqOt5QfaDm5FpDRcq2L3nJqIYuRgQGSsxTAXL4vFW/37PrPlYndXjnS6S/7vFl XngQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JRUXKeio; 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 w8si16473716ilu.43.2021.06.27.03.54.24; Sun, 27 Jun 2021 03:54:36 -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=JRUXKeio; 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 S230206AbhF0K4O (ORCPT + 99 others); Sun, 27 Jun 2021 06:56:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:53394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhF0K4O (ORCPT ); Sun, 27 Jun 2021 06:56:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0698F619CD; Sun, 27 Jun 2021 10:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624791229; bh=+34VPgiMBz1koI+NKofcB6T7PqC9IC9eLfw6ueg4J6c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JRUXKeioHl34Q+YdKZwYw/6xzHioPuX8tGf2OvPaRX54BZ+06Z0WT0eAYz9JwV0/m XzhxBftOnG8RXVhF0bk015aTyFOa7qZapOh8CugPpgSxqOcq+OzxM9Mum6+Lr6+zOD yclvSSE6t34/s77/tveE7Tpt3P4a8/YUucBeALaU= Date: Sun, 27 Jun 2021 12:53:47 +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 03/12] digest_lists: Basic definitions Message-ID: References: <20210625165614.2284243-1-roberto.sassu@huawei.com> <20210625165614.2284243-4-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210625165614.2284243-4-roberto.sassu@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 25, 2021 at 06:56:05PM +0200, Roberto Sassu wrote: > --- /dev/null > +++ b/include/uapi/linux/digest_lists.h > @@ -0,0 +1,43 @@ > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > +/* > + * 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. As you already have the SPDX line up there, you do not need this paragraph. Please remove it from all of the new files you have added in this series. > + * > + * File: digest_lists.h We know the filename, no need to have it here again. > + * Digest list definitions exported to user space. Now this is what probably needs more information... > + */ > + > +#ifndef _UAPI__LINUX_DIGEST_LISTS_H > +#define _UAPI__LINUX_DIGEST_LISTS_H > + > +#include > +#include > + > +enum compact_types { COMPACT_KEY, COMPACT_PARSER, COMPACT_FILE, > + COMPACT_METADATA, COMPACT_DIGEST_LIST, COMPACT__LAST }; > + > +enum compact_modifiers { COMPACT_MOD_IMMUTABLE, COMPACT_MOD__LAST }; > + > +enum compact_actions { COMPACT_ACTION_IMA_MEASURED, > + COMPACT_ACTION_IMA_APPRAISED, > + COMPACT_ACTION_IMA_APPRAISED_DIGSIG, > + COMPACT_ACTION__LAST }; > + > +enum ops { DIGEST_LIST_ADD, DIGEST_LIST_DEL, DIGEST_LIST_OP__LAST }; > + For enums you export to userspace, you need to specify the values so that all compilers get them right. > +struct compact_list_hdr { > + __u8 version; You should never need a version, that way lies madness. > + __u8 _reserved; You better be testing this for 0, right? > + __le16 type; > + __le16 modifiers; > + __le16 algo; > + __le32 count; > + __le32 datalen; Why are user/kernel apis specified in little endian format? Why would that matter? Shouldn't they just be "native" endian? thanks, greg k-h