[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231108073627.1063464-1-nichen@iscas.ac.cn>
Date: Wed, 8 Nov 2023 07:36:27 +0000
From: Chen Ni <nichen@...as.ac.cn>
To: zohar@...ux.ibm.com, dhowells@...hat.com, jarkko@...nel.org,
paul@...l-moore.com, jmorris@...ei.org, serge@...lyn.com,
sumit.garg@...aro.org, yaelt@...gle.com
Cc: linux-integrity@...r.kernel.org, keyrings@...r.kernel.org,
linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org, Chen Ni <nichen@...as.ac.cn>
Subject: [PATCH] KEYS: encrypted: Add check for strsep
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@...as.ac.cn>
---
security/keys/encrypted-keys/encrypted.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index 8af2136069d2..76f55dd13cb8 100644
--- 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:
--
2.25.1
Powered by blists - more mailing lists