// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2005,2006,2007,2008 IBM Corporation * * Authors: * Reiner Sailer <[email protected]> * Leendert van Doorn <[email protected]> * Mimi Zohar <[email protected]> * * File: ima_init.c * initialization and cleanup functions */ #include <linux/init.h> #include <linux/scatterlist.h> #include <linux/slab.h> #include <linux/err.h> #include <linux/ima.h> #include <generated/utsrelease.h> #include "ima.h" /* name for boot aggregate entry */ const char boot_aggregate_name[] = …; struct tpm_chip *ima_tpm_chip; /* Add the boot aggregate to the IMA measurement list and extend * the PCR register. * * Calculate the boot aggregate, a hash over tpm registers 0-7, * assuming a TPM chip exists, and zeroes if the TPM chip does not * exist. Add the boot aggregate measurement to the measurement * list and extend the PCR register. * * If a tpm chip does not exist, indicate the core root of trust is * not hardware based by invalidating the aggregate PCR value. * (The aggregate PCR value is invalidated by adding one value to * the measurement list and extending the aggregate PCR value with * a different value.) Violations add a zero entry to the measurement * list and extend the aggregate PCR value with ff...ff's. */ static int __init ima_add_boot_aggregate(void) { … } #ifdef CONFIG_IMA_LOAD_X509 void __init ima_load_x509(void) { … } #endif int __init ima_init(void) { … }