[Bug 1899633] Re: Repeated kernel warnings/stacktraces with kernel 5.4 and newer

Christian Ehrhardt  1899633 at bugs.launchpad.net
Mon Oct 19 09:47:40 UTC 2020


Thanks for the updated debdiff as requested, LGTM now.
Some minor cleanup 0.12.3-1ubuntu1 -> 0.12.3-1ubuntu0.1

Further I think we should add DKMS rebuild with the Focal kernel as
test-step explicitly (it will be done on install of the upgrade anyway,
but to be formally correct)

** Description changed:

  Release: 20.04/Focal Fossa
  
  [SRU Justification]
  
  Impact: Starting with kernel version 5.4 the v4l2-core started to add
  sanity checking on drivers when querying capabilities. First drivers are
  not supposed to modify an initially set device_caps attribute. And
  second, the returned set of capabilities must be a superset of those in
  device_caps. The v4l2loopback module fails on both checks which results
  in repeated warnings (with additional stack trace) starting with:
  
  - WARNING: CPU: 2 PID: 7234 at drivers/media/v4l2-core/v4l2-ioctl.c:1064 v4l_querycap+0x8f/0xa0 [videodev]
  - WARNING: CPU: 2 PID: 7234 at drivers/media/v4l2-core/v4l2-ioctl.c:1069 v4l_querycap+0x8f/0xa0 [videodev]
  
- Fix: The proposed fix adds compat code which stops modifying device_caps
- after initial setup for kernel versions 5.4 and later. Also for those
- versions the initial setup excludes V4L2_CAP_VIDEO_CAPTURE and
- V4L2_CAP_VIDEO_OUTPUT as those capabilities might be optionally set when
- calling v4l_querycap() to indicate readyness.
+ Fix:
+ The proposed fix adds compat code which stops modifying device_caps after initial setup for kernel versions 5.4 and later. Also for those versions the initial setup excludes V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT as those capabilities might be optionally set when calling v4l_querycap() to indicate readyness.
  
- Testcase: Inserting the DKMS module the following way should start showing the above warnings:
-   sudo modprobe v4l2loopback exclusive_caps=1
- Once the fixed version is used, there should no longer be any warnings.
+ Testcase:
+ #1
+    DKMS build the updated version (should be implicitly done on an
+    upgrade of v4l2loopback)
+    But one can try to rebuild explicitly and check if any warnings are 
+    given. This would be extra useful if a pre 5.4 kernel could be used as 
+    well (not officially part of focal, therefore optional)
  
- Regression Potential: The change affects the internal device_caps
- variable only. If that is unexpectedly used by anything external (the
- kernel code should be assumed to expect the modified form) the loopback
- device might become unusable for recording/playback. I have been using
- the modified driver for a while now as v4l2sink in obs-studio and saw
- now issues.
+ #2
+    Inserting the DKMS module the following way should start showing the 
+    above warnings:
+      $ sudo modprobe v4l2loopback exclusive_caps=1
+    Once the fixed version is used, there should no longer be any warnings.
+ 
+ Regression Potential:
+ The change affects the internal device_caps variable only. If that is unexpectedly used by anything external (the kernel code should be assumed to expect the modified form) the loopback device might become unusable for recording/playback. I have been using the modified driver for a while now as v4l2sink in obs-studio and saw now issues.

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1899633

Title:
  Repeated kernel warnings/stacktraces with kernel 5.4 and newer

Status in v4l2loopback package in Ubuntu:
  Fix Released
Status in v4l2loopback source package in Focal:
  In Progress

Bug description:
  Release: 20.04/Focal Fossa

  [SRU Justification]

  Impact: Starting with kernel version 5.4 the v4l2-core started to add
  sanity checking on drivers when querying capabilities. First drivers
  are not supposed to modify an initially set device_caps attribute. And
  second, the returned set of capabilities must be a superset of those
  in device_caps. The v4l2loopback module fails on both checks which
  results in repeated warnings (with additional stack trace) starting
  with:

  - WARNING: CPU: 2 PID: 7234 at drivers/media/v4l2-core/v4l2-ioctl.c:1064 v4l_querycap+0x8f/0xa0 [videodev]
  - WARNING: CPU: 2 PID: 7234 at drivers/media/v4l2-core/v4l2-ioctl.c:1069 v4l_querycap+0x8f/0xa0 [videodev]

  Fix:
  The proposed fix adds compat code which stops modifying device_caps after initial setup for kernel versions 5.4 and later. Also for those versions the initial setup excludes V4L2_CAP_VIDEO_CAPTURE and V4L2_CAP_VIDEO_OUTPUT as those capabilities might be optionally set when calling v4l_querycap() to indicate readyness.

  Testcase:
  #1
     DKMS build the updated version (should be implicitly done on an
     upgrade of v4l2loopback)
     But one can try to rebuild explicitly and check if any warnings are 
     given. This would be extra useful if a pre 5.4 kernel could be used as 
     well (not officially part of focal, therefore optional)

  #2
     Inserting the DKMS module the following way should start showing the 
     above warnings:
       $ sudo modprobe v4l2loopback exclusive_caps=1
     Once the fixed version is used, there should no longer be any warnings.

  Regression Potential:
  The change affects the internal device_caps variable only. If that is unexpectedly used by anything external (the kernel code should be assumed to expect the modified form) the loopback device might become unusable for recording/playback. I have been using the modified driver for a while now as v4l2sink in obs-studio and saw now issues.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/v4l2loopback/+bug/1899633/+subscriptions



More information about the Ubuntu-sponsors mailing list