diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-30 14:38:34 -1000 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-30 14:38:34 -1000 |
| commit | 2a500a04d6f969318c05f46aedb6e73fc1963a00 (patch) | |
| tree | 4585da0c22128adf3e1fbb9e9a963b52ff17ed7c | |
| parent | ac1bf565f140154ee27db56c80f29c9eeb9a77c3 (diff) | |
| parent | a287f97d4256b5f5527f5b5a54f8ada55e1482c7 (diff) | |
| download | linux-master.tar.gz linux-master.zip | |
Merge tag 'driver-core-7.4-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-coreHEADmaster
Pull more driver core fixes from Danilo Krummrich:
- Revert TAINT_FORCED_BIND, introduced to flag manual sysfs bind/unbind
operations associated with misleading fuzzing reports. It also taints
established workflows, including VFIO device passthrough; a more
targeted approach will be revisited after 7.4.
- Rate limit synthetic uevent failure messages to prevent log flooding
from repeated invalid writes to sysfs uevent files
* tag 'driver-core-7.4-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core:
Revert "driver core: add TAINT_FORCED_BIND for when userspace manually messes with devices and drivers"
driver core: Limit the messages on a refused uevent
| -rw-r--r-- | Documentation/admin-guide/tainted-kernels.rst | 54 | ||||
| -rw-r--r-- | drivers/base/bus.c | 3 | ||||
| -rw-r--r-- | drivers/base/core.c | 4 | ||||
| -rw-r--r-- | include/linux/panic.h | 3 | ||||
| -rw-r--r-- | include/trace/events/module.h | 3 | ||||
| -rw-r--r-- | kernel/panic.c | 5 | ||||
| -rw-r--r-- | lib/kobject_uevent.c | 6 | ||||
| -rwxr-xr-x | tools/debugging/kernel-chktaint | 8 |
8 files changed, 35 insertions, 51 deletions
diff --git a/Documentation/admin-guide/tainted-kernels.rst b/Documentation/admin-guide/tainted-kernels.rst index a208811ad525..fcb8b9734548 100644 --- a/Documentation/admin-guide/tainted-kernels.rst +++ b/Documentation/admin-guide/tainted-kernels.rst @@ -74,36 +74,35 @@ a particular type of taint. It's best to leave that to the aforementioned script, but if you need something quick you can use this shell command to check which bits are set:: - $ for i in $(seq 0 20); do echo $i $(($(cat /proc/sys/kernel/tainted)>>$i&1));done + $ for i in $(seq 0 19); do echo $i $(($(cat /proc/sys/kernel/tainted)>>$i&1));done Table for decoding tainted state ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -=== === ======= ======================================================== -Bit Log Number Reason that got the kernel tainted -=== === ======= ======================================================== - 0 G/P 1 proprietary module was loaded - 1 _/F 2 module was force loaded - 2 _/S 4 kernel running on an out of specification system - 3 _/R 8 module was force unloaded - 4 _/M 16 processor reported a Machine Check Exception (MCE) - 5 _/B 32 bad page referenced or some unexpected page flags - 6 _/U 64 taint requested by userspace application - 7 _/D 128 kernel died recently, i.e. there was an OOPS or BUG - 8 _/A 256 ACPI table overridden by user - 9 _/W 512 kernel issued warning - 10 _/C 1024 staging driver was loaded - 11 _/I 2048 workaround for bug in platform firmware applied - 12 _/O 4096 externally-built ("out-of-tree") module was loaded - 13 _/E 8192 unsigned module was loaded - 14 _/L 16384 soft lockup occurred - 15 _/K 32768 kernel has been live patched - 16 _/X 65536 auxiliary taint, defined for and used by distros - 17 _/T 131072 kernel was built with the struct randomization plugin - 18 _/N 262144 an in-kernel test has been run - 19 _/J 524288 userspace used a mutating debug operation in fwctl - 20 _/Y 1048576 device was manually bound or unbound from a driver -=== === ======= ======================================================== +=== === ====== ======================================================== +Bit Log Number Reason that got the kernel tainted +=== === ====== ======================================================== + 0 G/P 1 proprietary module was loaded + 1 _/F 2 module was force loaded + 2 _/S 4 kernel running on an out of specification system + 3 _/R 8 module was force unloaded + 4 _/M 16 processor reported a Machine Check Exception (MCE) + 5 _/B 32 bad page referenced or some unexpected page flags + 6 _/U 64 taint requested by userspace application + 7 _/D 128 kernel died recently, i.e. there was an OOPS or BUG + 8 _/A 256 ACPI table overridden by user + 9 _/W 512 kernel issued warning + 10 _/C 1024 staging driver was loaded + 11 _/I 2048 workaround for bug in platform firmware applied + 12 _/O 4096 externally-built ("out-of-tree") module was loaded + 13 _/E 8192 unsigned module was loaded + 14 _/L 16384 soft lockup occurred + 15 _/K 32768 kernel has been live patched + 16 _/X 65536 auxiliary taint, defined for and used by distros + 17 _/T 131072 kernel was built with the struct randomization plugin + 18 _/N 262144 an in-kernel test has been run + 19 _/J 524288 userspace used a mutating debug operation in fwctl +=== === ====== ======================================================== Note: The character ``_`` is representing a blank in this table to make reading easier. @@ -190,6 +189,3 @@ More detailed explanation for tainting 19) ``J`` if userspace opened /dev/fwctl/* and performed a FWTCL_RPC_DEBUG_WRITE to use the devices debugging features. Device debugging features could cause the device to malfunction in undefined ways. - - 20) ``Y`` If userspace wrote to the `bind` or `unbind` sysfs files and - successfully bound or removed a device from a driver. diff --git a/drivers/base/bus.c b/drivers/base/bus.c index f8759d5c9056..396097fdb316 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -19,7 +19,6 @@ #include <linux/string.h> #include <linux/mutex.h> #include <linux/sysfs.h> -#include <linux/panic.h> #include "base.h" #include "power/power.h" @@ -242,7 +241,6 @@ 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); device_driver_detach(dev); err = count; } @@ -266,7 +264,6 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf, dev = bus_find_device_by_name(bus, NULL, buf); if (dev && driver_match_device(drv, dev)) { - add_taint_module(drv->owner, TAINT_FORCED_BIND, LOCKDEP_STILL_OK); err = device_driver_attach(drv, dev); if (!err) { /* success */ diff --git a/drivers/base/core.c b/drivers/base/core.c index 5daa88fa724a..cbe05197d4a0 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -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; } diff --git a/include/linux/panic.h b/include/linux/panic.h index 23976b1dfdb6..17e61b61c45f 100644 --- a/include/linux/panic.h +++ b/include/linux/panic.h @@ -89,8 +89,7 @@ static inline void set_arch_panic_timeout(int timeout, int arch_default_timeout) #define TAINT_RANDSTRUCT 17 #define TAINT_TEST 18 #define TAINT_FWCTL 19 -#define TAINT_FORCED_BIND 20 -#define TAINT_FLAGS_COUNT 21 +#define TAINT_FLAGS_COUNT 20 #define TAINT_FLAGS_MAX ((1UL << TAINT_FLAGS_COUNT) - 1) struct taint_flag { diff --git a/include/trace/events/module.h b/include/trace/events/module.h index 19df3e39bba4..e5a006be9dc6 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h @@ -26,8 +26,7 @@ struct module; { (1UL << TAINT_OOT_MODULE), "O" }, \ { (1UL << TAINT_FORCED_MODULE), "F" }, \ { (1UL << TAINT_CRAP), "C" }, \ - { (1UL << TAINT_UNSIGNED_MODULE), "E" }, \ - { (1UL << TAINT_FORCED_BIND), "Y" }) + { (1UL << TAINT_UNSIGNED_MODULE), "E" }) TRACE_EVENT(module_load, diff --git a/kernel/panic.c b/kernel/panic.c index b824b68fcb08..574ee5a12f92 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -825,7 +825,6 @@ const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = { TAINT_FLAG(RANDSTRUCT, 'T', ' '), TAINT_FLAG(TEST, 'N', ' '), TAINT_FLAG(FWCTL, 'J', ' '), - TAINT_FLAG(FORCED_BIND, 'Y', ' '), }; #undef TAINT_FLAG @@ -862,9 +861,9 @@ static void print_tainted_seq(struct seq_buf *s, bool verbose) * exact size is allocated dynamically; the initial buffer remains * as a fallback if allocation fails. * - * The verbose taint string currently requires up to 344 characters. + * The verbose taint string currently requires up to 327 characters. */ -#define INIT_TAINT_BUF_MAX 370 +#define INIT_TAINT_BUF_MAX 350 static char init_taint_buf[INIT_TAINT_BUF_MAX] __initdata; static char *taint_buf __refdata = init_taint_buf; 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; diff --git a/tools/debugging/kernel-chktaint b/tools/debugging/kernel-chktaint index d8628be37214..e1571c04afb5 100755 --- a/tools/debugging/kernel-chktaint +++ b/tools/debugging/kernel-chktaint @@ -211,14 +211,6 @@ else addout "J" echo " * fwctl's mutating debug interface was used (#19)" fi - -T=`expr $T / 2` -if [ `expr $T % 2` -eq 0 ]; then - addout " " -else - addout "Y" - echo " * device was manually bound or unbound from a driver (#20)" -fi echo "Raw taint value as int/string: $taint/'$out'" # report on any tainted loadable modules |
