Thread (11 messages) 11 messages, 4 authors, 2026-08-31

Re: [PATCH v2 2/2] driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers

flat view

From: sashiko-bot@kernel.org
Date: 2026-08-31 11:07:52
Also in: linux-modules

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Syntax error in the !CONFIG_MODULES fallback stub of add_taint_module() causes a hard build failure.
--

commit 14dacce69702c442db10ec87f486fae504b3514f
Author: Greg Kroah-Hartman [off-list ref]

driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers

This commit adds a new taint flag, TAINT_FORCED_BIND, which is set whenever
userspace binds or unbinds a driver via sysfs. This helps developers identify
when fuzzing tools or userspace have forcefully reassigned devices.
quoted hunk ↗ jump to hunk
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index d17bd91490ee4..c51ad96d4de4b 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -241,6 +242,7 @@ static ssize_t unbind_store(struct device_driver *drv, const char *buf,
 
 	dev = bus_find_device_by_name(bus, NULL, buf);
 	if (dev && dev->driver == drv) {
+		add_taint_module(drv->owner, TAINT_FORCED_BIND, LOCKDEP_STILL_OK);
[Severity: Low]
Does this call break the build when CONFIG_MODULES is disabled?

Looking at the fallback stub in include/linux/module.h for !CONFIG_MODULES,
there is a syntax error in the parameter list (an extra comma instead of a
space):

static inline void add_taint_module(struct module *mod, unsigned flag,
				    enum lockdep_ok, lockdep_ok)
{
	add_taint(flag, lockdep_ok);
}

Using add_taint_module() here exposes this syntax error, which causes a hard
build failure when compiling without module support.
 		device_driver_detach(dev);
 		err = count;
 	}
-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260831-bind_taint-v2-0-1082d631213b@linuxfoundation.org?part=2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help