** Summary changed:

- v4l2loopback fails to build on kernel 7.0 HWE
+ v4l2loopback fails to build and then oopses on kernel 7.0 HWE

** Description changed:

  [Impact]
  
- Linux 6.18 added a "struct file *filp" parameter to v4l2_fh_add() and
- v4l2_fh_del() (include/media/v4l2-fh.h).
+ Linux 6.18 changed two things that v4l2loopback 0.12.7 does not handle.
  
- v4l2loopback 0.12.7 still calls both with the old single-argument signature, 
so the DKMS build fails against the noble 7.0 HWE kernel:
+ v4l2_fh_add() and v4l2_fh_del() gained a "struct file *filp" parameter,
+ so the DKMS build fails:
+ 
      v4l2loopback.c:2089: error: too few arguments to function 'v4l2_fh_add'
      v4l2loopback.c:2117: error: too few arguments to function 'v4l2_fh_del'
  
- The impact is not limited to the virtual camera.
- dkms autoinstall runs from /etc/kernel/header_postinst.d/dkms, so the build 
failure aborts the kernel header postinst with exit status 11 and leaves the 
kernel meta package unconfigured.
+ dkms autoinstall runs from /etc/kernel/header_postinst.d/dkms, so on
+ Ubuntu 24.04 LTS the build failure aborts the kernel header postinst
+ with exit status 11 and leaves the package unconfigured. Every
+ subsequent apt operation then fails until the user removes v4l2loopback-
+ dkms by hand. linux-hwe-7.0 is published in both noble-updates and
+ noble-security, so affected systems receive the kernel automatically. 37
+ users are affected and 25 duplicates were filed within a week.
  
- Every subsequent apt operation, including security updates, then fails
- until the user removes v4l2loopback-dkms by hand.
+ The core also stopped letting drivers reach their own file handle by
+ container_of() on the "fh" argument or on file->private_data, and
+ requires the new file_to_v4l2_fh() accessor instead. Fixing only the
+ build failure is therefore not enough: the module then builds and loads,
+ but oopses as soon as a consumer opens the device.
  
- linux-hwe-7.0 is published in both noble-updates and noble-security, so
- affected systems receive the kernel automatically.
- 
- 37 users are affected and 25 duplicates were filed within a week.
- 
- Fixing only the call signature is not enough.
- 
- 0.12.7 walks and reorders dev->outbufs_list in vidioc_dqbuf() without holding 
a lock, which panics with "list_del corruption" while streaming once the module 
builds again (LP: #2161239).
- Both fixes are in this upload.
+     BUG: unable to handle page fault for address: fffffffffffffffc
+     RIP: 0010:vidioc_reqbufs+0xa2/0x3b0 [v4l2loopback]
  
  [Test Plan]
  
- On a noble system with v4l2loopback-dkms installed:
+ On a noble system or container that has v4l2loopback-dkms installed:
+ 
      sudo apt-get install -y linux-headers-7.0.0-28-generic
  
  - Without the fix
+ 
+     Error! Bad return status for module build on kernel: 7.0.0-28-generic 
(x86_64)
      run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11
      dpkg: error processing package linux-headers-7.0.0-28-generic 
(--configure)
      E: Sub-process /usr/bin/dpkg returned an error code (1)
  
- apt stays broken until v4l2loopback-dkms is removed.
+ "dpkg -l linux-headers-7.0.0-28-generic" reports state iF, and every
+ later apt run ends with the same dpkg error.
  
  - With the fix
+ 
      sudo apt-get install -y -t noble-proposed v4l2loopback-dkms
+     dpkg -l linux-headers-7.0.0-28-generic
      dkms status v4l2loopback
  
- The header package configures cleanly and dkms status reports v4l2loopback 
installed for 7.0.0-28-generic.
- The GA kernel must be unaffected on the same system:
+ Installing the fixed package completes the pending header configuration
+ on its own, the header package moves to state ii, apt runs cleanly
+ again, and dkms status reports v4l2loopback installed for every kernel
+ whose headers are present, including the 6.8 GA kernel.
  
-     sudo apt-get install -y linux-headers-6.8.0-136-generic
-     dkms status v4l2loopback
+ Then boot the 7.0 HWE kernel and exercise the device:
  
- The module must also build for 6.8.0-136-generic.
- The locking fix, on a machine running 7.0:
+     sudo modprobe v4l2loopback devices=1 max_buffers=4
+     ffmpeg -loglevel error -re -f lavfi -i testsrc=size=640x480:rate=30 -t 30 
-f v4l2 /dev/video0 &
+     ffmpeg -loglevel error -f v4l2 -i /dev/video0 -t 25 -f null -
  
-     sudo modprobe v4l2loopback devices=1
-     ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -t 60 -f v4l2 
/dev/video0 &
-     ffplay -f v4l2 -i /dev/video0
+ Both commands must exit 0 and "dmesg" must contain no oops. Without the
+ accessor fix the consumer is killed and dmesg shows the vidioc_reqbufs
+ page fault above.
  
- Streaming must run to completion with the machine responsive.
- Without the locking fix this panics and requires a hard power cycle.
+ Repeat the same streaming check on the 6.8 GA kernel to confirm it is
+ unchanged.
  
  [Where problems could occur]
  
- If the compat macro guard or the new list_lock is wrong, the module
- either stops building on one of the two kernels noble supports, leaving
- apt in the broken state this SRU is fixing, or stalls every consumer of
- the loopback device during output streaming.
+ If either compat macro is wrong, the module fails to build on one of the
+ two kernels noble supports, leaving apt in the broken state this SRU is
+ fixing, or resolves the opener incorrectly and oopses on the first ioctl
+ a consumer issues.
  
  [Other Info]
  
  Fixed upstream in v4l2loopback 0.15.2 by
  
https://github.com/v4l2loopback/v4l2loopback/commit/3b09d3c53997f5f05e8d0db9222706585dbbe67a
  Fix compilation with linux-6.18.0
  (with its follow-up ce8474158c6e, which applies the same change to 
v4l2_fh_del)
  
- [ORIGINAL DESCRIPTION]
- 
- v4l2loopback.c: In function ‘v4l2_loopback_open’:
- v4l2loopback.c:2089:9: error: too few arguments to function ‘v4l2_fh_add’
-  2089 |         v4l2_fh_add(&opener->fh);
-       |         ^~~~~~~~~~~
- In file included from 
/usr/src/linux-headers-7.0.0-28-generic/include/media/v4l2-subdev.h:17,
-                  from 
/usr/src/linux-headers-7.0.0-28-generic/include/media/v4l2-device.h:13,
-                  from v4l2loopback.c:31:
- /usr/src/linux-headers-7.0.0-28-generic/include/media/v4l2-fh.h:97:6: note: 
declared here
-    97 | void v4l2_fh_add(struct v4l2_fh *fh, struct file *filp);
-       |      ^~~~~~~~~~~
- v4l2loopback.c: In function ‘v4l2_loopback_close’:
- v4l2loopback.c:2117:9: error: too few arguments to function ‘v4l2_fh_del’
-  2117 |         v4l2_fh_del(&opener->fh);
-       |         ^~~~~~~~~~~
- /usr/src/linux-headers-7.0.0-28-generic/include/media/v4l2-fh.h:125:6: note: 
declared here
-   125 | void v4l2_fh_del(struct v4l2_fh *fh, struct file *filp);
-       |      ^~~~~~~~~~~
- 
- ProblemType: Package
- DistroRelease: Ubuntu 24.04
- Package: linux-headers-7.0.0-28-generic 7.0.0-28.28~24.04.1
- ProcVersionSignature: Ubuntu 6.17.0-35.35~24.04.1-generic 6.17.13
- Uname: Linux 6.17.0-35-generic x86_64
- NonfreeKernelModules: nvidia_modeset nvidia
- ApportVersion: 2.28.2-0ubuntu0.1
- Architecture: amd64
- AudioDevicesInUse:
-  USER        PID ACCESS COMMAND
-  /dev/snd/controlC0:  tom-brown   2572 F.... wireplumber
-  /dev/snd/controlC1:  tom-brown   2572 F.... wireplumber
-  /dev/snd/seq:        tom-brown   2567 F.... pipewire
- CRDA: N/A
- CasperMD5CheckResult: pass
- Date: Thu Jul 16 22:52:40 2026
- ErrorMessage: installed linux-headers-7.0.0-28-generic package 
post-installation script subprocess returned error exit status 11
- InstallationDate: Installed on 2025-12-20 (209 days ago)
- InstallationMedia: Ubuntu 24.04.3 LTS "Noble Numbat" - Release amd64 
(20250805.1)
- Lsusb:
-  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
-  Bus 001 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
-  Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
-  Bus 001 Device 004: ID 0bda:57c3 Realtek Semiconductor Corp. 
Integrated_Webcam_HD
-  Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
- MachineType: Dell Inc. Precision 7510
- ProcFB: 0 i915drmfb
- ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-6.17.0-35-generic 
root=UUID=0cd37cd1-1382-4191-9107-b090419b644e ro quiet splash vt.handoff=7
- Python3Details: /usr/bin/python3.12, Python 3.12.3, python3-minimal, 
3.12.3-0ubuntu2.1
- PythonDetails: N/A
- RelatedPackageVersions: grub-pc N/A
- SourcePackage: linux-hwe-7.0
- Title: package linux-headers-7.0.0-28-generic 7.0.0-28.28~24.04.1 failed to 
install/upgrade: installed linux-headers-7.0.0-28-generic package 
post-installation script subprocess returned error exit status 11
- UpgradeStatus: No upgrade log present (probably fresh install)
- dmi.bios.date: 03/09/2023
- dmi.bios.release: 1.31
- dmi.bios.vendor: Dell Inc.
- dmi.bios.version: 1.31.3
- dmi.board.name: 0MJ7KG
- dmi.board.vendor: Dell Inc.
- dmi.board.version: A00
- dmi.chassis.type: 9
- dmi.chassis.vendor: Dell Inc.
- dmi.modalias: 
dmi:bvnDellInc.:bvr1.31.3:bd03/09/2023:br1.31:svnDellInc.:pnPrecision7510:pvr:rvnDellInc.:rn0MJ7KG:rvrA00:cvnDellInc.:ct9:cvr:sku06D9:
- dmi.product.family: Precision
- dmi.product.name: Precision 7510
- dmi.product.sku: 06D9
- dmi.sys.vendor: Dell Inc.
+ and in 0.15.3 by
+ 
https://github.com/v4l2loopback/v4l2loopback/commit/6b33fe1f682881eb268ab9fc85f231acc5564ac8
+ use linux>=6.18 accessor for v4l2->private_data

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2161037

Title:
  v4l2loopback fails to build and then oopses on kernel 7.0 HWE

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to