运行cat /proc/sys/kernel/tainted打印当前内核污点值(以 10 为基数)。我的理解是这个值是一个位域,其中每一位表示特定类型的污点是否存在。您可以使用提取位
python3 -c 'from pprint import pprint; pprint(list(zip(range(50), reversed(bin(int(open("/proc/sys/kernel/tainted").read()))[2:]))))'
Run Code Online (Sandbox Code Playgroud)
我已经搜索过文档,但我所看到的仅标识了 0 到 10 位的含义。例如,http : //www.kernel.org/doc/Documentation/sysctl/kernel.txt说:
tainted:
Non-zero if the kernel has been tainted. Numeric values, which can be
ORed together. The letters are seen in "Tainted" line of Oops reports.
1 (P): A module with a non-GPL license has been loaded, this
includes modules with no license.
Set by modutils >= 2.4.9 and module-init-tools.
2 (F): A module was force loaded by …Run Code Online (Sandbox Code Playgroud)