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: <211b3d26-ffbc-3245-6613-7fd42c65cc80@xs4all.nl>
Date:   Wed, 25 Sep 2019 17:17:20 +0200
From:   Hans Verkuil <hverkuil-cisco@...all.nl>
To:     Helen Koike <helen.koike@...labora.com>, mchehab@...nel.org,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel@...labora.com
Subject: Re: [PATCH] media: vidioc-queryctrl.rst: clarify combining READ_ONLY
 with WRITE_ONLY

On 9/25/19 5:09 PM, Helen Koike wrote:
> Make it clear in the documentation that V4L2_CTRL_FLAG_READ_ONLY doesn't
> conflict with V4L2_CTRL_FLAG_WRITE_ONLY. Also make it clear that
> if both are combined then the control has read and write permissions.

That doesn't look right.

This is the test in v4l2-compliance:

__u32 rw_mask = V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY;

if ((fl & rw_mask) == rw_mask)
	return fail("can't read nor write this control\n");

If both flags are set, then a fail is reported.

Did you mis-read?

Setting both flags makes no sense.

Regards,

	Hans

> 
> Signed-off-by: Helen Koike <helen.koike@...labora.com>
> 
> ---
> Hi,
> 
> v4l2-compliance expects both flags for read and write permissions, so I
> would like to make it clear in the docs.
> Please let me know if this is not the case.
> 
> Thanks
> Helen
> ---
>  Documentation/media/uapi/v4l/vidioc-queryctrl.rst | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> index a3d56ffbf4cc..1d3aecdf679f 100644
> --- a/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> +++ b/Documentation/media/uapi/v4l/vidioc-queryctrl.rst
> @@ -500,6 +500,11 @@ See also the examples in :ref:`control`.
>        - 0x0004
>        - This control is permanently readable only. Any attempt to change
>  	the control will result in an ``EINVAL`` error code.
> +
> +	.. note::
> +
> +	   If combined with ``V4L2_CTRL_FLAG_WRITE_ONLY``, then both, read
> +	   and write are allowed.
>      * - ``V4L2_CTRL_FLAG_UPDATE``
>        - 0x0008
>        - A hint that changing this control may affect the value of other
> @@ -523,6 +528,11 @@ See also the examples in :ref:`control`.
>  	where writing a value will cause the device to carry out a given
>  	action (e. g. motor control) but no meaningful value can be
>  	returned.
> +
> +	.. note::
> +
> +	   If combined with ``V4L2_CTRL_FLAG_READ_ONLY``, then both, read
> +	   and write are allowed.
>      * - ``V4L2_CTRL_FLAG_VOLATILE``
>        - 0x0080
>        - This control is volatile, which means that the value of the
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ