summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch')
-rw-r--r--meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch
new file mode 100644
index 000000000..e173e6557
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/CVE-2023-40661-5.patch
@@ -0,0 +1,30 @@
1Origin: https://github.com/OpenSC/OpenSC/commit/c449a181a6988cc1e8dc8764d23574e48cdc3fa6
2From: =?UTF-8?q?Veronika=20Hanul=C3=ADkov=C3=A1?= <vhanulik@redhat.com>
3Date: Mon, 19 Jun 2023 16:14:51 +0200
4Subject: pkcs15-cflex: check path length to prevent underflow
5
6Thanks OSS-Fuzz
7https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58932
8CVE: CVE-2023-40661
9Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50]
10Signed-off-by: Virendra Thakur <virendrak@kpit.com>
11Comment: Hunk refreshed based on codebase.
12---
13 src/pkcs15init/pkcs15-cflex.c | 3 +++
14 1 file changed, 3 insertions(+)
15
16diff --git a/src/pkcs15init/pkcs15-cflex.c b/src/pkcs15init/pkcs15-cflex.c
17index d06568073d..ce1d48e62c 100644
18--- a/src/pkcs15init/pkcs15-cflex.c
19+++ b/src/pkcs15init/pkcs15-cflex.c
20@@ -56,6 +56,9 @@
21 int r = 0;
22 /* Select the parent DF */
23 path = df->path;
24+ if (path.len < 2) {
25+ return SC_ERROR_INVALID_ARGUMENTS;
26+ }
27 path.len -= 2;
28 r = sc_select_file(p15card->card, &path, &parent);
29 if (r < 0)
30