[oe-commits] [openembedded-core] 23/27: systemd: Fix invalid argument of pstore log entry
git at git.openembedded.org
git at git.openembedded.org
Mon Nov 11 14:15:02 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 3efc2803e2360d430a7819b8377b1d4d55f037a3
Author: Yongxin Liu <yongxin.liu at windriver.com>
AuthorDate: Fri Nov 8 07:16:27 2019 +0800
systemd: Fix invalid argument of pstore log entry
Fix "systemd-pstore: Failed to log pstore entry: Invalid argument"
by backporting 1b3156edd291e0882d80a695d035dd30521345d1 from upstream.
Signed-off-by: Yongxin Liu <yongxin.liu at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
.../systemd/0001-pstore-fix-use-after-free.patch | 39 ++++++++++++++++++++++
meta/recipes-core/systemd/systemd_243.bb | 1 +
2 files changed, 40 insertions(+)
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 0000000..fd147a1
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-pstore-fix-use-after-free.patch
@@ -0,0 +1,39 @@
+From 1b3156edd291e0882d80a695d035dd30521345d1 Mon Sep 17 00:00:00 2001
+From: Michael Olbrich <m.olbrich at pengutronix.de>
+Date: Fri, 6 Sep 2019 15:04:01 +0200
+Subject: [PATCH] pstore: fix use after free
+
+The memory is still needed in the sd_journal_sendv() after the 'if' block.
+
+(cherry picked from commit 1e19f5ac0d680a63eccae7ef1fc6ce225dca0bbf)
+
+Upstream-Status: Backport
+
+Signed-off-by: Yongxin Liu <yongxin.liu at windriver.com>
+---
+ src/pstore/pstore.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c
+index c760b3e899..8ffe523830 100644
+--- a/src/pstore/pstore.c
++++ b/src/pstore/pstore.c
+@@ -117,6 +117,7 @@ static int compare_pstore_entries(const void *_a, const void *_b) {
+
+ static int move_file(PStoreEntry *pe, const char *subdir) {
+ _cleanup_free_ char *ifd_path = NULL, *ofd_path = NULL;
++ _cleanup_free_ void *field = NULL;
+ const char *suffix, *message;
+ struct iovec iovec[2];
+ int n_iovec = 0, r;
+@@ -138,7 +139,6 @@ static int move_file(PStoreEntry *pe, const char *subdir) {
+ iovec[n_iovec++] = IOVEC_MAKE_STRING(message);
+
+ if (pe->content_size > 0) {
+- _cleanup_free_ void *field = NULL;
+ size_t field_size;
+
+ field_size = strlen("FILE=") + pe->content_size;
+--
+2.14.4
+
diff --git a/meta/recipes-core/systemd/systemd_243.bb b/meta/recipes-core/systemd/systemd_243.bb
index 54fcc6a..7935380 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 \
file://0005-rules-watch-metadata-changes-in-ide-devices.patch \
file://0001-unit-file.c-consider-symlink-on-filesystems-like-NFS.patch \
file://99-default.preset \
+ file://0001-pstore-fix-use-after-free.patch \
"
# patches needed by musl
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list