Kernel taint... how to fix?

I'm getting the dmesg error "module license 'CDDL' taints kernel."

This is due to loading the ZFS modules.


lsmod | grep zfs

Module Size Used By
zfs 3821568 23
zunicode 348160 1 zfs
zzstd 487424 1 zfs
zlua 163840 1 zfs
zavl 20480 1 zfs
icp 323584 1 zfs
zcommon 106496 2 zfs,icp
znvpair 98304 2 zfs,zcommon
spl 122880 6 zfs,icp,zzstd,znvpair,zcommon,zavl

for i in $(seq 19); do echo $(($i-1)) $(($(cat /proc/sys/kernel/tainted)>>($i-1)&1));done

Bit 0 or 1
0 1
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 1
13 0
14 0
15 0
16 0
17 0
18 0

So according to the documentation, that means either a ZFS module is considered proprietary, or it's considered externally-built.

Bit Log Number Reason that got the kernel tainted
0 G/P 1 proprietary module was loaded
12 _/O 4096 externally-built (“out-of-tree”) module was loaded

Let's figure out which it is:
cat /proc/sys/kernel/tainted;

4097


Oh, it's both.

Any ideas on how to clear this boot error? I'm tracking down why one of my USB ports won't work, and I figure getting rid of the boot errors is the most likely means, since it just prints that the USB interface didn't load, but doesn't give any error or reason why.

Often rebooting can do it. Otherwise, you manually reload the kernel - but without the process that caused it to get marked as tainted.

CDDL is not GPL compatible.
You might be able to avoid tainting the kernel by masking ZFS from systemd at boot.

I can't mask ZFS from systemd... otherwise it'll halt at the "importing pools" stage and the boot won't commence beyond that.

So this is likely an issue that ZFS is a port of commercial software from Sun Microsystems / Oracle, so it's got the CDDL license, rather than GPL. Which means I can't do much about it.

In that case, this thread may turn into the X - Y problem.
Your initial concern was:

I'm tracking down why one of my USB ports won't work, and I figure getting rid of the boot errors is the most likely means, since it just prints that the USB interface didn't load, but doesn't give any error or reason why.

Your kernel being tainted is generally harmless - that can be ignored.

Yeah, here's that error:
usb 3-4.4: 1:0: usb_set_interface failed (-32)

Do you have any USB_Legacy options in BIOS Settings?

From this, I assume that this occurs after plugging in a specific USB device?
Are you able to then unplug the device, reboot, then plug in the device and grab the output from dmesg?

That error occurs on bootup.

No, I don't have any USB settings in the UEFI. Nothing's plugged into that USB-C port... I wanted to plug my phone in there, but it's got no power and it transfers no data.

dmesg --level=warn shows:
usb: port power management may be unreliable

So I suspect this is the UEFI not being programmed properly... especially given that it was also throwing errors because it was mismanaging NetworkManager power for WiFi.

I agree that this looks related.
I cannot remember now, where I read it... But I had read recently about a mismatch in power management that caused the USB ports to be read at a flat set voltage. The result of this was USB ports 3.0 being read as USB 2.0

Huh... well, that's just weird.

Most multi-core CPUs have their TSC clocksource marked as 'unstable'.

To be marked 'stable', the CPU must:

  • Have the constant_tsc flag (clock rate doesn’t vary with CPU frequency).
    grep constant_tsc /proc/cpuinfo

  • Have the nonstop_tsc flag (clock doesn’t stop when the CPU goes idle).
    grep nonstop_tsc /proc/cpuinfo

  • Have the tsc_adjust flag (clock abusive rewrites can be detected and reverted).
    grep tsc_adjust /proc/cpuinfo

  • Not have more than two sockets (beyond that, clocks aren’t guaranteed to be synchronized between sockets).

My CPU doesn't have the tsc_adjust flag set, because that's an Intel-defined feature, and I have an AMD CPU.

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/x86/include/asm/cpufeatures.h

Ok, how do we get around that?

sudoedit /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="tsc=reliable"

That gets rid of all the boot log-spam about the unstable TSC clocksource.

You can also try:
GRUB_CMDLINE_LINUX_DEFAULT="tsc=nowatchdog"
... to stop the watchdog function which measures clock skew between CPU cores, but I didn't try that.

Now I get:
cat /sys/devices/system/clocksource/clocksource0/available_clocksource

tsc hpet acpi_pm

... whereas before I wasn't getting the 'tsc' clocksource, only 'hpet' and 'acpi_pm'.

What does that do? Well, apparently ACPI now loads without so many resource conflicts.

Now here's where it's weird... the error I had above (which had been showing up on every boot since the machine was new):
usb 3-4.4: 1:0: usb_set_interface failed (-32)
... went away! There are no USB errors, and only that same USB warn that I had before:
usb: port power management may be unreliable

The USB port still isn't working, it still doesn't deliver power to the phone when it's plugged in, but that's progress... of a sort. I'm researching how to disable UEFI power management of the USB ports.

1 Like

Is the c port in the mobo or video card? I haven't had a desktop in a while and my laptop is two years old, so haven't seen the progression of placement.

It's a port on the left side of a HP 17-cp1035cl laptop. It should just be a regular USB port, in USB-C format, I would think.

USB-C looks like this and is rather small, like for a Phone charger end:

Is it adjacent to the hdmi or other usb ports? Mine is next to the usb ports, so it's handled by the usb controller on the motherboard. I had thought it was controlled by my video card, but the last time I cleaned my laptop i noticed the configuration.

From back to front on the left-hand side of the machine:
USB port
HDMI port
USB-C port

Could be controlled by either.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.