]> git.baikalelectronics.ru Git - kernel.git/commit
IMA: Defined delayed workqueue to free the queued keys
authorLakshmi Ramasubramanian <nramas@linux.microsoft.com>
Thu, 23 Jan 2020 01:32:06 +0000 (17:32 -0800)
committerMimi Zohar <zohar@linux.ibm.com>
Thu, 23 Jan 2020 12:37:31 +0000 (07:37 -0500)
commit1eb8a401f63a616bd1816baee09b4a468174798a
tree3290001b6ae913d289b6eedb60f59acce50d64bf
parent5d96a3ac43fb4f3afc83d9a5500b4d402c6b6577
IMA: Defined delayed workqueue to free the queued keys

Keys queued for measurement should be freed if a custom IMA policy
was not loaded.  Otherwise, the keys will remain queued forever
consuming kernel memory.

This patch defines a delayed workqueue to handle the above scenario.
The workqueue handler is setup to execute 5 minutes after IMA
initialization is completed.

If a custom IMA policy is loaded before the workqueue handler is
scheduled to execute, the workqueue task is cancelled and any queued keys
are processed for measurement.  But if a custom policy was not loaded then
the queued keys are just freed when the delayed workqueue handler is run.

Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Reported-by: kernel test robot <rong.a.chen@intel.com> # sleeping
function called from invalid context
Reported-by: kbuild test robot <lkp@intel.com> # redefinition of
ima_init_key_queue() function.
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/ima/ima.h
security/integrity/ima/ima_init.c
security/integrity/ima/ima_queue_keys.c