diff options
author | Dmitry Kasatkin <d.kasatkin@samsung.com> | 2014-07-02 08:12:26 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2014-09-09 10:28:44 -0400 |
commit | d9a2e5d788d39f7593e2af5e1a365e2b9300679f (patch) | |
tree | cf1f4fba8aa27d2e80cd8ac9036ecab28295c6b1 /security/integrity | |
parent | 3034a146820c26fe6da66a45f6340fe87fe0983a (diff) |
integrity: prevent flooding with 'Request for unknown key'
If file has IMA signature, IMA in enforce mode, but key is missing
then file access is blocked and single error message is printed.
If IMA appraisal is enabled in fix mode, then system runs as usual
but might produce tons of 'Request for unknown key' messages.
This patch switches 'pr_warn' to 'pr_err_ratelimited'.
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity')
-rw-r--r-- | security/integrity/digsig_asymmetric.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/integrity/digsig_asymmetric.c b/security/integrity/digsig_asymmetric.c index 9eae4809006b..37e0d98517a8 100644 --- a/security/integrity/digsig_asymmetric.c +++ b/security/integrity/digsig_asymmetric.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
14 | 14 | ||
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <linux/ratelimit.h> | ||
16 | #include <linux/key-type.h> | 17 | #include <linux/key-type.h> |
17 | #include <crypto/public_key.h> | 18 | #include <crypto/public_key.h> |
18 | #include <keys/asymmetric-type.h> | 19 | #include <keys/asymmetric-type.h> |
@@ -45,8 +46,8 @@ static struct key *request_asymmetric_key(struct key *keyring, uint32_t keyid) | |||
45 | } | 46 | } |
46 | 47 | ||
47 | if (IS_ERR(key)) { | 48 | if (IS_ERR(key)) { |
48 | pr_warn("Request for unknown key '%s' err %ld\n", | 49 | pr_err_ratelimited("Request for unknown key '%s' err %ld\n", |
49 | name, PTR_ERR(key)); | 50 | name, PTR_ERR(key)); |
50 | switch (PTR_ERR(key)) { | 51 | switch (PTR_ERR(key)) { |
51 | /* Hide some search errors */ | 52 | /* Hide some search errors */ |
52 | case -EACCES: | 53 | case -EACCES: |