blob: c71f1de95753d92a37c87fc9eef744f164f683bb [file] [log] [blame]
Thomas Gleixnerb886d83c2019-06-01 10:08:55 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Roberto Sassu3ce1217d2013-06-07 12:16:30 +02002/*
3 * Copyright (C) 2013 Politecnico di Torino, Italy
Alexander A. Klimovc9fecf52020-07-05 23:45:12 +02004 * TORSEC group -- https://security.polito.it
Roberto Sassu3ce1217d2013-06-07 12:16:30 +02005 *
6 * Author: Roberto Sassu <roberto.sassu@polito.it>
7 *
Roberto Sassu3ce1217d2013-06-07 12:16:30 +02008 * File: ima_template_lib.h
9 * Header for the library of supported template fields.
10 */
11#ifndef __LINUX_IMA_TEMPLATE_LIB_H
12#define __LINUX_IMA_TEMPLATE_LIB_H
13
14#include <linux/seq_file.h>
15#include "ima.h"
16
Roberto Sassub17fd9e2017-05-16 14:53:41 +020017#define ENFORCE_FIELDS 0x00000001
18#define ENFORCE_BUFEND 0x00000002
19
Roberto Sassu3ce1217d2013-06-07 12:16:30 +020020void ima_show_template_digest(struct seq_file *m, enum ima_show_type show,
21 struct ima_field_data *field_data);
Roberto Sassu4d7aeee72013-06-07 12:16:32 +020022void ima_show_template_digest_ng(struct seq_file *m, enum ima_show_type show,
23 struct ima_field_data *field_data);
Roberto Sassu3ce1217d2013-06-07 12:16:30 +020024void ima_show_template_string(struct seq_file *m, enum ima_show_type show,
25 struct ima_field_data *field_data);
Mimi Zoharbcbc9b0c2013-07-23 11:15:00 -040026void ima_show_template_sig(struct seq_file *m, enum ima_show_type show,
27 struct ima_field_data *field_data);
Prakhar Srivastava86b4da82019-06-23 23:23:30 -070028void ima_show_template_buf(struct seq_file *m, enum ima_show_type show,
29 struct ima_field_data *field_data);
Roberto Sassucde13912021-05-28 09:38:06 +020030void ima_show_template_uint(struct seq_file *m, enum ima_show_type show,
31 struct ima_field_data *field_data);
Roberto Sassub17fd9e2017-05-16 14:53:41 +020032int ima_parse_buf(void *bufstartp, void *bufendp, void **bufcurp,
33 int maxfields, struct ima_field_data *fields, int *curfields,
34 unsigned long *len_mask, int enforce_mask, char *bufname);
Roberto Sassu23b57412015-04-11 17:09:50 +020035int ima_eventdigest_init(struct ima_event_data *event_data,
Roberto Sassu3ce1217d2013-06-07 12:16:30 +020036 struct ima_field_data *field_data);
Roberto Sassu23b57412015-04-11 17:09:50 +020037int ima_eventname_init(struct ima_event_data *event_data,
Roberto Sassu3ce1217d2013-06-07 12:16:30 +020038 struct ima_field_data *field_data);
Roberto Sassu23b57412015-04-11 17:09:50 +020039int ima_eventdigest_ng_init(struct ima_event_data *event_data,
40 struct ima_field_data *field_data);
Thiago Jung Bauermann3878d502019-06-27 23:19:32 -030041int ima_eventdigest_modsig_init(struct ima_event_data *event_data,
42 struct ima_field_data *field_data);
Roberto Sassu23b57412015-04-11 17:09:50 +020043int ima_eventname_ng_init(struct ima_event_data *event_data,
Roberto Sassu4d7aeee72013-06-07 12:16:32 +020044 struct ima_field_data *field_data);
Roberto Sassu23b57412015-04-11 17:09:50 +020045int ima_eventsig_init(struct ima_event_data *event_data,
Mimi Zoharbcbc9b0c2013-07-23 11:15:00 -040046 struct ima_field_data *field_data);
Prakhar Srivastava86b4da82019-06-23 23:23:30 -070047int ima_eventbuf_init(struct ima_event_data *event_data,
48 struct ima_field_data *field_data);
Thiago Jung Bauermann3878d502019-06-27 23:19:32 -030049int ima_eventmodsig_init(struct ima_event_data *event_data,
50 struct ima_field_data *field_data);
Roberto Sassu026d7fc2021-05-14 17:27:52 +020051int ima_eventevmsig_init(struct ima_event_data *event_data,
52 struct ima_field_data *field_data);
Roberto Sassu7dcfeac2021-05-28 09:38:07 +020053int ima_eventinodeuid_init(struct ima_event_data *event_data,
54 struct ima_field_data *field_data);
55int ima_eventinodegid_init(struct ima_event_data *event_data,
56 struct ima_field_data *field_data);
Roberto Sassuf8216f62021-05-28 09:38:08 +020057int ima_eventinodemode_init(struct ima_event_data *event_data,
58 struct ima_field_data *field_data);
Roberto Sassu8314b672021-06-01 10:23:38 +020059int ima_eventinodexattrnames_init(struct ima_event_data *event_data,
60 struct ima_field_data *field_data);
61int ima_eventinodexattrlengths_init(struct ima_event_data *event_data,
62 struct ima_field_data *field_data);
63int ima_eventinodexattrvalues_init(struct ima_event_data *event_data,
64 struct ima_field_data *field_data);
Roberto Sassu3ce1217d2013-06-07 12:16:30 +020065#endif /* __LINUX_IMA_TEMPLATE_LIB_H */