aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-01-27 14:40:12 -0500
committerScott Murray <scott.murray@konsulko.com>2020-01-27 14:51:34 -0500
commita832d1446c416cbc2679ba33404bd9a32540c597 (patch)
tree7e0c8287f69ee50e2600a1754b7c6344e8a9e6c4
parent377512d344dbdfea93060ee5c00f923c69c884b2 (diff)
meta-agl-profile-core: add patch for systemd-udevd SECLABEL crash
Add a patch to fix a systemd-udevd crash when parsing SECLABEL tokens in udev rules. The issue was introduced by a rewrite of the rules parser in systemd v243. The patch will be upstreamed to hopefully go into one of the v243.x systemd-stable releases. Bug-AGL: SPEC-2932 Change-Id: I9a8c3cf3c386290b8ede6b5fd7319c590322bc16 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
-rw-r--r--meta-agl-profile-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch34
-rw-r--r--meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend1
2 files changed, 35 insertions, 0 deletions
diff --git a/meta-agl-profile-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch b/meta-agl-profile-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch
new file mode 100644
index 000000000..29165b58e
--- /dev/null
+++ b/meta-agl-profile-core/recipes-core/systemd/systemd/0001-fix-udevd-seclabel-parsing.patch
@@ -0,0 +1,34 @@
+Fix udevd SECLABEL token parsing
+
+The udevd rules parsing rewrite in v243 broke SECLABEL parsing,
+with the result being that udevd crashes when it parses a line
+containing a SECLABEL token. Fix the handling of the attribute
+of SECLABEL tokens when parsing, and add a check to prevent
+crashes if the attribute is missing.
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
+index efea16e5c5..3e757ccb06 100644
+--- a/src/udev/udev-rules.c
++++ b/src/udev/udev-rules.c
+@@ -918,7 +918,7 @@ static int parse_token(UdevRules *rules, const char *key, char *attr, UdevRuleOp
+ op = OP_ASSIGN;
+ }
+
+- r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, NULL);
++ r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, attr);
+ } else if (streq(key, "RUN")) {
+ if (is_match || op == OP_REMOVE)
+ return log_token_invalid_op(rules, key);
+@@ -1927,6 +1927,8 @@ static int udev_rule_apply_token_to_event(
+ _cleanup_free_ char *name = NULL, *label = NULL;
+ char label_str[UTIL_LINE_SIZE] = {};
+
++ if (!token->data)
++ break;
+ name = strdup((const char*) token->data);
+ if (!name)
+ return log_oom();
diff --git a/meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend b/meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend
index 2d1427366..d77bf7bf1 100644
--- a/meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend
+++ b/meta-agl-profile-core/recipes-core/systemd/systemd_%.bbappend
@@ -1,6 +1,7 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "\
+ file://0001-fix-udevd-seclabel-parsing.patch \
file://e2fsck.conf \
file://canbus-can.network \
${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','file://wired.network','',d)} \