diff options
author | Roberto Sassu <roberto.sassu@polito.it> | 2014-10-13 08:08:42 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2014-10-13 08:39:02 -0400 |
commit | c2426d2ad5027397342107b7ff094aa9b234acb8 (patch) | |
tree | a94bfc6a99f121a68890388bebbdf8dcc7299ad7 /Documentation/security | |
parent | 1bd7face74391ddfc568b3e638f156da1ed77aa6 (diff) |
ima: added support for new kernel cmdline parameter ima_template_fmt
This patch allows users to provide a custom template format through the
new kernel command line parameter 'ima_template_fmt'. If the supplied
format is not valid, IMA uses the default template descriptor.
Changelog:
- v3:
- added check for 'fields' and 'num_fields' in
template_desc_init_fields() (suggested by Mimi Zohar)
- v2:
- using template_desc_init_fields() to validate a format string
(Roberto Sassu)
- updated documentation by stating that only the chosen template
descriptor is initialized (Roberto Sassu)
- v1:
- simplified code of ima_template_fmt_setup()
(Roberto Sassu, suggested by Mimi Zohar)
Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'Documentation/security')
-rw-r--r-- | Documentation/security/IMA-templates.txt | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/Documentation/security/IMA-templates.txt b/Documentation/security/IMA-templates.txt index a4e102dddfea..839b5dad9226 100644 --- a/Documentation/security/IMA-templates.txt +++ b/Documentation/security/IMA-templates.txt | |||
@@ -27,25 +27,22 @@ Managing templates with these structures is very simple. To support | |||
27 | a new data type, developers define the field identifier and implement | 27 | a new data type, developers define the field identifier and implement |
28 | two functions, init() and show(), respectively to generate and display | 28 | two functions, init() and show(), respectively to generate and display |
29 | measurement entries. Defining a new template descriptor requires | 29 | measurement entries. Defining a new template descriptor requires |
30 | specifying the template format, a string of field identifiers separated | 30 | specifying the template format (a string of field identifiers separated |
31 | by the '|' character. While in the current implementation it is possible | 31 | by the '|' character) through the 'ima_template_fmt' kernel command line |
32 | to define new template descriptors only by adding their definition in the | 32 | parameter. At boot time, IMA initializes the chosen template descriptor |
33 | template specific code (ima_template.c), in a future version it will be | 33 | by translating the format into an array of template fields structures taken |
34 | possible to register a new template on a running kernel by supplying to IMA | 34 | from the set of the supported ones. |
35 | the desired format string. In this version, IMA initializes at boot time | ||
36 | all defined template descriptors by translating the format into an array | ||
37 | of template fields structures taken from the set of the supported ones. | ||
38 | 35 | ||
39 | After the initialization step, IMA will call ima_alloc_init_template() | 36 | After the initialization step, IMA will call ima_alloc_init_template() |
40 | (new function defined within the patches for the new template management | 37 | (new function defined within the patches for the new template management |
41 | mechanism) to generate a new measurement entry by using the template | 38 | mechanism) to generate a new measurement entry by using the template |
42 | descriptor chosen through the kernel configuration or through the newly | 39 | descriptor chosen through the kernel configuration or through the newly |
43 | introduced 'ima_template=' kernel command line parameter. It is during this | 40 | introduced 'ima_template' and 'ima_template_fmt' kernel command line parameters. |
44 | phase that the advantages of the new architecture are clearly shown: | 41 | It is during this phase that the advantages of the new architecture are |
45 | the latter function will not contain specific code to handle a given template | 42 | clearly shown: the latter function will not contain specific code to handle |
46 | but, instead, it simply calls the init() method of the template fields | 43 | a given template but, instead, it simply calls the init() method of the template |
47 | associated to the chosen template descriptor and store the result (pointer | 44 | fields associated to the chosen template descriptor and store the result |
48 | to allocated data and data length) in the measurement entry structure. | 45 | (pointer to allocated data and data length) in the measurement entry structure. |
49 | 46 | ||
50 | The same mechanism is employed to display measurements entries. | 47 | The same mechanism is employed to display measurements entries. |
51 | The functions ima[_ascii]_measurements_show() retrieve, for each entry, | 48 | The functions ima[_ascii]_measurements_show() retrieve, for each entry, |
@@ -86,4 +83,6 @@ currently the following methods are supported: | |||
86 | - select a template descriptor among those supported in the kernel | 83 | - select a template descriptor among those supported in the kernel |
87 | configuration ('ima-ng' is the default choice); | 84 | configuration ('ima-ng' is the default choice); |
88 | - specify a template descriptor name from the kernel command line through | 85 | - specify a template descriptor name from the kernel command line through |
89 | the 'ima_template=' parameter. | 86 | the 'ima_template=' parameter; |
87 | - register a new template descriptor with custom format through the kernel | ||
88 | command line parameter 'ima_template_fmt='. | ||