diff options
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.patch | 30 |
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 @@ | |||
1 | Origin: https://github.com/OpenSC/OpenSC/commit/c449a181a6988cc1e8dc8764d23574e48cdc3fa6 | ||
2 | From: =?UTF-8?q?Veronika=20Hanul=C3=ADkov=C3=A1?= <vhanulik@redhat.com> | ||
3 | Date: Mon, 19 Jun 2023 16:14:51 +0200 | ||
4 | Subject: pkcs15-cflex: check path length to prevent underflow | ||
5 | |||
6 | Thanks OSS-Fuzz | ||
7 | https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58932 | ||
8 | CVE: CVE-2023-40661 | ||
9 | Upstream-Status: Backport [https://salsa.debian.org/opensc-team/opensc/-/commit/8026fb4ca0ed53d970c6c497252eb264d4192d50] | ||
10 | Signed-off-by: Virendra Thakur <virendrak@kpit.com> | ||
11 | Comment: Hunk refreshed based on codebase. | ||
12 | --- | ||
13 | src/pkcs15init/pkcs15-cflex.c | 3 +++ | ||
14 | 1 file changed, 3 insertions(+) | ||
15 | |||
16 | diff --git a/src/pkcs15init/pkcs15-cflex.c b/src/pkcs15init/pkcs15-cflex.c | ||
17 | index 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 | |||