linux/security/integrity/ima
Roberto Sassu 9f3166b8ca ima: don't allocate a copy of template_fmt in template_desc_init_fields()
This patch removes the allocation of a copy of 'template_fmt', needed for
iterating over all fields in the passed template format string. The removal
was possible by replacing strcspn(), which modifies the passed string,
with strchrnul(). The currently processed template field is copied in
a temporary variable.

The purpose of this change is use template_desc_init_fields() in two ways:
for just validating a template format string (the function should work
if called by a setup function, when memory cannot be allocated), and for
actually initializing a template descriptor. The implementation of this
feature will be complete with the next patch.

Changelog:
 - v3:
   - added 'goto out' in template_desc_init_fields() to free allocated
     memory if a template field length is not valid (suggested by
     Mimi Zohar)

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
2014-10-13 08:39:01 -04:00
..
ima_api.c ima: use path names cache 2014-10-07 14:32:54 -04:00
ima_appraise.c ima: added ima_policy_flag variable 2014-09-17 16:39:36 -04:00
ima_crypto.c ima: add missing '__init' keywords 2014-09-09 10:28:50 -04:00
ima_fs.c ima: display template format in meas. list if template name length is zero 2014-10-13 08:39:01 -04:00
ima_init.c ima: return an error code from ima_add_boot_aggregate() 2014-09-17 16:15:42 -04:00
ima_main.c ima: use path names cache 2014-10-07 14:32:54 -04:00
ima_policy.c ima: use atomic bit operations to protect policy update interface 2014-10-11 23:33:02 -04:00
ima_queue.c integrity: fix checkpatch errors 2014-03-07 12:15:45 -05:00
ima_template_lib.c ima: reduce memory usage when a template containing the n field is used 2014-03-07 11:32:30 -05:00
ima_template_lib.h ima: extend the measurement list to include the file signature 2013-10-31 20:19:35 -04:00
ima_template.c ima: don't allocate a copy of template_fmt in template_desc_init_fields() 2014-10-13 08:39:01 -04:00
ima.h ima: added ima_policy_flag variable 2014-09-17 16:39:36 -04:00
Kconfig integrity: base integrity subsystem kconfig options on integrity 2014-09-09 10:28:56 -04:00
Makefile ima: define template fields library and new helpers 2013-10-25 17:17:05 -04:00