diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2023-06-26 11:49:14 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-07-01 08:37:24 -1000 |
| commit | 214b973fbd8dd44f488aacd0c17619b7d890e1d8 (patch) | |
| tree | c7b2400f13dfe0fdd60ff5fdb3ad5ad1ff150428 /meta/recipes-support | |
| parent | 92a46e5fff4c455c296c594b9563c46e90448bed (diff) | |
| download | poky-214b973fbd8dd44f488aacd0c17619b7d890e1d8.tar.gz | |
libcap: CVE-2023-2602 Memory Leak on pthread_create() Error
Upstream-Status: Backport from https://git.kernel.org/pub/scm/libs/libcap/libcap.git/patch/?id=bc6b36682f188020ee4770fae1d41bde5b2c97bb
(From OE-Core rev: 7e4f3c51c0bac772bf56f69a3c065b2b2d095335)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-support')
| -rw-r--r-- | meta/recipes-support/libcap/files/CVE-2023-2602.patch | 45 | ||||
| -rw-r--r-- | meta/recipes-support/libcap/libcap_2.66.bb | 1 |
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-support/libcap/files/CVE-2023-2602.patch b/meta/recipes-support/libcap/files/CVE-2023-2602.patch new file mode 100644 index 0000000000..1ad5aeb826 --- /dev/null +++ b/meta/recipes-support/libcap/files/CVE-2023-2602.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From bc6b36682f188020ee4770fae1d41bde5b2c97bb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: "Andrew G. Morgan" <morgan@kernel.org> | ||
| 3 | Date: Wed, 3 May 2023 19:18:36 -0700 | ||
| 4 | Subject: Correct the check of pthread_create()'s return value. | ||
| 5 | |||
| 6 | This function returns a positive number (errno) on error, so the code | ||
| 7 | wasn't previously freeing some memory in this situation. | ||
| 8 | |||
| 9 | Discussion: | ||
| 10 | |||
| 11 | https://stackoverflow.com/a/3581020/14760867 | ||
| 12 | |||
| 13 | Credit for finding this bug in libpsx goes to David Gstir of | ||
| 14 | X41 D-Sec GmbH (https://x41-dsec.de/) who performed a security | ||
| 15 | audit of the libcap source code in April of 2023. The audit | ||
| 16 | was sponsored by the Open Source Technology Improvement Fund | ||
| 17 | (https://ostif.org/). | ||
| 18 | |||
| 19 | Audit ref: LCAP-CR-23-01 (CVE-2023-2602) | ||
| 20 | |||
| 21 | Signed-off-by: Andrew G. Morgan <morgan@kernel.org> | ||
| 22 | |||
| 23 | Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/libcap/libcap.git/patch/?id=bc6b36682f188020ee4770fae1d41bde5b2c97bb] | ||
| 24 | CVE: CVE-2023-2602 | ||
| 25 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 26 | --- | ||
| 27 | psx/psx.c | 2 +- | ||
| 28 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 29 | |||
| 30 | diff --git a/psx/psx.c b/psx/psx.c | ||
| 31 | index d9c0485..65eb2aa 100644 | ||
| 32 | --- a/psx/psx.c | ||
| 33 | +++ b/psx/psx.c | ||
| 34 | @@ -516,7 +516,7 @@ int __wrap_pthread_create(pthread_t *thread, const pthread_attr_t *attr, | ||
| 35 | pthread_sigmask(SIG_BLOCK, &sigbit, NULL); | ||
| 36 | |||
| 37 | int ret = __real_pthread_create(thread, attr, _psx_start_fn, starter); | ||
| 38 | - if (ret == -1) { | ||
| 39 | + if (ret > 0) { | ||
| 40 | psx_new_state(_PSX_CREATE, _PSX_IDLE); | ||
| 41 | memset(starter, 0, sizeof(*starter)); | ||
| 42 | free(starter); | ||
| 43 | -- | ||
| 44 | 2.25.1 | ||
| 45 | |||
diff --git a/meta/recipes-support/libcap/libcap_2.66.bb b/meta/recipes-support/libcap/libcap_2.66.bb index c50e9d8cc7..d3189fb105 100644 --- a/meta/recipes-support/libcap/libcap_2.66.bb +++ b/meta/recipes-support/libcap/libcap_2.66.bb | |||
| @@ -16,6 +16,7 @@ DEPENDS = "hostperl-runtime-native gperf-native" | |||
| 16 | SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \ | 16 | SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \ |
| 17 | file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ | 17 | file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \ |
| 18 | file://0002-tests-do-not-run-target-executables.patch \ | 18 | file://0002-tests-do-not-run-target-executables.patch \ |
| 19 | file://CVE-2023-2602.patch \ | ||
| 19 | " | 20 | " |
| 20 | SRC_URI:append:class-nativesdk = " \ | 21 | SRC_URI:append:class-nativesdk = " \ |
| 21 | file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \ | 22 | file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \ |
