<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security/integrity/ima/ima_init.c, branch v3.13.2</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/security/integrity/ima/ima_init.c?h=v3.13.2</id>
<link rel='self' href='https://git.amat.us/linux/atom/security/integrity/ima/ima_init.c?h=v3.13.2'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-12-03T01:46:56Z</updated>
<entry>
<title>ima: properly free ima_template_entry structures</title>
<updated>2013-12-03T01:46:56Z</updated>
<author>
<name>Roberto Sassu</name>
<email>roberto.sassu@polito.it</email>
</author>
<published>2013-12-02T18:40:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a7ed7c60e14df5b986f93549717235b882643e7e'/>
<id>urn:sha1:a7ed7c60e14df5b986f93549717235b882643e7e</id>
<content type='text'>
The new templates management mechanism records information associated
to an event into an array of 'ima_field_data' structures and makes it
available through the 'template_data' field of the 'ima_template_entry'
structure (the element of the measurements list created by IMA).

Since 'ima_field_data' contains dynamically allocated data (which length
varies depending on the data associated to a selected template field),
it is not enough to just free the memory reserved for a
'ima_template_entry' structure if something goes wrong.

This patch creates the new function ima_free_template_entry() which
walks the array of 'ima_field_data' structures, frees the memory
referenced by the 'data' pointer and finally the space reserved for
the 'ima_template_entry' structure. Further, it replaces existing kfree()
that have a pointer to an 'ima_template_entry' structure as argument
with calls to the new function.

Fixes: a71dc65: ima: switch to new template management mechanism
Signed-off-by: Roberto Sassu &lt;roberto.sassu@polito.it&gt;
Signed-off-by: Mimi Zohar &lt;zohar@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: Do not free 'entry' before it is initialized</title>
<updated>2013-12-03T01:46:32Z</updated>
<author>
<name>Christoph Paasch</name>
<email>christoph.paasch@uclouvain.be</email>
</author>
<published>2013-12-01T23:05:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=09ae6345721afbb7cf3e0920209b140cbe7bff0d'/>
<id>urn:sha1:09ae6345721afbb7cf3e0920209b140cbe7bff0d</id>
<content type='text'>
7bc5f447ce9d0 (ima: define new function ima_alloc_init_template() to
API) moved the initialization of 'entry' in ima_add_boot_aggregate() a
bit more below, after the if (ima_used_chip).

So, 'entry' is not initialized while being inside this if-block. So, we
should not attempt to free it.

Found by Coverity (CID: 1131971)

Fixes: 7bc5f447ce9d0 (ima: define new function ima_alloc_init_template() to API)
Signed-off-by: Christoph Paasch &lt;christoph.paasch@uclouvain.be&gt;
Signed-off-by: Mimi Zohar &lt;zohar@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: extend the measurement list to include the file signature</title>
<updated>2013-11-01T00:19:35Z</updated>
<author>
<name>Mimi Zohar</name>
<email>zohar@linux.vnet.ibm.com</email>
</author>
<published>2013-07-23T15:15:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bcbc9b0cf6d8f340a1d166e414f4612b353f7a9b'/>
<id>urn:sha1:bcbc9b0cf6d8f340a1d166e414f4612b353f7a9b</id>
<content type='text'>
This patch defines a new template called 'ima-sig', which includes
the file signature in the template data, in addition to the file's
digest and pathname.

A template is composed of a set of fields.  Associated with each
field is an initialization and display function.  This patch defines
a new template field called 'sig', the initialization function
ima_eventsig_init(), and the display function ima_show_template_sig().

This patch modifies the .field_init() function definition to include
the 'security.ima' extended attribute and length.

Changelog:
- remove unused code (Dmitry Kasatkin)
- avoid calling ima_write_template_field_data() unnecesarily (Roberto Sassu)
- rename DATA_FMT_SIG to DATA_FMT_HEX
- cleanup ima_eventsig_init() based on Roberto's comments

Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
Signed-off-by: Dmitry Kasatkin &lt;d.kasatkin@samsung.com&gt;
Signed-off-by: Roberto Sassu &lt;roberto.sassu@polito.it&gt;
</content>
</entry>
<entry>
<title>ima: new templates management mechanism</title>
<updated>2013-10-25T21:17:04Z</updated>
<author>
<name>Roberto Sassu</name>
<email>roberto.sassu@polito.it</email>
</author>
<published>2013-06-07T10:16:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=adf53a778a0a5a5dc9103509da4a9719046e5310'/>
<id>urn:sha1:adf53a778a0a5a5dc9103509da4a9719046e5310</id>
<content type='text'>
The original 'ima' template is fixed length, containing the filedata hash
and pathname.  The filedata hash is limited to 20 bytes (md5/sha1).  The
pathname is a null terminated string, limited to 255 characters.  To
overcome these limitations and to add additional file metadata, it is
necessary to extend the current version of IMA by defining additional
templates.

The main reason to introduce this feature is that, each time a new
template is defined, the functions that generate and display the
measurement list would include the code for handling a new format and,
thus, would significantly grow over time.

This patch set solves this problem by separating the template management
from the remaining IMA code. The core of this solution is the definition
of two new data structures: a template descriptor, to determine which
information should be included in the measurement list, and a template
field, to generate and display data of a given type.

To define a new template field, developers define the field identifier
and implement two functions, init() and show(), respectively to generate
and display measurement entries.  Initially, this patch set defines the
following template fields (support for additional data types will be
added later):
 - 'd': the digest of the event (i.e. the digest of a measured file),
        calculated with the SHA1 or MD5 hash algorithm;
 - 'n': the name of the event (i.e. the file name), with size up to
        255 bytes;
 - 'd-ng': the digest of the event, calculated with an arbitrary hash
           algorithm (field format: [&lt;hash algo&gt;:]digest, where the digest
           prefix is shown only if the hash algorithm is not SHA1 or MD5);
 - 'n-ng': the name of the event, without size limitations.

Defining a new template descriptor requires specifying the template format,
a string of field identifiers separated by the '|' character.  This patch
set defines the following template descriptors:
 - "ima": its format is 'd|n';
 - "ima-ng" (default): its format is 'd-ng|n-ng'

Further details about the new template architecture can be found in
Documentation/security/IMA-templates.txt.

Changelog:
- don't defer calling ima_init_template() - Mimi
- don't define ima_lookup_template_desc() until used - Mimi
- squashed with documentation patch - Mimi

Signed-off-by: Roberto Sassu &lt;roberto.sassu@polito.it&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: define new function ima_alloc_init_template() to API</title>
<updated>2013-10-25T21:17:04Z</updated>
<author>
<name>Roberto Sassu</name>
<email>roberto.sassu@polito.it</email>
</author>
<published>2013-06-07T10:16:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7bc5f447ce9d01e19394b5399bf1a4fcebf0f8dd'/>
<id>urn:sha1:7bc5f447ce9d01e19394b5399bf1a4fcebf0f8dd</id>
<content type='text'>
Instead of allocating and initializing the template entry from multiple
places (eg. boot aggregate, violation, and regular measurements), this
patch defines a new function called ima_alloc_init_template().  The new
function allocates and initializes the measurement entry with the inode
digest and the filename.

In respect to the current behavior, it truncates the file name passed
in the 'filename' argument if the latter's size is greater than 255 bytes
and the passed file descriptor is NULL.

Changelog:
- initialize 'hash' variable for non TPM case - Mimi
- conform to expectation for 'iint' to be defined as a pointer. - Mimi
- add missing 'file' dependency for recalculating file hash. - Mimi

Signed-off-by: Roberto Sassu &lt;roberto.sassu@polito.it&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: pass the filename argument up to ima_add_template_entry()</title>
<updated>2013-10-25T21:17:03Z</updated>
<author>
<name>Roberto Sassu</name>
<email>roberto.sassu@polito.it</email>
</author>
<published>2013-06-07T10:16:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9803d413f41db86fdf0097f1af781fe2e68f474c'/>
<id>urn:sha1:9803d413f41db86fdf0097f1af781fe2e68f474c</id>
<content type='text'>
Pass the filename argument to ima_add_template_entry() in order to
eliminate a dependency on template specific data (third argument of
integrity_audit_msg).

This change is required because, with the new template management
mechanism, the generation of a new measurement entry will be performed
by new specific functions (introduced in next patches) and the current IMA
code will not be aware anymore of how data is stored in the entry payload.

Signed-off-by: Roberto Sassu &lt;roberto.sassu@polito.it&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: ima_calc_boot_agregate must use SHA1</title>
<updated>2013-10-25T21:17:02Z</updated>
<author>
<name>Dmitry Kasatkin</name>
<email>d.kasatkin@samsung.com</email>
</author>
<published>2013-06-07T10:16:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=09ef54359c4ad49c01a12503b2c510b424ecf059'/>
<id>urn:sha1:09ef54359c4ad49c01a12503b2c510b424ecf059</id>
<content type='text'>
With multiple hash algorithms, ima_hash_tfm is no longer guaranteed to be sha1.
Need to force to use sha1.

Changelog:
- pass ima_digest_data to ima_calc_boot_aggregate() instead of char *
  (Roberto Sassu);
- create an ima_digest_data structure in ima_add_boot_aggregate()
  (Roberto Sassu);
- pass hash-&gt;algo to ima_alloc_tfm() (Roberto Sassu, reported by Dmitry).
- "move hash definition in ima_add_boot_aggregate()" commit hunk to here.
- sparse warning fix - Fengguang Wu

Signed-off-by: Dmitry Kasatkin &lt;d.kasatkin@samsung.com&gt;
Signed-off-by: Roberto Sassu &lt;roberto.sassu@polito.it&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: differentiate between template hash and file data hash sizes</title>
<updated>2013-10-25T21:17:00Z</updated>
<author>
<name>Mimi Zohar</name>
<email>zohar@linux.vnet.ibm.com</email>
</author>
<published>2013-03-12T00:29:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=140d802240a4ba3351494b4ab199964b96f87493'/>
<id>urn:sha1:140d802240a4ba3351494b4ab199964b96f87493</id>
<content type='text'>
The TPM v1.2 limits the template hash size to 20 bytes.  This
patch differentiates between the template hash size, as defined
in the ima_template_entry, and the file data hash size, as
defined in the ima_template_data.  Subsequent patches add support
for different file data hash algorithms.

Change log:
- hash digest definition in ima_store_template() should be TPM_DIGEST_SIZE

Signed-off-by: Mimi Zohar &lt;zohar@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: use new crypto_shash API instead of old crypto_hash</title>
<updated>2013-02-06T15:41:12Z</updated>
<author>
<name>Dmitry Kasatkin</name>
<email>dmitry.kasatkin@intel.com</email>
</author>
<published>2012-06-08T07:42:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=76bb28f6126f20ee987b9d2570fa653d95d30ae9'/>
<id>urn:sha1:76bb28f6126f20ee987b9d2570fa653d95d30ae9</id>
<content type='text'>
Old crypto hash API internally uses shash API.
Using shash API directly is more efficient.

Signed-off-by: Dmitry Kasatkin &lt;dmitry.kasatkin@intel.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: remove unused cleanup functions</title>
<updated>2012-07-02T20:43:30Z</updated>
<author>
<name>Dmitry Kasatkin</name>
<email>dmitry.kasatkin@intel.com</email>
</author>
<published>2012-06-25T09:18:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c7de7adc18241a0eb10a6e1fed7cb1e01f53c85a'/>
<id>urn:sha1:c7de7adc18241a0eb10a6e1fed7cb1e01f53c85a</id>
<content type='text'>
IMA cannot be used as module and does not need __exit functions.
Removed them.

Signed-off-by: Dmitry Kasatkin &lt;dmitry.kasatkin@intel.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
</feed>
