1 Fix udevd SECLABEL token parsing
3 The udevd rules parsing rewrite in v243 broke SECLABEL parsing,
4 with the result being that udevd crashes when it parses a line
5 containing a SECLABEL token. Fix the handling of the attribute
6 of SECLABEL tokens when parsing, and add a check to prevent
7 crashes if the attribute is missing.
9 Upstream-Status: Pending
11 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
13 diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
14 index efea16e5c5..3e757ccb06 100644
15 --- a/src/udev/udev-rules.c
16 +++ b/src/udev/udev-rules.c
17 @@ -918,7 +918,7 @@ static int parse_token(UdevRules *rules, const char *key, char *attr, UdevRuleOp
21 - r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, NULL);
22 + r = rule_line_add_token(rule_line, TK_A_SECLABEL, op, value, attr);
23 } else if (streq(key, "RUN")) {
24 if (is_match || op == OP_REMOVE)
25 return log_token_invalid_op(rules, key);
26 @@ -1927,6 +1927,8 @@ static int udev_rule_apply_token_to_event(
27 _cleanup_free_ char *name = NULL, *label = NULL;
28 char label_str[UTIL_LINE_SIZE] = {};
32 name = strdup((const char*) token->data);