]> git.baikalelectronics.ru Git - kernel.git/commit
IMA: pre-allocate buffer to hold keyrings string
authorLakshmi Ramasubramanian <nramas@linux.microsoft.com>
Fri, 17 Jan 2020 02:18:21 +0000 (18:18 -0800)
committerMimi Zohar <zohar@linux.ibm.com>
Wed, 22 Jan 2020 20:22:51 +0000 (15:22 -0500)
commita5812ae2793312f77b1bf2ba89427815eb5bea81
tree5cdbb1770166ce93e3e1a3e736d3ae0dfa0bfcf7
parent26c1c2fa68738588165c68635dbbb0874b107686
IMA: pre-allocate buffer to hold keyrings string

ima_match_keyring() is called while holding rcu read lock. Since this
function executes in atomic context, it should not call any function
that can sleep (such as kstrdup()).

This patch pre-allocates a buffer to hold the keyrings string read from
the IMA policy and uses that to match the given keyring.

Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Fixes: 67a14b20a6be ("IMA: Add support to limit measuring keys")
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/ima/ima_policy.c