summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-07-18 21:19:00 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-07-18 21:19:00 +0200
commitace6bfa72525089790b773ab0178e6d1a129357f (patch)
tree68eaf16fbe8a392794d8775404c993091c9a6873 /udev
parent52dd9ef2efd3b0392fed505fe4af7c18cb7daa35 (diff)
do not allow kernel properties to be set by udev rules
Diffstat (limited to 'udev')
-rw-r--r--udev/udev-rules.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index 7db0767303..89d98248a1 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -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;
}