From: Randy Dunlap <randy.dunlap@oracle.com>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, safford@watson.ibm.com,
serue@linux.vnet.ibm.com, sailer@watson.ibm.com,
zohar@us.ibm.com, Stephen Smalley <sds@tycho.nsa.gov>,
CaseySchaufler <casey@schaufler-ca.com>
Subject: Re: [RFC][Patch 5/5]integrity: IMA as an integrity service provider
Date: Wed, 11 Jun 2008 15:31:18 -0700 [thread overview]
Message-ID: <20080611153118.3fd203a3.randy.dunlap@oracle.com> (raw)
In-Reply-To: <1211898963.4132.8.camel@localhost.localdomain>
On Tue, 27 May 2008 10:36:03 -0400 Mimi Zohar wrote:
> Index: linux-2.6.26-rc3-git2/security/integrity/ima/ima_api.c
> ===================================================================
> --- /dev/null
> +++ linux-2.6.26-rc3-git2/security/integrity/ima/ima_api.c
> @@ -0,0 +1,365 @@
> +/*
> + * Copyright (C) 2008 IBM Corporation
> + *
> + * Authors:
> + * Mimi Zohar <zohar@us.ibm.com>
> + *
> + * 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: ima_api.c
> + * - implements the LIM API
> + */
> +#include <linux/module.h>
> +#include <linux/integrity.h>
> +#include <linux/magic.h>
> +#include <linux/writeback.h>
> +#include <linux/string.h>
> +#include <linux/list.h>
> +#include <linux/audit.h>
> +#include <linux/ima.h>
> +
> +#include "ima.h"
> +
> +struct template_operations ima_template_ops = {
> + .must_measure = ima_must_measure,
> + .collect_measurement = ima_collect_measurement,
> + .store_measurement = ima_store_measurement,
> + .display_template = ima_template_show
> +};
> +
> +#ifdef CONFIG_IMA_BOOTPARAM
> +static int ima_enabled = CONFIG_IMA_BOOTPARAM_VALUE;
> +
> +static int __init ima_enabled_setup(char *str)
> +{
> +
> + ima_enabled = simple_strtol(str, NULL, 0);
> + return 1;
> +}
> +
> +__setup("ima=", ima_enabled_setup);
> +#else
> +static int ima_enabled = 1;
> +#endif
> +
> +/**
> + * mode_setup - for compatability with non-template IMA versions
> + * @str - is pointer to a string
> + */
> +int ima_template_mode = 1;
> +static int __init mode_setup(char *str)
> +{
> + if (strncmp(str, "ima", 3) == 0)
> + ima_template_mode = 0;
> + if (strncmp(str, "template", 7) == 0)
> + ima_template_mode = 1;
> + printk(KERN_INFO "%s: template_mode %s \n", __func__,
> + ima_template_mode ? "template" : "ima");
> + return 1;
> +}
> +
> +__setup("ima_mode=", mode_setup);
> +
> +/**
> + * ima_digest_cpy - copy the hash in the IMA template structure to a digest
> + * @template_name: string containing the name of the template (i.e. "ima")
> + * @template - pointer to template structure
* @template:
> + * @digest - pointer to the digest
* @digest:
> + *
> + * Returns 0 on success, error code otherwise
> + */
> +static int ima_digest_cpy(char *template_name, void *template, u8 *digest)
> +{
> + int rc, result = 0;
> + struct ima_inode_measure_entry *inode_template =
> + (struct ima_inode_measure_entry *)template;
> +
> + rc = strcmp(template_name, "ima");
> + if (rc == 0)
> + memcpy(digest, inode_template->digest,
> + sizeof inode_template->digest);
> + else
> + result = -ENODATA;
> + return result;
> +}
Thanks.
---
~Randy
next prev parent reply other threads:[~2008-06-11 22:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-23 15:05 Mimi Zohar
2008-05-23 23:30 ` Randy Dunlap
2008-05-27 1:02 ` Mimi Zohar
2008-05-27 14:36 ` Mimi Zohar
2008-06-11 22:31 ` Randy Dunlap [this message]
2008-05-28 8:22 ` Andrew Morton
2008-05-29 3:17 ` Mimi Zohar
2008-05-29 3:30 ` Andrew Morton
2008-05-29 21:50 ` Mimi Zohar
2008-05-29 23:35 ` Andrew Morton
2008-05-30 1:58 ` Mimi Zohar
2008-05-30 2:04 ` Andrew Morton
2008-05-30 13:06 ` Mimi Zohar
2008-05-29 3:33 ` Mimi Zohar
2008-05-31 7:54 ` Pavel Machek
2008-06-24 16:28 ` david safford
2008-08-05 17:35 ` Pavel Machek
2008-06-24 16:28 ` david safford
2008-08-05 17:32 ` Pavel Machek
[not found] <20080627131946.225566613@linux.vnet.ibm.com>
2008-06-27 16:23 ` [RFC][PATCH 5/5] integrity: " Mimi Zohar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080611153118.3fd203a3.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=casey@schaufler-ca.com \
--cc=linux-kernel@vger.kernel.org \
--cc=safford@watson.ibm.com \
--cc=sailer@watson.ibm.com \
--cc=sds@tycho.nsa.gov \
--cc=serue@linux.vnet.ibm.com \
--cc=zohar@linux.vnet.ibm.com \
--cc=zohar@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome