Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5205397pxv; Wed, 28 Jul 2021 05:49:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHEpzlPYKRCybRFgFHCUrbrPNOdlKQcNuzYZ1PksV+AFglIQqVI6J9vimuksdQg8rbS3mX X-Received: by 2002:aa7:c349:: with SMTP id j9mr27605948edr.3.1627476559141; Wed, 28 Jul 2021 05:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627476559; cv=none; d=google.com; s=arc-20160816; b=LnTkxkIIWG4f81UMPWcCSjguGst4VwiYVvjGmpsj6wpuQ4Ys7WRkh+MPX8H0lX2GCu F/Hk3q/zGsweNzxyiL8edwt5WP5PuAePx4pkH4Y+kyX7jkjoVesGijVzIjbwfDV+IHLC ygQxXlWE9Rz05knX42bOIjLB5CF/tkEZ5YuxD4rdfKCyZX68zpJlFxSWcyibJ3WcSEvL lv82Y+LDORyn6EkOlxQf4Jxa9Rf9GMkBrWU0rYGfjurVXqK9cuESYTszKdU26fSpqGD3 NHxREaecGgcGf4kyLF4Uo/VX8RzNpQ90a0X2+DDaWNd7yXeODWpNF9420Rrh69WM0egG yfoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=xTekq8ItPjGqs6no2rxV3HEnlsGyR72G9R8V7DdjpRg=; b=ejhwOcVt7rdFc2eMENs+U9Ov/ymr5P5X/oqv9/bSLffXIdHPMFr0IflWMtLDprgBT0 MSvSqwvfZ4o/Bi5vlexhtCuvEYScffP5M2gIOsv4Gbd/8oFev/Ny7JCJ0r/g+oykixIT mVsvhOXI7rkzAxxfqyGhd8lEMyPra9kqxi7+P07NQx/H4T6/oGULP9hkEeYrgP0dFpSd D27ZUYXQU0Kx/0sY2hNk27K5UORcgNMKuZwGJ4+CthuL5DsiDMlxrBy//f9oi3xuPTer u4QaNm+cllYglFqcMAM3SXds726VO8aVIhZIyiypi7zUVjHYiNJf83ph/cFm0mX+Wu0S X5Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CVvrUhOM; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si3742712eds.296.2021.07.28.05.48.56; Wed, 28 Jul 2021 05:49:19 -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=@kernel.org header.s=k20201202 header.b=CVvrUhOM; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234771AbhG1Mrh (ORCPT + 99 others); Wed, 28 Jul 2021 08:47:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:46738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234759AbhG1Mrf (ORCPT ); Wed, 28 Jul 2021 08:47:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2C1B360FC0; Wed, 28 Jul 2021 12:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627476453; bh=bjFjDZ8cI3IDSCqI1y0kJWa2EkidjrwuaHkeMMXdfSY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CVvrUhOMARYWM5FAHXn4pAOCHUx80b85xBrVxz8ZYhhHKaobXdpz8jeT8t/kFbjCI PNw4coTw9niEVPvy25NbvwINd8CvS1n6IshhNxw+7pbCyGzCYzhdP5AulUFTUujNMV 9N3WpXnRCjr4/k5HDh/p6UjDgHIzvoqVxy7+ifdKrDYPJ0ifnuSx42tWB/L9JQyCD1 LWMzbCoyMMRQCjT4D/1rPCXn0uqRJtxuXto7ebNbAJtO1s2hQvD9LLixhDTm/IlC1y 92KaPD9glDdgpuAd+zcFjG5DjIbIAplRA6LkV/p+oNvAQPOMENHWP7SPoshVqT33x3 YXHlVrN7OpPhA== Date: Wed, 28 Jul 2021 14:47:28 +0200 From: Mauro Carvalho Chehab To: Roberto Sassu Cc: , , , , , , Subject: Re: [RFC][PATCH v2 11/12] diglim: Remote Attestation Message-ID: <20210728144728.62ace280@sal.lan> In-Reply-To: <20210726163700.2092768-12-roberto.sassu@huawei.com> References: <20210726163700.2092768-1-roberto.sassu@huawei.com> <20210726163700.2092768-12-roberto.sassu@huawei.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, 26 Jul 2021 18:36:59 +0200 Roberto Sassu escreveu: > Add more information about remote attestation with IMA and DIGLIM in > Documentation/security/diglim/remote_attestation.rst. > > Signed-off-by: Roberto Sassu > --- > Documentation/security/diglim/index.rst | 1 + > .../security/diglim/remote_attestation.rst | 87 +++++++++++++++++++ > MAINTAINERS | 1 + > 3 files changed, 89 insertions(+) > create mode 100644 Documentation/security/diglim/remote_attestation.rst > > diff --git a/Documentation/security/diglim/index.rst b/Documentation/security/diglim/index.rst > index 4771134c2f0d..0f28c5ad71c0 100644 > --- a/Documentation/security/diglim/index.rst > +++ b/Documentation/security/diglim/index.rst > @@ -10,3 +10,4 @@ Digest Lists Integrity Module (DIGLIM) > introduction > architecture > implementation > + remote_attestation > diff --git a/Documentation/security/diglim/remote_attestation.rst b/Documentation/security/diglim/remote_attestation.rst > new file mode 100644 > index 000000000000..83fd7581c460 > --- /dev/null > +++ b/Documentation/security/diglim/remote_attestation.rst > @@ -0,0 +1,87 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +Remote Attestation > +================== > + > +When a digest list is added or deleted through the ``digest_list_add`` or > +``digest_list_del`` interfaces, its buffer is sent to the IMA function > +``ima_measure_critical_data()``. The primary reason for it is to calculate > +the buffer digest, so that the digest list itself is searchable in the hash > +table. > + > +``ima_measure_critical_data()`` can be also used to create a new > +measurement entry each time this function is called, if there is an > +appropriate rule in the IMA policy. Given that this function is called > +during an addition or deletion of a digest list, a remote verifier can > +infer from the measurement list precise information about what has been > +uploaded to the kernel. > + > +To enable this functionality, the following rule must be added to the IMA > +policy: > + > +:: As commented on other patches at this series, you can merge :: at the previous text line, e. g.: policy:: does the same as: policy: :: but it is nicer for text-only readers, IMO. > + > + measure func=CRITICAL_DATA label=diglim > + > + > +When a file is uploaded, the workflow and the resulting IMA measurement > +list are: > + > +.. code-block:: bash > + > + # echo $PWD/0-file_list-compact-cat > /sys/kernel/security/integrity/diglim/digest_list_add > + # echo $PWD/0-file_list-compact-cat > /sys/kernel/security/integrity/diglim/digest_list_del > + # cat /sys/kernel/security/integrity/ima/ascii_runtime_measurements > + ... > + 10