Improve kernel_tainted test in ubuntu_boot for taint reason check
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-kernel-tests |
Fix Released
|
Undecided
|
Po-Hsu Lin |
Bug Description
When comparing the test results between rpi3 and rpi4 with K-rpi kernel, you will see that:
rpi3bp:
Checking kernel tainted flags in /proc/sys/
Running 'python3 /home/ubuntu/
[stdout] Kernel taint value is 1024
[stdout] Taint bit value: 10 (staging driver was loaded)
[stdout] Exception made in test script: bcm2835_codec
[stdout] Exception made in test script: bcm2835_isp
[stdout] Exception made in test script: bcm2835_v4l2
[stdout] Exception made in test script: bcm2835_mmal_vchiq
[stdout] Exception made in test script: rpivid_hevc
[stdout] Exception made in test script: snd_bcm2835
[stdout] Exception made in test script: vc_sm_cma
[stdout] * Staging modules found, but they are expected and OK
GOOD: Kernel not tainted.
rpi41g:
Checking kernel tainted flags in /proc/sys/
Running 'python3 /home/ubuntu/
[stdout] Kernel taint value is 9216
[stdout] Taint bit value: 10 (staging driver was loaded)
[stdout] Exception made in test script: bcm2835_codec
[stdout] Exception made in test script: bcm2835_isp
[stdout] Exception made in test script: bcm2835_v4l2
[stdout] Exception made in test script: bcm2835_mmal_vchiq
[stdout] Exception made in test script: rpivid_hevc
[stdout] Exception made in test script: snd_bcm2835
[stdout] Exception made in test script: vc_sm_cma
[stdout] * Staging modules found, but they are expected and OK
[stdout] Taint bit value: 13 (unsigned module was loaded)
[stdout] Exception made in test script: bcm2835_codec
[stdout] Exception made in test script: bcm2835_isp
[stdout] Exception made in test script: bcm2835_v4l2
[stdout] Exception made in test script: bcm2835_mmal_vchiq
[stdout] Exception made in test script: rpivid_hevc
[stdout] Exception made in test script: snd_bcm2835
[stdout] Exception made in test script: vc_sm_cma
[stdout] * Unsigned modules found, but they are expected and OK
GOOD: Kernel not tainted.
Juerg has found that the difference is because the unsigned module that sets the taint flag on Pi 4B is rpivid_hevc. But that module is not loaded on Pi 3B hence no unsigned tainting.
And the test seems to output the full module exception list rather than only the modules from that list that are actually loaded.
With inspecting the taint file for each module in /sys/module/
snd_bcm2835 - C
rpivid_hevc - CE
bcm2835_codec -C
bcm2835_v4l2 - C
bcm2835_isp - C
bcm2835_mmal_vchiq - C
vc_sm_cma C
The current logic is simply matching the modules in the whitelist and the loaded modules. We should make use of this instead to get a more precise output.
Related branches
- Francis Ginther: Approve
-
Diff: 200 lines (+74/-81)2 files modifiedubuntu_boot/kernel_taint_test.py (+73/-80)
ubuntu_boot/ubuntu_boot.py (+1/-1)
summary: |
- Imporve kernel_tainted test in ubuntu_boot for taint reason check + Improve kernel_tainted test in ubuntu_boot for taint reason check |
Changed in ubuntu-kernel-tests: | |
status: | In Progress → Fix Released |