diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2022-11-16 09:51:56 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-24 15:30:00 +0000 |
| commit | 277e97deb2e4f87aaed5ae52e28035ffb72866fc (patch) | |
| tree | 02b8546433efa38568d0bebec62b978013788296 | |
| parent | 24f6bf271ba71ce54dc01af7628abdb36687936e (diff) | |
| download | poky-277e97deb2e4f87aaed5ae52e28035ffb72866fc.tar.gz | |
systemd: CVE-2022-3821 Fix buffer overrun
Upstream-Status: Backport from https://github.com/systemd/systemd-stable/commit/72d4c15a946d20143cd4c6783c802124bc894dc7
Affects "systemd <= 251"
(From OE-Core rev: 4a29ef039897e2d45e5c0b7416ce30a22b668453)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/systemd/systemd/CVE-2022-3821.patch | 45 | ||||
| -rw-r--r-- | meta/recipes-core/systemd/systemd_250.5.bb | 1 |
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/CVE-2022-3821.patch b/meta/recipes-core/systemd/systemd/CVE-2022-3821.patch new file mode 100644 index 0000000000..eb8b0cba12 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/CVE-2022-3821.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From bff52d96598956163d73b7c7bdec7b0ad5b3c2d4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 3 | Date: Tue, 15 Nov 2022 16:52:03 +0530 | ||
| 4 | Subject: [PATCH] CVE-2022-3821 | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://github.com/systemd/systemd-stable/commit/72d4c15a946d20143cd4c6783c802124bc894dc7] | ||
| 7 | CVE: CVE-2022-3821 | ||
| 8 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 9 | --- | ||
| 10 | src/basic/time-util.c | 2 +- | ||
| 11 | src/test/test-time-util.c | 5 +++++ | ||
| 12 | 2 files changed, 6 insertions(+), 1 deletion(-) | ||
| 13 | |||
| 14 | diff --git a/src/basic/time-util.c b/src/basic/time-util.c | ||
| 15 | index b659d6905d..89dc593d44 100644 | ||
| 16 | --- a/src/basic/time-util.c | ||
| 17 | +++ b/src/basic/time-util.c | ||
| 18 | @@ -588,7 +588,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) { | ||
| 19 | t = b; | ||
| 20 | } | ||
| 21 | |||
| 22 | - n = MIN((size_t) k, l); | ||
| 23 | + n = MIN((size_t) k, l-1); | ||
| 24 | |||
| 25 | l -= n; | ||
| 26 | p += n; | ||
| 27 | diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c | ||
| 28 | index 4d0131827e..8db6b25279 100644 | ||
| 29 | --- a/src/test/test-time-util.c | ||
| 30 | +++ b/src/test/test-time-util.c | ||
| 31 | @@ -238,6 +238,11 @@ TEST(format_timespan) { | ||
| 32 | test_format_timespan_accuracy(1); | ||
| 33 | test_format_timespan_accuracy(USEC_PER_MSEC); | ||
| 34 | test_format_timespan_accuracy(USEC_PER_SEC); | ||
| 35 | + | ||
| 36 | + /* See issue #23928. */ | ||
| 37 | + _cleanup_free_ char *buf; | ||
| 38 | + assert_se(buf = new(char, 5)); | ||
| 39 | + assert_se(buf == format_timespan(buf, 5, 100005, 1000)); | ||
| 40 | } | ||
| 41 | |||
| 42 | TEST(verify_timezone) { | ||
| 43 | -- | ||
| 44 | 2.25.1 | ||
| 45 | |||
diff --git a/meta/recipes-core/systemd/systemd_250.5.bb b/meta/recipes-core/systemd/systemd_250.5.bb index 5d568f639e..8b6d0e8580 100644 --- a/meta/recipes-core/systemd/systemd_250.5.bb +++ b/meta/recipes-core/systemd/systemd_250.5.bb | |||
| @@ -25,6 +25,7 @@ SRC_URI += "file://touchscreen.rules \ | |||
| 25 | file://0003-implment-systemd-sysv-install-for-OE.patch \ | 25 | file://0003-implment-systemd-sysv-install-for-OE.patch \ |
| 26 | file://0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \ | 26 | file://0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \ |
| 27 | file://0001-resolve-Use-sockaddr-pointer-type-for-bind.patch \ | 27 | file://0001-resolve-Use-sockaddr-pointer-type-for-bind.patch \ |
| 28 | file://CVE-2022-3821.patch \ | ||
| 28 | " | 29 | " |
| 29 | 30 | ||
| 30 | # patches needed by musl | 31 | # patches needed by musl |
