blob: 60d011aaec389dc26e77091e86455cd550892c64 [file] [log] [blame]
Mimi Zoharbab73932009-02-04 09:06:59 -05001/*
2 * Copyright (C) 2005,2006,2007,2008 IBM Corporation
3 *
4 * Authors:
5 * Kylene Hall <kjhall@us.ibm.com>
6 * Reiner Sailer <sailer@us.ibm.com>
7 * Mimi Zohar <zohar@us.ibm.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation, version 2 of the
12 * License.
13 *
14 * File: ima_fs.c
15 * implemenents security file system for reporting
16 * current measurement list and IMA statistics
17 */
Eric Parisf850a7c2009-05-12 15:13:55 -040018#include <linux/fcntl.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090019#include <linux/slab.h>
Mimi Zoharbab73932009-02-04 09:06:59 -050020#include <linux/module.h>
21#include <linux/seq_file.h>
22#include <linux/rculist.h>
23#include <linux/rcupdate.h>
Mimi Zohar4af46622009-02-04 09:07:00 -050024#include <linux/parser.h>
Dmitry Kasatkin7429b092014-04-11 17:47:01 +030025#include <linux/vmalloc.h>
Mimi Zoharbab73932009-02-04 09:06:59 -050026
27#include "ima.h"
28
Petko Manolov38d859f2015-12-02 17:47:54 +020029static DEFINE_MUTEX(ima_write_mutex);
30
Mimi Zohar4af46622009-02-04 09:07:00 -050031static int valid_policy = 1;
Mimi Zoharbab73932009-02-04 09:06:59 -050032#define TMPBUFLEN 12
33static ssize_t ima_show_htable_value(char __user *buf, size_t count,
34 loff_t *ppos, atomic_long_t *val)
35{
36 char tmpbuf[TMPBUFLEN];
37 ssize_t len;
38
39 len = scnprintf(tmpbuf, TMPBUFLEN, "%li\n", atomic_long_read(val));
40 return simple_read_from_buffer(buf, count, ppos, tmpbuf, len);
41}
42
43static ssize_t ima_show_htable_violations(struct file *filp,
44 char __user *buf,
45 size_t count, loff_t *ppos)
46{
47 return ima_show_htable_value(buf, count, ppos, &ima_htable.violations);
48}
49
Alexey Dobriyan828c0952009-10-01 15:43:56 -070050static const struct file_operations ima_htable_violations_ops = {
Arnd Bergmanncdcd90f2010-07-07 23:40:15 +020051 .read = ima_show_htable_violations,
52 .llseek = generic_file_llseek,
Mimi Zoharbab73932009-02-04 09:06:59 -050053};
54
55static ssize_t ima_show_measurements_count(struct file *filp,
56 char __user *buf,
57 size_t count, loff_t *ppos)
58{
59 return ima_show_htable_value(buf, count, ppos, &ima_htable.len);
60
61}
62
Alexey Dobriyan828c0952009-10-01 15:43:56 -070063static const struct file_operations ima_measurements_count_ops = {
Arnd Bergmanncdcd90f2010-07-07 23:40:15 +020064 .read = ima_show_measurements_count,
65 .llseek = generic_file_llseek,
Mimi Zoharbab73932009-02-04 09:06:59 -050066};
67
68/* returns pointer to hlist_node */
69static void *ima_measurements_start(struct seq_file *m, loff_t *pos)
70{
71 loff_t l = *pos;
72 struct ima_queue_entry *qe;
73
74 /* we need a lock since pos could point beyond last element */
75 rcu_read_lock();
76 list_for_each_entry_rcu(qe, &ima_measurements, later) {
77 if (!l--) {
78 rcu_read_unlock();
79 return qe;
80 }
81 }
82 rcu_read_unlock();
83 return NULL;
84}
85
86static void *ima_measurements_next(struct seq_file *m, void *v, loff_t *pos)
87{
88 struct ima_queue_entry *qe = v;
89
90 /* lock protects when reading beyond last element
91 * against concurrent list-extension
92 */
93 rcu_read_lock();
Dmitry Kasatkin089bc8e2013-10-10 15:56:13 +090094 qe = list_entry_rcu(qe->later.next, struct ima_queue_entry, later);
Mimi Zoharbab73932009-02-04 09:06:59 -050095 rcu_read_unlock();
96 (*pos)++;
97
98 return (&qe->later == &ima_measurements) ? NULL : qe;
99}
100
101static void ima_measurements_stop(struct seq_file *m, void *v)
102{
103}
104
Roberto Sassu3ce1217d2013-06-07 12:16:30 +0200105void ima_putc(struct seq_file *m, void *data, int datalen)
Mimi Zoharbab73932009-02-04 09:06:59 -0500106{
107 while (datalen--)
108 seq_putc(m, *(char *)data++);
109}
110
111/* print format:
112 * 32bit-le=pcr#
113 * char[20]=template digest
114 * 32bit-le=template name size
115 * char[n]=template name
Roberto Sassua71dc652013-06-07 12:16:33 +0200116 * [eventdata length]
Mimi Zoharbab73932009-02-04 09:06:59 -0500117 * eventdata[n]=template specific data
118 */
119static int ima_measurements_show(struct seq_file *m, void *v)
120{
121 /* the list never shrinks, so we don't need a lock here */
122 struct ima_queue_entry *qe = v;
123 struct ima_template_entry *e;
Roberto Sassu7dbdb422014-10-13 14:08:39 +0200124 char *template_name;
Mimi Zoharbab73932009-02-04 09:06:59 -0500125 int namelen;
126 u32 pcr = CONFIG_IMA_MEASURE_PCR_IDX;
Roberto Sassu3e8e5502013-11-08 19:21:40 +0100127 bool is_ima_template = false;
Roberto Sassua71dc652013-06-07 12:16:33 +0200128 int i;
Mimi Zoharbab73932009-02-04 09:06:59 -0500129
130 /* get entry */
131 e = qe->entry;
132 if (e == NULL)
133 return -1;
134
Roberto Sassu7dbdb422014-10-13 14:08:39 +0200135 template_name = (e->template_desc->name[0] != '\0') ?
136 e->template_desc->name : e->template_desc->fmt;
137
Mimi Zoharbab73932009-02-04 09:06:59 -0500138 /*
139 * 1st: PCRIndex
140 * PCR used is always the same (config option) in
141 * little-endian format
142 */
Dmitry Kasatkin2bb930a2014-03-04 18:04:20 +0200143 ima_putc(m, &pcr, sizeof(pcr));
Mimi Zoharbab73932009-02-04 09:06:59 -0500144
145 /* 2nd: template digest */
Mimi Zohar140d8022013-03-11 20:29:47 -0400146 ima_putc(m, e->digest, TPM_DIGEST_SIZE);
Mimi Zoharbab73932009-02-04 09:06:59 -0500147
148 /* 3rd: template name size */
Roberto Sassu7dbdb422014-10-13 14:08:39 +0200149 namelen = strlen(template_name);
Dmitry Kasatkin2bb930a2014-03-04 18:04:20 +0200150 ima_putc(m, &namelen, sizeof(namelen));
Mimi Zoharbab73932009-02-04 09:06:59 -0500151
152 /* 4th: template name */
Roberto Sassu7dbdb422014-10-13 14:08:39 +0200153 ima_putc(m, template_name, namelen);
Mimi Zoharbab73932009-02-04 09:06:59 -0500154
Roberto Sassua71dc652013-06-07 12:16:33 +0200155 /* 5th: template length (except for 'ima' template) */
Roberto Sassu7dbdb422014-10-13 14:08:39 +0200156 if (strcmp(template_name, IMA_TEMPLATE_IMA_NAME) == 0)
Roberto Sassu3e8e5502013-11-08 19:21:40 +0100157 is_ima_template = true;
158
159 if (!is_ima_template)
Roberto Sassua71dc652013-06-07 12:16:33 +0200160 ima_putc(m, &e->template_data_len,
161 sizeof(e->template_data_len));
162
163 /* 6th: template specific data */
164 for (i = 0; i < e->template_desc->num_fields; i++) {
Roberto Sassu3e8e5502013-11-08 19:21:40 +0100165 enum ima_show_type show = IMA_SHOW_BINARY;
166 struct ima_template_field *field = e->template_desc->fields[i];
167
168 if (is_ima_template && strcmp(field->field_id, "d") == 0)
169 show = IMA_SHOW_BINARY_NO_FIELD_LEN;
Roberto Sassuc019e302014-02-03 13:56:04 +0100170 if (is_ima_template && strcmp(field->field_id, "n") == 0)
171 show = IMA_SHOW_BINARY_OLD_STRING_FMT;
Roberto Sassu3e8e5502013-11-08 19:21:40 +0100172 field->field_show(m, show, &e->template_data[i]);
Roberto Sassua71dc652013-06-07 12:16:33 +0200173 }
Mimi Zoharbab73932009-02-04 09:06:59 -0500174 return 0;
175}
176
James Morris88e9d342009-09-22 16:43:43 -0700177static const struct seq_operations ima_measurments_seqops = {
Mimi Zoharbab73932009-02-04 09:06:59 -0500178 .start = ima_measurements_start,
179 .next = ima_measurements_next,
180 .stop = ima_measurements_stop,
181 .show = ima_measurements_show
182};
183
184static int ima_measurements_open(struct inode *inode, struct file *file)
185{
186 return seq_open(file, &ima_measurments_seqops);
187}
188
Alexey Dobriyan828c0952009-10-01 15:43:56 -0700189static const struct file_operations ima_measurements_ops = {
Mimi Zoharbab73932009-02-04 09:06:59 -0500190 .open = ima_measurements_open,
191 .read = seq_read,
192 .llseek = seq_lseek,
193 .release = seq_release,
194};
195
Mimi Zohar45b26132015-06-11 11:54:42 -0400196void ima_print_digest(struct seq_file *m, u8 *digest, u32 size)
Mimi Zoharbab73932009-02-04 09:06:59 -0500197{
Mimi Zohar45b26132015-06-11 11:54:42 -0400198 u32 i;
Mimi Zoharbab73932009-02-04 09:06:59 -0500199
Mimi Zohar140d8022013-03-11 20:29:47 -0400200 for (i = 0; i < size; i++)
Mimi Zoharbab73932009-02-04 09:06:59 -0500201 seq_printf(m, "%02x", *(digest + i));
202}
203
Mimi Zoharbab73932009-02-04 09:06:59 -0500204/* print in ascii */
205static int ima_ascii_measurements_show(struct seq_file *m, void *v)
206{
207 /* the list never shrinks, so we don't need a lock here */
208 struct ima_queue_entry *qe = v;
209 struct ima_template_entry *e;
Roberto Sassu7dbdb422014-10-13 14:08:39 +0200210 char *template_name;
Roberto Sassua71dc652013-06-07 12:16:33 +0200211 int i;
Mimi Zoharbab73932009-02-04 09:06:59 -0500212
213 /* get entry */
214 e = qe->entry;
215 if (e == NULL)
216 return -1;
217
Roberto Sassu7dbdb422014-10-13 14:08:39 +0200218 template_name = (e->template_desc->name[0] != '\0') ?
219 e->template_desc->name : e->template_desc->fmt;
220
Mimi Zoharbab73932009-02-04 09:06:59 -0500221 /* 1st: PCR used (config option) */
222 seq_printf(m, "%2d ", CONFIG_IMA_MEASURE_PCR_IDX);
223
224 /* 2nd: SHA1 template hash */
Mimi Zohar140d8022013-03-11 20:29:47 -0400225 ima_print_digest(m, e->digest, TPM_DIGEST_SIZE);
Mimi Zoharbab73932009-02-04 09:06:59 -0500226
227 /* 3th: template name */
Roberto Sassu7dbdb422014-10-13 14:08:39 +0200228 seq_printf(m, " %s", template_name);
Mimi Zoharbab73932009-02-04 09:06:59 -0500229
230 /* 4th: template specific data */
Roberto Sassua71dc652013-06-07 12:16:33 +0200231 for (i = 0; i < e->template_desc->num_fields; i++) {
232 seq_puts(m, " ");
233 if (e->template_data[i].len == 0)
234 continue;
235
236 e->template_desc->fields[i]->field_show(m, IMA_SHOW_ASCII,
237 &e->template_data[i]);
238 }
239 seq_puts(m, "\n");
Mimi Zoharbab73932009-02-04 09:06:59 -0500240 return 0;
241}
242
James Morris88e9d342009-09-22 16:43:43 -0700243static const struct seq_operations ima_ascii_measurements_seqops = {
Mimi Zoharbab73932009-02-04 09:06:59 -0500244 .start = ima_measurements_start,
245 .next = ima_measurements_next,
246 .stop = ima_measurements_stop,
247 .show = ima_ascii_measurements_show
248};
249
250static int ima_ascii_measurements_open(struct inode *inode, struct file *file)
251{
252 return seq_open(file, &ima_ascii_measurements_seqops);
253}
254
Alexey Dobriyan828c0952009-10-01 15:43:56 -0700255static const struct file_operations ima_ascii_measurements_ops = {
Mimi Zoharbab73932009-02-04 09:06:59 -0500256 .open = ima_ascii_measurements_open,
257 .read = seq_read,
258 .llseek = seq_lseek,
259 .release = seq_release,
260};
261
Dmitry Kasatkin7429b092014-04-11 17:47:01 +0300262static ssize_t ima_read_policy(char *path)
263{
264 void *data;
265 char *datap;
266 loff_t size;
267 int rc, pathlen = strlen(path);
268
269 char *p;
270
271 /* remove \n */
272 datap = path;
273 strsep(&datap, "\n");
274
275 rc = kernel_read_file_from_path(path, &data, &size, 0, READING_POLICY);
276 if (rc < 0) {
277 pr_err("Unable to open file: %s (%d)", path, rc);
278 return rc;
279 }
280
281 datap = data;
282 while (size > 0 && (p = strsep(&datap, "\n"))) {
283 pr_debug("rule: %s\n", p);
284 rc = ima_parse_add_rule(p);
285 if (rc < 0)
286 break;
287 size -= rc;
288 }
289
290 vfree(data);
291 if (rc < 0)
292 return rc;
293 else if (size)
294 return -EINVAL;
295 else
296 return pathlen;
297}
298
Mimi Zohar4af46622009-02-04 09:07:00 -0500299static ssize_t ima_write_policy(struct file *file, const char __user *buf,
300 size_t datalen, loff_t *ppos)
301{
Petko Manolov6427e6c2016-01-03 17:36:38 +0200302 char *data;
Eric Paris6ccd0452010-04-20 10:20:54 -0400303 ssize_t result;
Mimi Zohar4af46622009-02-04 09:07:00 -0500304
305 if (datalen >= PAGE_SIZE)
Eric Paris6ccd0452010-04-20 10:20:54 -0400306 datalen = PAGE_SIZE - 1;
307
308 /* No partial writes. */
309 result = -EINVAL;
310 if (*ppos != 0)
311 goto out;
312
313 result = -ENOMEM;
Mimi Zohar4af46622009-02-04 09:07:00 -0500314 data = kmalloc(datalen + 1, GFP_KERNEL);
315 if (!data)
Eric Paris6ccd0452010-04-20 10:20:54 -0400316 goto out;
Mimi Zohar4af46622009-02-04 09:07:00 -0500317
Mimi Zohar4af46622009-02-04 09:07:00 -0500318 *(data + datalen) = '\0';
Mimi Zohar4af46622009-02-04 09:07:00 -0500319
Eric Paris6ccd0452010-04-20 10:20:54 -0400320 result = -EFAULT;
321 if (copy_from_user(data, buf, datalen))
Petko Manolov6427e6c2016-01-03 17:36:38 +0200322 goto out_free;
Eric Paris6ccd0452010-04-20 10:20:54 -0400323
Petko Manolov6427e6c2016-01-03 17:36:38 +0200324 result = mutex_lock_interruptible(&ima_write_mutex);
325 if (result < 0)
326 goto out_free;
Petko Manolov6427e6c2016-01-03 17:36:38 +0200327
Mimi Zohar19f8a842016-01-15 10:17:12 -0500328 if (data[0] == '/') {
Dmitry Kasatkin7429b092014-04-11 17:47:01 +0300329 result = ima_read_policy(data);
Mimi Zohar19f8a842016-01-15 10:17:12 -0500330 } else if (ima_appraise & IMA_APPRAISE_POLICY) {
331 pr_err("IMA: signed policy file (specified as an absolute pathname) required\n");
332 integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL,
333 "policy_update", "signed policy required",
334 1, 0);
335 if (ima_appraise & IMA_APPRAISE_ENFORCE)
336 result = -EACCES;
337 } else {
Dmitry Kasatkin7429b092014-04-11 17:47:01 +0300338 result = ima_parse_add_rule(data);
Mimi Zohar19f8a842016-01-15 10:17:12 -0500339 }
Dmitry Kasatkin7429b092014-04-11 17:47:01 +0300340 mutex_unlock(&ima_write_mutex);
Petko Manolov6427e6c2016-01-03 17:36:38 +0200341out_free:
342 kfree(data);
Eric Paris6ccd0452010-04-20 10:20:54 -0400343out:
344 if (result < 0)
345 valid_policy = 0;
Petko Manolov38d859f2015-12-02 17:47:54 +0200346
Eric Paris6ccd0452010-04-20 10:20:54 -0400347 return result;
Mimi Zohar4af46622009-02-04 09:07:00 -0500348}
349
Mimi Zoharbab73932009-02-04 09:06:59 -0500350static struct dentry *ima_dir;
351static struct dentry *binary_runtime_measurements;
352static struct dentry *ascii_runtime_measurements;
353static struct dentry *runtime_measurements_count;
354static struct dentry *violations;
Mimi Zohar4af46622009-02-04 09:07:00 -0500355static struct dentry *ima_policy;
356
Dmitry Kasatkin0716abb2014-10-03 14:40:21 +0300357enum ima_fs_flags {
358 IMA_FS_BUSY,
359};
360
361static unsigned long ima_fs_flags;
362
Petko Manolov80eae202015-12-02 17:47:56 +0200363#ifdef CONFIG_IMA_READ_POLICY
364static const struct seq_operations ima_policy_seqops = {
365 .start = ima_policy_start,
366 .next = ima_policy_next,
367 .stop = ima_policy_stop,
368 .show = ima_policy_show,
369};
370#endif
371
Mimi Zoharf4bd8572009-02-04 09:07:01 -0500372/*
373 * ima_open_policy: sequentialize access to the policy file
374 */
Dmitry Kasatkin2bb930a2014-03-04 18:04:20 +0200375static int ima_open_policy(struct inode *inode, struct file *filp)
Mimi Zoharf4bd8572009-02-04 09:07:01 -0500376{
Petko Manolov80eae202015-12-02 17:47:56 +0200377 if (!(filp->f_flags & O_WRONLY)) {
378#ifndef CONFIG_IMA_READ_POLICY
Eric Parisf850a7c2009-05-12 15:13:55 -0400379 return -EACCES;
Petko Manolov80eae202015-12-02 17:47:56 +0200380#else
381 if ((filp->f_flags & O_ACCMODE) != O_RDONLY)
382 return -EACCES;
383 if (!capable(CAP_SYS_ADMIN))
384 return -EPERM;
385 return seq_open(filp, &ima_policy_seqops);
386#endif
387 }
Dmitry Kasatkin0716abb2014-10-03 14:40:21 +0300388 if (test_and_set_bit(IMA_FS_BUSY, &ima_fs_flags))
389 return -EBUSY;
390 return 0;
Mimi Zoharf4bd8572009-02-04 09:07:01 -0500391}
392
Mimi Zohar4af46622009-02-04 09:07:00 -0500393/*
394 * ima_release_policy - start using the new measure policy rules.
395 *
396 * Initially, ima_measure points to the default policy rules, now
Mimi Zoharf4bd8572009-02-04 09:07:01 -0500397 * point to the new policy rules, and remove the securityfs policy file,
398 * assuming a valid policy.
Mimi Zohar4af46622009-02-04 09:07:00 -0500399 */
400static int ima_release_policy(struct inode *inode, struct file *file)
401{
Dmitry Kasatkin0716abb2014-10-03 14:40:21 +0300402 const char *cause = valid_policy ? "completed" : "failed";
403
Petko Manolov80eae202015-12-02 17:47:56 +0200404 if ((file->f_flags & O_ACCMODE) == O_RDONLY)
405 return 0;
406
Sasha Levin01127212015-12-22 08:51:23 -0500407 if (valid_policy && ima_check_policy() < 0) {
408 cause = "failed";
409 valid_policy = 0;
410 }
411
Dmitry Kasatkin0716abb2014-10-03 14:40:21 +0300412 pr_info("IMA: policy update %s\n", cause);
413 integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL,
414 "policy_update", cause, !valid_policy, 0);
415
Mimi Zohar4af46622009-02-04 09:07:00 -0500416 if (!valid_policy) {
417 ima_delete_rules();
Mimi Zoharf4bd8572009-02-04 09:07:01 -0500418 valid_policy = 1;
Dmitry Kasatkin0716abb2014-10-03 14:40:21 +0300419 clear_bit(IMA_FS_BUSY, &ima_fs_flags);
Mimi Zohar4af46622009-02-04 09:07:00 -0500420 return 0;
421 }
Petko Manolov80eae202015-12-02 17:47:56 +0200422
Mimi Zohar4af46622009-02-04 09:07:00 -0500423 ima_update_policy();
Petko Manolov38d859f2015-12-02 17:47:54 +0200424#ifndef CONFIG_IMA_WRITE_POLICY
Mimi Zohar4af46622009-02-04 09:07:00 -0500425 securityfs_remove(ima_policy);
426 ima_policy = NULL;
Petko Manolov38d859f2015-12-02 17:47:54 +0200427#else
428 clear_bit(IMA_FS_BUSY, &ima_fs_flags);
429#endif
Mimi Zohar4af46622009-02-04 09:07:00 -0500430 return 0;
431}
432
Alexey Dobriyan828c0952009-10-01 15:43:56 -0700433static const struct file_operations ima_measure_policy_ops = {
Mimi Zoharf4bd8572009-02-04 09:07:01 -0500434 .open = ima_open_policy,
Mimi Zohar4af46622009-02-04 09:07:00 -0500435 .write = ima_write_policy,
Petko Manolov80eae202015-12-02 17:47:56 +0200436 .read = seq_read,
Arnd Bergmanncdcd90f2010-07-07 23:40:15 +0200437 .release = ima_release_policy,
438 .llseek = generic_file_llseek,
Mimi Zohar4af46622009-02-04 09:07:00 -0500439};
Mimi Zoharbab73932009-02-04 09:06:59 -0500440
Eric Paris932995f2009-05-21 15:43:32 -0400441int __init ima_fs_init(void)
Mimi Zoharbab73932009-02-04 09:06:59 -0500442{
443 ima_dir = securityfs_create_dir("ima", NULL);
444 if (IS_ERR(ima_dir))
445 return -1;
446
447 binary_runtime_measurements =
448 securityfs_create_file("binary_runtime_measurements",
449 S_IRUSR | S_IRGRP, ima_dir, NULL,
450 &ima_measurements_ops);
451 if (IS_ERR(binary_runtime_measurements))
452 goto out;
453
454 ascii_runtime_measurements =
455 securityfs_create_file("ascii_runtime_measurements",
456 S_IRUSR | S_IRGRP, ima_dir, NULL,
457 &ima_ascii_measurements_ops);
458 if (IS_ERR(ascii_runtime_measurements))
459 goto out;
460
461 runtime_measurements_count =
462 securityfs_create_file("runtime_measurements_count",
463 S_IRUSR | S_IRGRP, ima_dir, NULL,
464 &ima_measurements_count_ops);
465 if (IS_ERR(runtime_measurements_count))
466 goto out;
467
468 violations =
469 securityfs_create_file("violations", S_IRUSR | S_IRGRP,
470 ima_dir, NULL, &ima_htable_violations_ops);
471 if (IS_ERR(violations))
472 goto out;
473
Petko Manolov80eae202015-12-02 17:47:56 +0200474 ima_policy = securityfs_create_file("policy", POLICY_FILE_FLAGS,
Mimi Zohar4af46622009-02-04 09:07:00 -0500475 ima_dir, NULL,
476 &ima_measure_policy_ops);
477 if (IS_ERR(ima_policy))
478 goto out;
Mimi Zoharbab73932009-02-04 09:06:59 -0500479
Mimi Zohar4af46622009-02-04 09:07:00 -0500480 return 0;
Mimi Zoharbab73932009-02-04 09:06:59 -0500481out:
Dmitry Kasatkin0ea4f8a2012-01-29 19:19:08 -0500482 securityfs_remove(violations);
Mimi Zoharbab73932009-02-04 09:06:59 -0500483 securityfs_remove(runtime_measurements_count);
484 securityfs_remove(ascii_runtime_measurements);
485 securityfs_remove(binary_runtime_measurements);
486 securityfs_remove(ima_dir);
Mimi Zohar4af46622009-02-04 09:07:00 -0500487 securityfs_remove(ima_policy);
Mimi Zoharbab73932009-02-04 09:06:59 -0500488 return -1;
489}