Skip to content

[Backport v4.2-branch] uvc: improve standard compliance and MacOS compat #93678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: v4.2-branch
Choose a base branch
from

Conversation

github-actions[bot]
Copy link

Backport 366c64e~2..366c64e from #92320.

josuah added 2 commits July 24, 2025 15:59
Some OSes like MacOS use shorter UVC 1.1 probe/commit messages even when
UVC 1.5 is supported, without bUsage, bBitDepthLuma, bmSettings,
bMaxNumberOfRefFramesPlus1, bmRateControlModes bmLayoutPerStream.
Accept messages of arbitrary size to safely be processed, ignoring all
missing fields, improving standard compliance.

Signed-off-by: Josuah Demangeon <me@josuah.net>
(cherry picked from commit ed9327d)
Due to the alignment and granularity requirements of memory allocation,
setup->wLength is shorter than the allocated buffer size.
This lead to responses larger than what the host requested, which it
rejected. Fix it by using the minimum between the allocated size, the
struct size, and the wLength requested.

Signed-off-by: Josuah Demangeon <me@josuah.net>
(cherry picked from commit 366c64e)
@github-actions github-actions bot added the Backport Backport PR and backport failure issues label Jul 24, 2025
@github-project-automation github-project-automation bot moved this to To do in Backports Jul 24, 2025
@dkalowsk dkalowsk added this to the v4.2.1 milestone Jul 27, 2025
@dkalowsk
Copy link
Contributor

@josuah this is set for a backport but the commit messages read (to me) as more of a new feature than a bug fix. Is there an issue for for this?

@josuah
Copy link
Contributor

josuah commented Jul 27, 2025

the commit messages read (to me) as more of a new feature than a bug fix.

The message could be read as "usb: uvc: allow the host to use short probe/commit messages [as required by the standard]".

So it is not a "bug" in the sense of a crash or a security issue, only a non-compliance with the standard which caused problems with some OS.

Is there an issue for for this?

No. I am away this week but will try to add one tonight to help.

@github-project-automation github-project-automation bot moved this from To do to Done in Backports Jul 28, 2025
@github-project-automation github-project-automation bot moved this from Done to Needs more info in Backports Jul 28, 2025
@zephyrbot zephyrbot added the area: USB Universal Serial Bus label Jul 28, 2025
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: USB Universal Serial Bus Backport Backport PR and backport failure issues
Projects
Status: Needs more info
Development

Successfully merging this pull request may close these issues.

6 participants