linux/security/integrity/ima
Dmitry Kasatkin 0716abbb58 ima: use atomic bit operations to protect policy update interface
The current implementation uses an atomic counter to provide exclusive
access to the sysfs 'policy' entry to update the IMA policy. While it is
highly unlikely, the usage of a counter might potentially allow another
process to overflow the counter, open the interface and insert additional
rules into the policy being loaded.

This patch replaces using an atomic counter with atomic bit operations
which is more reliable and a widely used method to provide exclusive access.

As bit operation keep the interface locked after successful update, it makes
it unnecessary to verify if the default policy was set or not during parsing
and interface closing. This patch also removes that code.

Changes in v3:
* move audit log message to ima_relead_policy() to report successful and
  unsuccessful result
* unnecessary comment removed

Changes in v2:
* keep interface locked after successful policy load as in original design
* remove sysfs entry as in original design

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
2014-10-11 23:33:02 -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: use atomic bit operations to protect policy update interface 2014-10-11 23:33:02 -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: initialize only required template 2014-09-09 10:28:54 -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