Improve kernel_tainted test in ubuntu_boot for taint reason check

Bug #1999237 reported by Po-Hsu Lin
6
This bug affects 1 person
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/kernel/tainted
 Running 'python3 /home/ubuntu/autotest/client/tests/ubuntu_boot/kernel_taint_test.py'
 [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/kernel/tainted
 Running 'python3 /home/ubuntu/autotest/client/tests/ubuntu_boot/kernel_taint_test.py'
 [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/$module/taint on rpi4 with K-rpi, you will see the module and the taint flag:
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

Po-Hsu Lin (cypressyew)
summary: - Imporve kernel_tainted test in ubuntu_boot for taint reason check
+ Improve kernel_tainted test in ubuntu_boot for taint reason check
Po-Hsu Lin (cypressyew)
Changed in ubuntu-kernel-tests:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.