lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiDSCvL_C5mgGoXz9zWjJA7fXizM751hjm5jadWsRiymTRYsQ@mail.gmail.com>
Date: Wed, 18 Dec 2024 15:38:34 +0100
From: Ricardo Ribalda <ribalda@...omium.org>
To: Hans Verkuil <hverkuil@...all.nl>, 
	Laurent Pinchart <laurent.pinchart@...asonboard.com>, Hans de Goede <hdegoede@...hat.com>, 
	Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: uvcvideo: Filter hw errors while enumerating controls

On Fri, 13 Dec 2024 at 12:21, Ricardo Ribalda <ribalda@...omium.org> wrote:
>
> To implement VIDIOC_QUERYCTRL, we need to read from the hardware all the
> values that were not cached previously. If that read fails, we used to
> report back the error to the user.
>
> Unfortunately this does not play nice with userspace. When they are
> enumerating the contols, the only expect an error when there are no
> "next" control.
>
> This is probably a corner case, and could be handled in userspace, but
> both v4l2-ctl and yavta fail to enumerate all the controls if we return
> then -EIO during VIDIOC_QUERYCTRL. I suspect that there are tons of
> userspace apps handling this wrongly as well.

Actually it CANNOT be handled in userspace.

If we return anything different than 0, the structure is not copied to
userspace:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/v4l2-core/v4l2-ioctl.c#n2929
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/v4l2-core/v4l2-ioctl.c#n3490

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ