diff options
| author | Peter Marko <peter.marko@siemens.com> | 2024-12-24 13:44:15 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-12-24 08:23:09 -0800 |
| commit | c048c0410133241b2cfbb3d2cbeb532afff99e58 (patch) | |
| tree | 6650fc51ce5838b8700abc231e5c574cb7466b1c | |
| parent | 9ff3f634f9768c44295c2abb563115c033a7d495 (diff) | |
| download | meta-openembedded-c048c0410133241b2cfbb3d2cbeb532afff99e58.tar.gz | |
libconfuse: patch CVE-2022-40320
Pick patch per [1] poiting to [2] pointing to [3].
[1] https://nvd.nist.gov/vuln/detail/CVE-2022-40320
[2] https://github.com/libconfuse/libconfuse/issues/163
[3] https://github.com/libconfuse/libconfuse/commit/d73777c2c3566fb2647727bb56d9a2295b81669b
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rwxr-xr-x | meta-oe/recipes-support/libconfuse/files/CVE-2022-40320.patch | 42 | ||||
| -rw-r--r-- | meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb | 1 |
2 files changed, 43 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libconfuse/files/CVE-2022-40320.patch b/meta-oe/recipes-support/libconfuse/files/CVE-2022-40320.patch new file mode 100755 index 0000000000..52296b9c0f --- /dev/null +++ b/meta-oe/recipes-support/libconfuse/files/CVE-2022-40320.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From d73777c2c3566fb2647727bb56d9a2295b81669b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Joachim Wiberg <troglobit@gmail.com> | ||
| 3 | Date: Fri, 2 Sep 2022 16:12:46 +0200 | ||
| 4 | Subject: [PATCH] Fix #163: unterminated username used with getpwnam() | ||
| 5 | |||
| 6 | Signed-off-by: Joachim Wiberg <troglobit@gmail.com> | ||
| 7 | |||
| 8 | CVE: CVE-2022-40320 | ||
| 9 | Upstream-Status: Backport [https://github.com/libconfuse/libconfuse/commit/d73777c2c3566fb2647727bb56d9a2295b81669b] | ||
| 10 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 11 | --- | ||
| 12 | src/confuse.c | 9 ++++++--- | ||
| 13 | 1 file changed, 6 insertions(+), 3 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/src/confuse.c b/src/confuse.c | ||
| 16 | index 6d1fdbd..05566b5 100644 | ||
| 17 | --- a/src/confuse.c | ||
| 18 | +++ b/src/confuse.c | ||
| 19 | @@ -1872,17 +1872,20 @@ DLLIMPORT char *cfg_tilde_expand(const char *filename) | ||
| 20 | file = filename + 1; | ||
| 21 | } else { | ||
| 22 | /* ~user or ~user/path */ | ||
| 23 | - char *user; | ||
| 24 | + char *user; /* ~user or ~user/path */ | ||
| 25 | + size_t len; | ||
| 26 | |||
| 27 | file = strchr(filename, '/'); | ||
| 28 | if (file == 0) | ||
| 29 | file = filename + strlen(filename); | ||
| 30 | |||
| 31 | - user = malloc(file - filename); | ||
| 32 | + len = file - filename - 1; | ||
| 33 | + user = malloc(len + 1); | ||
| 34 | if (!user) | ||
| 35 | return NULL; | ||
| 36 | |||
| 37 | - strncpy(user, filename + 1, file - filename - 1); | ||
| 38 | + strncpy(user, &filename[1], len); | ||
| 39 | + user[len] = 0; | ||
| 40 | passwd = getpwnam(user); | ||
| 41 | free(user); | ||
| 42 | } | ||
diff --git a/meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb b/meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb index e6f28c7b69..0e2f1f27b3 100644 --- a/meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb +++ b/meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb | |||
| @@ -6,6 +6,7 @@ SRC_URI = "https://github.com/libconfuse/libconfuse/releases/download/v${PV}/con | |||
| 6 | SRC_URI[sha256sum] = "3a59ded20bc652eaa8e6261ab46f7e483bc13dad79263c15af42ecbb329707b8" | 6 | SRC_URI[sha256sum] = "3a59ded20bc652eaa8e6261ab46f7e483bc13dad79263c15af42ecbb329707b8" |
| 7 | 7 | ||
| 8 | SRC_URI += "file://0001-only-apply-search-path-logic-to-relative-pathnames.patch" | 8 | SRC_URI += "file://0001-only-apply-search-path-logic-to-relative-pathnames.patch" |
| 9 | SRC_URI += "file://CVE-2022-40320.patch" | ||
| 9 | 10 | ||
| 10 | inherit autotools-brokensep pkgconfig gettext | 11 | inherit autotools-brokensep pkgconfig gettext |
| 11 | 12 | ||
