Skip to content

Commit 8c2f516

Browse files
bmenegmimizohar
authored andcommitted
integrity: include keyring name for unknown key request
Depending on the IMA policy rule a key may be searched for in multiple keyrings (e.g. .ima and .platform) and possibly not found. This patch improves feedback by including the keyring "description" (name) in the error message. Signed-off-by: Bruno Meneguele <bmeneg@redhat.com> [zohar@linux.ibm.com: updated commit message] Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
1 parent e4d7e2d commit 8c2f516

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

security/integrity/digsig_asymmetric.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,14 @@ static struct key *request_asymmetric_key(struct key *keyring, uint32_t keyid)
5555
}
5656

5757
if (IS_ERR(key)) {
58-
pr_err_ratelimited("Request for unknown key '%s' err %ld\n",
59-
name, PTR_ERR(key));
58+
if (keyring)
59+
pr_err_ratelimited("Request for unknown key '%s' in '%s' keyring. err %ld\n",
60+
name, keyring->description,
61+
PTR_ERR(key));
62+
else
63+
pr_err_ratelimited("Request for unknown key '%s' err %ld\n",
64+
name, PTR_ERR(key));
65+
6066
switch (PTR_ERR(key)) {
6167
/* Hide some search errors */
6268
case -EACCES:

0 commit comments

Comments
 (0)