diff options
| author | Yongxin Liu <yongxin.liu@windriver.com> | 2019-11-08 07:16:27 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-14 13:20:59 +0000 |
| commit | 00736266f25183950d17cd886bba82bf3780c0dc (patch) | |
| tree | 5695f7fdb974ef8eb6174875bd74ebfbafb4ca8a | |
| parent | 621b10f0075bc5d499a2151661c6e1a414f12953 (diff) | |
| download | poky-00736266f25183950d17cd886bba82bf3780c0dc.tar.gz | |
systemd: Fix invalid argument of pstore log entry
Fix "systemd-pstore: Failed to log pstore entry: Invalid argument"
by backporting 1b3156edd291e0882d80a695d035dd30521345d1 from upstream.
(From OE-Core rev: f97252d74ea2dbe2783ec65d68fe5c98362f4b3f)
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-core/systemd/systemd/0001-pstore-fix-use-after-free.patch | 39 | ||||
| -rw-r--r-- | meta/recipes-core/systemd/systemd_243.bb | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-pstore-fix-use-after-free.patch b/meta/recipes-core/systemd/systemd/0001-pstore-fix-use-after-free.patch new file mode 100644 index 0000000000..fd147a18be --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-pstore-fix-use-after-free.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 1b3156edd291e0882d80a695d035dd30521345d1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Michael Olbrich <m.olbrich@pengutronix.de> | ||
| 3 | Date: Fri, 6 Sep 2019 15:04:01 +0200 | ||
| 4 | Subject: [PATCH] pstore: fix use after free | ||
| 5 | |||
| 6 | The memory is still needed in the sd_journal_sendv() after the 'if' block. | ||
| 7 | |||
| 8 | (cherry picked from commit 1e19f5ac0d680a63eccae7ef1fc6ce225dca0bbf) | ||
| 9 | |||
| 10 | Upstream-Status: Backport | ||
| 11 | |||
| 12 | Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com> | ||
| 13 | --- | ||
| 14 | src/pstore/pstore.c | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c | ||
| 18 | index c760b3e899..8ffe523830 100644 | ||
| 19 | --- a/src/pstore/pstore.c | ||
| 20 | +++ b/src/pstore/pstore.c | ||
| 21 | @@ -117,6 +117,7 @@ static int compare_pstore_entries(const void *_a, const void *_b) { | ||
| 22 | |||
| 23 | static int move_file(PStoreEntry *pe, const char *subdir) { | ||
| 24 | _cleanup_free_ char *ifd_path = NULL, *ofd_path = NULL; | ||
| 25 | + _cleanup_free_ void *field = NULL; | ||
| 26 | const char *suffix, *message; | ||
| 27 | struct iovec iovec[2]; | ||
| 28 | int n_iovec = 0, r; | ||
| 29 | @@ -138,7 +139,6 @@ static int move_file(PStoreEntry *pe, const char *subdir) { | ||
| 30 | iovec[n_iovec++] = IOVEC_MAKE_STRING(message); | ||
| 31 | |||
| 32 | if (pe->content_size > 0) { | ||
| 33 | - _cleanup_free_ void *field = NULL; | ||
| 34 | size_t field_size; | ||
| 35 | |||
| 36 | field_size = strlen("FILE=") + pe->content_size; | ||
| 37 | -- | ||
| 38 | 2.14.4 | ||
| 39 | |||
diff --git a/meta/recipes-core/systemd/systemd_243.bb b/meta/recipes-core/systemd/systemd_243.bb index 54fcc6a5d1..7935380e78 100644 --- a/meta/recipes-core/systemd/systemd_243.bb +++ b/meta/recipes-core/systemd/systemd_243.bb | |||
| @@ -24,6 +24,7 @@ SRC_URI += "file://touchscreen.rules \ | |||
| 24 | file://0005-rules-watch-metadata-changes-in-ide-devices.patch \ | 24 | file://0005-rules-watch-metadata-changes-in-ide-devices.patch \ |
| 25 | file://0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch \ | 25 | file://0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch \ |
| 26 | file://99-default.preset \ | 26 | file://99-default.preset \ |
| 27 | file://0001-pstore-fix-use-after-free.patch \ | ||
| 27 | " | 28 | " |
| 28 | 29 | ||
| 29 | # patches needed by musl | 30 | # patches needed by musl |
