projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f17167b
)
KEYS: encrypted: Add check for strsep
author
Chen Ni
<nichen@iscas.ac.cn>
Wed, 8 Nov 2023 07:36:27 +0000
(07:36 +0000)
committer
Mimi Zohar
<zohar@linux.ibm.com>
Mon, 27 Nov 2023 17:44:47 +0000
(12:44 -0500)
Add check for strsep() in order to transfer the error.
Fixes: cd3bc044af48 ("KEYS: encrypted: Instantiate key with user-provided decrypted data")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/keys/encrypted-keys/encrypted.c
patch
|
blob
|
history
diff --git
a/security/keys/encrypted-keys/encrypted.c
b/security/keys/encrypted-keys/encrypted.c
index 8af2136069d239129c2994e5ee0f3e9b696ed7ea..76f55dd13cb801078ba71079bf7e1c58eb2ada3b 100644
(file)
--- a/
security/keys/encrypted-keys/encrypted.c
+++ b/
security/keys/encrypted-keys/encrypted.c
@@
-237,6
+237,10
@@
static int datablob_parse(char *datablob, const char **format,
break;
}
*decrypted_data = strsep(&datablob, " \t");
+ if (!*decrypted_data) {
+ pr_info("encrypted_key: decrypted_data is missing\n");
+ break;
+ }
ret = 0;
break;
case Opt_load: