mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
driver core: Limit the messages on a refused uevent
A write to a "uevent" file which is no valid action makes
kobject_synth_uevent() print a warning and uevent_store() an error every
time. This is generally considered a bad thing so rate limit these
messages.
Fixes: b0e37c0d8a ("net-sysfs: make sure objects belong to container's owner")
Cc: stable <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Link: https://patch.msgid.link/2026102718-conduit-glorious-a8dc@gregkh
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0cc3ad8f4d
commit
a01c8e5b1d
+3
-1
@@ -2847,7 +2847,9 @@ static ssize_t uevent_store(struct device *dev, const struct device_attribute *a
|
||||
rc = kobject_synth_uevent(&dev->kobj, buf, count);
|
||||
|
||||
if (rc) {
|
||||
dev_err(dev, "uevent: failed to send synthetic uevent: %d\n", rc);
|
||||
dev_err_ratelimited(dev,
|
||||
"uevent: failed to send synthetic uevent: %d\n",
|
||||
rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -223,9 +223,9 @@ int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count)
|
||||
out:
|
||||
if (r) {
|
||||
devpath = kobject_get_path(kobj, GFP_KERNEL);
|
||||
pr_warn("synth uevent: %s: %s\n",
|
||||
devpath ?: "unknown device",
|
||||
msg ?: "failed to send uevent");
|
||||
pr_warn_ratelimited("synth uevent: %s: %s\n",
|
||||
devpath ?: "unknown device",
|
||||
msg ?: "failed to send uevent");
|
||||
kfree(devpath);
|
||||
}
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user