Menjalankan cat /proc/sys/kernel/tainted
mencetak nilai noda kernel saat ini (di basis 10). Pemahaman saya adalah bahwa nilai ini adalah bitfield, di mana setiap bit mengindikasikan tidak adanya atau adanya jenis noda tertentu. Anda dapat mengekstrak bit menggunakan
python3 -c 'from pprint import pprint; pprint(list(zip(range(50), reversed(bin(int(open("/proc/sys/kernel/tainted").read()))[2:]))))'
Saya telah mencari dokumentasi, tetapi yang saya lihat hanya mengidentifikasi arti bit 0 hingga 10. Misalnya, http://www.kernel.org/doc/Documentation/sysctl/kernel.txt mengatakan:
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 insmod -f.
Set by modutils >= 2.4.9 and module-init-tools.
4 (S): Unsafe SMP processors: SMP with CPUs not designed for SMP.
8 (R): A module was forcibly unloaded from the system by rmmod -f.
16 (M): A hardware machine check error occurred on the system.
32 (B): A bad page was discovered on the system.
64 (U): The user has asked that the system be marked "tainted". This
could be because they are running software that directly modifies
the hardware, or for other reasons.
128 (D): The system has died.
256 (A): The ACPI DSDT has been overridden with one supplied by the user
instead of using the one provided by the hardware.
512 (W): A kernel warning has occurred.
1024 (C): A module from drivers/staging was loaded.
2048 (I): The system is working around a severe firmware bug.
4096 (O): An out-of-tree module has been loaded.
8192 (E): An unsigned module has been loaded in a kernel supporting module
signature.
16384 (L): A soft lockup has previously occurred on the system.
32768 (K): The kernel has been live patched.
65536 (X): Auxiliary taint, defined and used by for distros.
131072 (T): The kernel was built with the struct randomization plugin.
Saya juga mencoba melihat dokumentasi untuk kernel Ubuntu dengan menginstal linux-doc
paket dan pembukaan zless /usr/share/doc/linux-doc/sysctl/kernel.txt.gz
, tetapi itu masih hanya daftar hingga 1024.
Dalam kasus saya, saya menjalankan kernel PAE default (3.2.0-36-generic-pae) pada Precise. Saya juga melihat bit 12 set.
Di mana dokumentasi lengkap untuk apa arti bit tercemar pada kernel Ubuntu?
sumber
kernel.txt
sekarang dokumentasikan dua bendera terakhir ini.