[SRU] Wrong permissions on vcio

Bug #1958563 reported by Dave Jones
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
raspberrypi-userland (Ubuntu)
Fix Released
Undecided
Dave Jones
Focal
Fix Released
Undecided
Dave Jones
Impish
Fix Released
Undecided
Dave Jones

Bug Description

[Impact]

The incorrect permissions on these devices mean the regular console user cannot access various videocore services. An example of a side-effect of this is that camera usage (via the new libcamera mechanism) requires root access. Likewise, usage of the GPU (under the KMS system) for H.264 decoding (via v4l2m2m) likewise requires root access.

[Test Plan]

* Flash the appropriate version to a fresh SD card and boot it
* sudo apt install libraspberrypi-bin # because it's not seeded on focal (this can be skipped on impish)
* sudo reboot
* ls -l /dev/vc* /dev/dma_heap/
* Note that /dev/vcio, /dev/vcsm-cma, /dev/vchiq, /dev/dma_heap/* have incorrect permissions (specifically, their ownership is not root:video and/or their mode is not 0664)
* sudo reboot
* sudo apt install libraspberrypi-bin
* sudo reboot
* ls -l /dev/vc* /dev/dma_heap/
* Note that /dev/vcio, /dev/vcsm-cma, /dev/vchiq, /dev/dma_heap/* now have correct permissions (root:video ownership, and mode 0664)

[Regression Potential]

Only the permission changes are being backported, not a fully updated userland. Nonetheless, existing functionality from userland should be re-tested, in particular the legacy camera stack, with the following procedure:

* Attach a raspberry pi camera module to the board
* Add "start_x=1" and "gpu_mem=128" to /boot/firmware/config.txt
* sudo reboot
* raspistill -o test.jpg
* Confirm that test.jpg contains a valid picture

The "tvservice" binary *may* be tested too, but is known to be inoperable under the arm64 architecture (see LP: #1944541). It is also worth noting that the test plan above only looks at the permissions as libcamera is not *currently* expected to operate on Focal.

Tests should be carried out on all supported boards (Zero 2, 2B, 3B, 3A+, 3B+, 4B) under both armhf and arm64 architectures (within the caveats noted above about the arm64 architecture).

[Original Description]

The /dev/vcio can have the wrong permissions due to a change in the kernel. As reported in https://github.com/raspberrypi/linux/pull/4624 (which I missed entirely, sorry pelwell!) we'll need a change in the udev rules to ensure the correct permissions are set.

Dave Jones (waveform)
Changed in raspberrypi-userland (Ubuntu):
assignee: nobody → Dave Jones (waveform)
status: New → Confirmed
milestone: none → ubuntu-22.04
Revision history for this message
Dave Jones (waveform) wrote :

Looks like our permissions on vcsm-cma were also incorrect, and we were missing permission overrides for the rpivid devices, and dma_heap for libcamera support. I've uploaded a 0ubuntu2 version which should patch all of these.

Note to self: some of this at least (probably not the libcamera bits?) ought to be backported to focal for .4

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package raspberrypi-userland - 0~20211124+git14b90ff-0ubuntu2

---------------
raspberrypi-userland (0~20211124+git14b90ff-0ubuntu2) jammy; urgency=medium

  * Fix udev rules for vcio and vchiq (LP: #1958563)
  * Add dma_heap and rpivid rules for better libcamera support

 -- Dave Jones <email address hidden> Thu, 20 Jan 2022 19:03:13 +0000

Changed in raspberrypi-userland (Ubuntu):
status: Confirmed → Fix Released
Dave Jones (waveform)
summary: - Wrong permissions on vcio
+ [SRU] Wrong permissions on vcio
Dave Jones (waveform)
description: updated
description: updated
Changed in raspberrypi-userland (Ubuntu Impish):
assignee: nobody → Dave Jones (waveform)
Changed in raspberrypi-userland (Ubuntu Focal):
assignee: nobody → Dave Jones (waveform)
Dave Jones (waveform)
description: updated
Dave Jones (waveform)
description: updated
description: updated
Changed in raspberrypi-userland (Ubuntu Focal):
milestone: none → ubuntu-20.04.4
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Dave, or anyone else affected,

Accepted raspberrypi-userland into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/raspberrypi-userland/0~20200520+git2fe4ca3-0ubuntu3~20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

description: updated
Changed in raspberrypi-userland (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Dave, or anyone else affected,

Accepted raspberrypi-userland into impish-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/raspberrypi-userland/0~20200520+git2fe4ca3-0ubuntu5~21.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-impish to verification-done-impish. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-impish. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in raspberrypi-userland (Ubuntu Impish):
status: New → Fix Committed
tags: added: verification-needed-impish
Dave Jones (waveform)
tags: added: verification-done-focal
removed: verification-needed-focal
tags: added: verification-done-impish
removed: verification-needed-impish
Revision history for this message
Brian Murray (brian-murray) wrote :

@Dave Jones - Could you add some verification details to this bug report? The SRU team frowns upon just flipping tags from v-needed to v-done.

Changed in raspberrypi-userland (Ubuntu Focal):
milestone: ubuntu-20.04.4 → none
Revision history for this message
Dave Jones (waveform) wrote :

Sorry, forgot this while filling in all the ISO tracker stuff (re-used the cards for the tests). The permissions were checked on a 3B+, 3A+, 4B, CM4, and Pi 400 under both armhf and arm64. The camera functionality was tested under armhf and arm64 on the 3B+ and the 4B.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package raspberrypi-userland - 0~20200520+git2fe4ca3-0ubuntu5~21.10.1

---------------
raspberrypi-userland (0~20200520+git2fe4ca3-0ubuntu5~21.10.1) impish; urgency=medium

  * Correct vcio (and associated) permissions on focal (LP: #1958563)

 -- Dave Jones <email address hidden> Tue, 25 Jan 2022 13:45:06 +0000

Changed in raspberrypi-userland (Ubuntu Impish):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for raspberrypi-userland has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package raspberrypi-userland - 0~20200520+git2fe4ca3-0ubuntu3~20.04.1

---------------
raspberrypi-userland (0~20200520+git2fe4ca3-0ubuntu3~20.04.1) focal; urgency=medium

  * Correct vcio (and associated) permissions on focal (LP: #1958563)

 -- Dave Jones <email address hidden> Tue, 25 Jan 2022 13:45:06 +0000

Changed in raspberrypi-userland (Ubuntu Focal):
status: Fix Committed → 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.