lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250630125928.765285-1-gongruiqi1@huawei.com>
Date: Mon, 30 Jun 2025 20:59:24 +0800
From: GONG Ruiqi <gongruiqi1@...wei.com>
To: Mimi Zohar <zohar@...ux.ibm.com>, Roberto Sassu
	<roberto.sassu@...wei.com>, Dmitry Kasatkin <dmitry.kasatkin@...il.com>
CC: Eric Snowberg <eric.snowberg@...cle.com>, Paul Moore
	<paul@...l-moore.com>, James Morris <jmorris@...ei.org>, "Serge E . Hallyn"
	<serge@...lyn.com>, <linux-kernel@...r.kernel.org>,
	<linux-integrity@...r.kernel.org>, <linux-security-module@...r.kernel.org>,
	Lu Jialin <lujialin4@...wei.com>, <gongruiqi1@...wei.com>
Subject: [PATCH -next RFC 0/4] IMA Root of Trust (RoT) Framework

Currently, the IMA subsystem can only use TPM as the Root of Trust
(RoT) device, and its coding is tightly coupled with TPM operations.

        ┌──────────┐    ┌───────────┐
       ┌┴─────────┐│   ┌┴──────────┐│
       │ Programs ├┘   │ Libraries ├┘
       └────┬─────┘    └────┬──────┘                       User
─ ─ ─ ─ ─ ─ │ ─ ─ ─ ─ ─ ─ ─ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
            └────────┬──────┘                              Kernel
                     ▼
  ┌────────────────────────────────────┐  ┌────────────────┐
  │              IMA Hooks             │  │                │
  │ (file read, executed, mmapped etc) │  │                │
  └──────────────────┬─────────────────┘  │      IMA       │
                     ▼                    │ Initialization │
  ┌────────────────────────────────────┐  │                │
  │        IMA Measurement List        │  │                │
  └──────────────────┬─────────────────┘  └────┬───────┬───┘
               extend│      calc_boot_aggregate│   init│
                     ▼                         ▼       ▼
  ┌────────────────────────────────────────────────────────┐
  │                    TPM Device Driver                   │
  └─────────────────────────────┬──────────────────────────┘
                                │
─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
                                ▼                          Hardware
                     ┌──────────────────┐
                     │    TPM Device    │
                     └──────────────────┘

In recent years, new scenarios such as Confidential Computing have
emerged, requiring IMA to use various new RoT devices proposed by
different vendors, such as Intel TDX[1] and Huawei VirtCCA[2]. To make
it easier for these devices to be integrated into the IMA subsystem, it
is necessary to decouple TPM specific code from IMA, while abstracting
IMA's configuration and operation to RoT devices into multiple
independent interfaces, ultimately forming an IMA RoT device framework.
This framework abstracts away the underlying details of various RoT
devices for IMA, and each type of RoT devices can be "plugged in" and
utilized by IMA simply via implementing the framework interfaces.

            ┌──────────┐    ┌───────────┐
           ┌┴─────────┐│   ┌┴──────────┐│
           │ Programs ├┘   │ Libraries ├┘
           └────┬─────┘    └────┬──────┘                        User
─ ─ ─ ─ ─ ─ ─ ─ │ ─ ─ ─ ─ ─ ─ ─ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
                └───────┬───────┘                               Kernel
                        ▼
     ┌────────────────────────────────────┐  ┌────────────────┐
     │              IMA Hooks             │  │                │
     │ (file read, executed, mmapped etc) │  │                │
     └──────────────────┬─────────────────┘  │      IMA       │
                        ▼                    │ Initialization │
     ┌────────────────────────────────────┐  │                │
     │        IMA Measurement List        │  │                │
     └──────────────────┬─────────────────┘  └────┬───────┬───┘
                  extend│      calc_boot_aggregate│   init│
                        ▼                         ▼       ▼
     ┌────────────────────────────────────────────────────────┐
     │                        IMA RoT                         │
     │                       Framework                        │
     └───────────────────────────┬────────────────────────────┘
         ┌───────────────┬───────┴─────────┬─────────────────┐
         ▼               ▼                 ▼                 ▼
┌────────────────┐ ┌────────────┐ ┌──────────────────┐ ┌────────────┐
│ VirtCCA Driver │ │ TPM Driver │ │ Intel TDX Driver │ │ xxx Driver │
└────────┬───────┘ └─────┬──────┘ └────────┬─────────┘ └─────┬──────┘
         │               │                 │                 │
─ ─ ─ ─ ─│─ ─ ─ ─ ─ ─ ─ ─│─ ─ ─ ─ ─ ─ ─ ─ ─│─ ─ ─ ─ ─ ─ ─ ─ ─│─ ─ ─ ─ ─
         │               │                 │                 │  Hardware
         ▼               ▼                 ▼                 ▼
┌────────────────┐ ┌────────────┐ ┌──────────────────┐ ┌────────────┐
│ VirtCCA Device │ │ TPM Device │ │ Intel TDX Device │ │ xxx Device │
└────────────────┘ └────────────┘ └──────────────────┘ └────────────┘

This patch set provides an implementation of the aforementioned IMA RoT
framework, which can facilitate easier adaptation for new devices such
as Intel TDX and Huawei VirtCCA, as well as the classic TPM, to be an
RoT that IMA can utilize to maintain system's integrity.

[1]: Reference for Intel TDX with IMA:
https://www.intel.cn/content/www/cn/zh/developer/articles/community/runtime-integrity-measure-and-attest-trust-domain.html

[2]: Reference for Huawei VirtCCA:
https://gitee.com/openeuler/kernel/blob/OLK-6.6/Documentation/virtcca/virtcca.txt


GONG Ruiqi (4):
  ima: rot: Introduce basic framework
  ima: rot: Prepare TPM as an RoT
  ima: rot: Make RoT kick in
  ima: rot: Involve per-RoT default PCR index

 security/integrity/ima/Kconfig            |  12 +-
 security/integrity/ima/Makefile           |   3 +-
 security/integrity/ima/ima.h              |  11 +-
 security/integrity/ima/ima_api.c          |   4 +-
 security/integrity/ima/ima_crypto.c       | 139 +++----------------
 security/integrity/ima/ima_fs.c           |   4 +-
 security/integrity/ima/ima_init.c         |  14 +-
 security/integrity/ima/ima_main.c         |   4 +-
 security/integrity/ima/ima_queue.c        |  39 ++----
 security/integrity/ima/ima_rot.c          | 108 +++++++++++++++
 security/integrity/ima/ima_rot.h          |  42 ++++++
 security/integrity/ima/ima_template.c     |   2 +-
 security/integrity/ima/ima_template_lib.c |   4 +-
 security/integrity/ima/ima_tpm.c          | 154 ++++++++++++++++++++++
 security/integrity/ima/ima_tpm.h          |  19 +++
 15 files changed, 388 insertions(+), 171 deletions(-)
 create mode 100644 security/integrity/ima/ima_rot.c
 create mode 100644 security/integrity/ima/ima_rot.h
 create mode 100644 security/integrity/ima/ima_tpm.c
 create mode 100644 security/integrity/ima/ima_tpm.h

-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ