mirror of
https://github.com/systemd/systemd.git
synced 2025-03-28 02:50:16 +03:00
do not allow kernel properties to be set by udev rules
This commit is contained in:
parent
52dd9ef2ef
commit
ace6bfa725
@ -1385,6 +1385,26 @@ static int add_rule(struct udev_rules *rules, char *line,
|
||||
if (rule_add_key(&rule_tmp, TK_M_ENV, op, value, attr) != 0)
|
||||
goto invalid;
|
||||
} else {
|
||||
static const char *blacklist[] = {
|
||||
"ACTION",
|
||||
"SUBSYSTEM",
|
||||
"DEVTYPE",
|
||||
"MAJOR",
|
||||
"MINOR",
|
||||
"DRIVER",
|
||||
"IFINDEX",
|
||||
"DEVNAME",
|
||||
"DEVLINKS",
|
||||
"DEVPATH",
|
||||
"TAGS",
|
||||
};
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(blacklist); i++)
|
||||
if (strcmp(attr, blacklist[i]) == 0) {
|
||||
err(rules->udev, "invalid ENV attribute, '%s' can not be set %s:%u\n", attr, filename, lineno);
|
||||
continue;
|
||||
}
|
||||
if (rule_add_key(&rule_tmp, TK_A_ENV, op, value, attr) != 0)
|
||||
goto invalid;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user