]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Revert "Drop keys-encrypted-add-check-for-strsep.patch"
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 17:28:49 +0000 (09:28 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 17:28:49 +0000 (09:28 -0800)
This reverts commit 33a07f5c5d3861ffc05d28eea8ef87fa3ae75b4f.

We took the revert instead.

queue-6.1/keys-encrypted-add-check-for-strsep.patch [new file with mode: 0644]
queue-6.1/series
queue-6.6/keys-encrypted-add-check-for-strsep.patch [new file with mode: 0644]
queue-6.6/series
queue-6.7/keys-encrypted-add-check-for-strsep.patch [new file with mode: 0644]
queue-6.7/series

diff --git a/queue-6.1/keys-encrypted-add-check-for-strsep.patch b/queue-6.1/keys-encrypted-add-check-for-strsep.patch
new file mode 100644 (file)
index 0000000..1574277
--- /dev/null
@@ -0,0 +1,37 @@
+From 1cf7474886454ac2cc88f561bce4e95c7da2a272 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 8 Nov 2023 07:36:27 +0000
+Subject: KEYS: encrypted: Add check for strsep
+
+From: Chen Ni <nichen@iscas.ac.cn>
+
+[ Upstream commit b4af096b5df5dd131ab796c79cedc7069d8f4882 ]
+
+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>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 1e313982af02..fea7e0937150 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.43.0
+
index 5d4d09942fec6a030a30b5d89e3443296dcce855..d858d70919c44dc683c984a6ea5faa0ba894795a 100644 (file)
@@ -14,6 +14,7 @@ spi-spi-zynqmp-gqspi-fix-driver-kconfig-dependencies.patch
 mtd-rawnand-increment-ifc_timeout_msecs-for-nand-con.patch
 acpi-video-check-for-error-while-searching-for-backl.patch
 acpi-lpit-avoid-u32-multiplication-overflow.patch
+keys-encrypted-add-check-for-strsep.patch
 platform-x86-intel-vsec-enhance-and-export-intel_vse.patch
 platform-x86-intel-vsec-support-private-data.patch
 platform-x86-intel-vsec-use-mutex-for-ida_alloc-and-.patch
diff --git a/queue-6.6/keys-encrypted-add-check-for-strsep.patch b/queue-6.6/keys-encrypted-add-check-for-strsep.patch
new file mode 100644 (file)
index 0000000..c3c1743
--- /dev/null
@@ -0,0 +1,37 @@
+From 95de49cf9fcb150ac38e374d317df70e4dc5fe0f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 8 Nov 2023 07:36:27 +0000
+Subject: KEYS: encrypted: Add check for strsep
+
+From: Chen Ni <nichen@iscas.ac.cn>
+
+[ Upstream commit b4af096b5df5dd131ab796c79cedc7069d8f4882 ]
+
+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>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 1e313982af02..fea7e0937150 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.43.0
+
index 6a190a49ebeae9df6ba35079962fc7a752048be3..17c6e1d1f38130eed367c076373cdb64ae21ad67 100644 (file)
@@ -23,6 +23,7 @@ spi-spi-zynqmp-gqspi-fix-driver-kconfig-dependencies.patch
 mtd-rawnand-increment-ifc_timeout_msecs-for-nand-con.patch
 acpi-video-check-for-error-while-searching-for-backl.patch
 acpi-lpit-avoid-u32-multiplication-overflow.patch
+keys-encrypted-add-check-for-strsep.patch
 spi-cadence-quadspi-add-missing-clk_disable_unprepar.patch
 platform-x86-intel-vsec-fix-xa_alloc-memory-leak.patch
 cpufreq-scmi-process-the-result-of-devm_of_clk_add_h.patch
diff --git a/queue-6.7/keys-encrypted-add-check-for-strsep.patch b/queue-6.7/keys-encrypted-add-check-for-strsep.patch
new file mode 100644 (file)
index 0000000..bd14642
--- /dev/null
@@ -0,0 +1,37 @@
+From 2f847e1f37f817057e8f333ebf66f37c6e682902 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 8 Nov 2023 07:36:27 +0000
+Subject: KEYS: encrypted: Add check for strsep
+
+From: Chen Ni <nichen@iscas.ac.cn>
+
+[ Upstream commit b4af096b5df5dd131ab796c79cedc7069d8f4882 ]
+
+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>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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.43.0
+
index b683237636e0ccf7430330b5612f9a1521055158..9a48d59526d7f90cd49c4e639d8970edc38010ad 100644 (file)
@@ -23,6 +23,7 @@ spi-spi-zynqmp-gqspi-fix-driver-kconfig-dependencies.patch
 mtd-rawnand-increment-ifc_timeout_msecs-for-nand-con.patch
 acpi-video-check-for-error-while-searching-for-backl.patch
 acpi-lpit-avoid-u32-multiplication-overflow.patch
+keys-encrypted-add-check-for-strsep.patch
 spi-cadence-quadspi-add-missing-clk_disable_unprepar.patch
 platform-x86-intel-vsec-fix-xa_alloc-memory-leak.patch
 cpufreq-scmi-process-the-result-of-devm_of_clk_add_h.patch