[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20070427224104.386d8eab@the-village.bc.nu>
Date: Fri, 27 Apr 2007 22:41:04 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: torvalds@...l.org
Cc: linux-kernel@...r.kernel.org
Subject: Re: Driver core: warn when userspace writes to the uevent file in a
non-supported way
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -296,6 +296,9 @@ out:
> static ssize_t store_uevent(struct device *dev, struct device_attribute *attr,
> const char *buf, size_t count)
> {
> + if (memcmp(buf, "add", 3) != 0)
> + dev_err(dev, "uevent: unsupported action-string; this will "
> + "be ignored in a future kernel version");
> kobject_uevent(&dev->kobj, KOBJ_ADD);
> return count;
> }
And checking for "add" without actually checking if count >= 3 is very
ugly style indeed. Not afaict any kind of security risk as the next 3
bytes are always going to be readable
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists