LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: Driver core: warn when userspace writes to the uevent file in a non-supported way
[not found] <200704272059.l3RKxUYn024215@hera.kernel.org>
@ 2007-04-27 21:34 ` Alan Cox
2007-04-27 21:41 ` Alan Cox
1 sibling, 0 replies; 2+ messages in thread
From: Alan Cox @ 2007-04-27 21:34 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: torvalds
> In the future we will allow the uevent type to be written to the uevent
> file to trigger the different types of uevents. But for now, as we only
> support the ADD event, warn if userspace tries to write anything else to
> this file.
>
> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> ---
> drivers/base/core.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 72c6ee5..f69305c 100644
> --- 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");
Warnings good, lack of rate limiting extremely bad indeed.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Driver core: warn when userspace writes to the uevent file in a non-supported way
[not found] <200704272059.l3RKxUYn024215@hera.kernel.org>
2007-04-27 21:34 ` Driver core: warn when userspace writes to the uevent file in a non-supported way Alan Cox
@ 2007-04-27 21:41 ` Alan Cox
1 sibling, 0 replies; 2+ messages in thread
From: Alan Cox @ 2007-04-27 21:41 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
> --- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-27 21:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200704272059.l3RKxUYn024215@hera.kernel.org>
2007-04-27 21:34 ` Driver core: warn when userspace writes to the uevent file in a non-supported way Alan Cox
2007-04-27 21:41 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).