summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2026-10-27 18:18:19 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-10-29 10:14:50 +0100
commita01c8e5b1dff1ce489e6b339139e744db36b8bb3 (patch)
treeed8406f2d824512f076e7934805f3479ae6933ac /lib
parent0cc3ad8f4d2e2009c2005278c754caf7c07fe0a4 (diff)
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: b0e37c0d8a6a ("net-sysfs: make sure objects belong to container's owner") Cc: stable <stable@kernel.org> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Link: https://patch.msgid.link/2026102718-conduit-glorious-a8dc@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject_uevent.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 1480e2c27ed0..1d29378d4f55 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -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;