Tainted Kernel:
In the Linux world, where Opensource drivers and modules rule the roost, you may happen to receive a message in your system alerts saying that your kernel is 'Tainted'. Before we go further its useful to understand what it means.
Because of the Opensource model, Linux kernel modules and drivers are designed, developed and maintained by the Linux Opensource community. Some Linux flavors like GNU Hurd are strict about their principles about Free Open Source software fundamentals and therefore would not include any non-Free drivers and modules in their distribution. On the other hand Linux distributions like Ubuntu and LinuxMint are not so strict. They emphasise functionality and ease of use over Principles of FSF. Their driver and module inclusion policy in their distributions is more relaxed. What that means is that often in these distributions would include proprietary drivers and modules to make something work. This is especially true in case of Graphical, Audio or Wireless drivers. For instance the Graphic Drivers from AMD (Radeon) could be included in a certain Linux distribution.
Now, whenever proprietary drivers are included, they come only as binary code--no source code.
Which means if there is any problem or bug detected in that (proprietary) softwar, the Linux community cannot access the source code and therefore cannot fix it. This fix can only come from the vendor who provided that proprietary driver or module. This is lack of visibility in the source code of a proprietary driver or module that is having problems working with Linux kernel is said to have 'Tainted the Linux kernel'.
Great, now we know what it means, how do we confirm it? How do we fix diagnose and fix it?
Well, it varies, but in almost all cases, you would know that your kernel is Tainted if you receive a popup/warning or alert from the system. On Fedora, the distribution that I use all the time, the 'Tainted kernel' alert is easily visible from the system alerts on the bottom right corner of the GUI screen. From the command line, its visible under the kernel message utility dmesg, as follows:
[root@ms-vaio ~]# dmesg | grep -i taint
[83346.433966] Pid: 31775, comm: kworker/u:0 Tainted: G W 3.7.6-102.fc17.x86_64 #1
This can also be confirmed by looking into the file /proc/sys/kernel/tainted:
[root@ms-vaio ~]# cat /proc/sys/kernel/tainted
512
In the Linux world, where Opensource drivers and modules rule the roost, you may happen to receive a message in your system alerts saying that your kernel is 'Tainted'. Before we go further its useful to understand what it means.
Because of the Opensource model, Linux kernel modules and drivers are designed, developed and maintained by the Linux Opensource community. Some Linux flavors like GNU Hurd are strict about their principles about Free Open Source software fundamentals and therefore would not include any non-Free drivers and modules in their distribution. On the other hand Linux distributions like Ubuntu and LinuxMint are not so strict. They emphasise functionality and ease of use over Principles of FSF. Their driver and module inclusion policy in their distributions is more relaxed. What that means is that often in these distributions would include proprietary drivers and modules to make something work. This is especially true in case of Graphical, Audio or Wireless drivers. For instance the Graphic Drivers from AMD (Radeon) could be included in a certain Linux distribution.
Now, whenever proprietary drivers are included, they come only as binary code--no source code.
Which means if there is any problem or bug detected in that (proprietary) softwar, the Linux community cannot access the source code and therefore cannot fix it. This fix can only come from the vendor who provided that proprietary driver or module. This is lack of visibility in the source code of a proprietary driver or module that is having problems working with Linux kernel is said to have 'Tainted the Linux kernel'.
Great, now we know what it means, how do we confirm it? How do we fix diagnose and fix it?
Well, it varies, but in almost all cases, you would know that your kernel is Tainted if you receive a popup/warning or alert from the system. On Fedora, the distribution that I use all the time, the 'Tainted kernel' alert is easily visible from the system alerts on the bottom right corner of the GUI screen. From the command line, its visible under the kernel message utility dmesg, as follows:
[root@ms-vaio ~]# dmesg | grep -i taint
[83346.433966] Pid: 31775, comm: kworker/u:0 Tainted: G W 3.7.6-102.fc17.x86_64 #1
This can also be confirmed by looking into the file /proc/sys/kernel/tainted:
[root@ms-vaio ~]# cat /proc/sys/kernel/tainted
512
Typically (for an un-tainted kernel), this file is empty. But as you can see, in my case its not. And in this case the process id 31775 is causing the kernel to be tainted. To dig into what that process is you can look into the process listing as follows:
[root@ms-vaio ~]# ps -efly | grep 31775
S root 4330 1539 0 80 0 872 27350 pipe_w 17:52 pts/0 00:00:00 grep --color=auto 31775
[root@ms-vaio ~]#
As you can see, the process with pid=31775 does not exist in my case, which means the process was shortlived, it caused a kernel warning and then it was termintated.
For a detailed discussion on the meaning of each Taint Flag like 512, G, W etc, go here and search for 'tainted'.
Now what to do to fix it?
Typically there is, Nothing to fix.
All it means is that your kernel has a device driver that is not open source. It may be wireless, or video driver (either are common) or you have some slightly unusual hardware that doesn't have a kernel supported driver.
The only time it causes a problem is if a kernel failure/panic occurs. The kernel developers cannot debug such a failure because they are not able to trace the entire problem. It may have been caused by a bug in the proprietary driver either directly (it happens to be in the traceback) or indirectly by modifying some kernel data that other drivers depended on.
So a reboot usually clears the warning and resets the /proc/sys/kernel/tainted file to zero bytes.