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: <4fbe256e-503c-47c3-959a-5fe8d19d7d4a@bootlin.com>
Date: Fri, 19 Dec 2025 18:51:27 +0100
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: Luca Ceresoli <luca.ceresoli@...tlin.com>,
 Haneen Mohammed <hamohammed.sa@...il.com>, Simona Vetter <simona@...ll.ch>,
 Melissa Wen <melissa.srw@...il.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
 David Airlie <airlied@...il.com>, jose.exposito89@...il.com,
 Jonathan Corbet <corbet@....net>
Cc: victoria@...tem76.com, sebastian.wick@...hat.com,
 thomas.petazzoni@...tlin.com, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH RESEND v2 12/32] drm/vkms: Introduce configfs for plane
 color encoding


>>> +
>>> +    ret = kstrtouint(page, 10, &val);
>>> +    if (ret)
>>> +        return ret;
>>> +
>>> +    /* Should be a supported value */
>>> +    if (val & ~(BIT(DRM_COLOR_YCBCR_BT601) |
>>> +            BIT(DRM_COLOR_YCBCR_BT709) |
>>> +            BIT(DRM_COLOR_YCBCR_BT2020)))
>>> +        return -EINVAL;
>>> +    /* Should at least provide one color range */
>>> +    if ((val & (BIT(DRM_COLOR_YCBCR_BT601) |
>>> +            BIT(DRM_COLOR_YCBCR_BT709) |
>>> +            BIT(DRM_COLOR_YCBCR_BT2020))) == 0)
>>> +        return -EINVAL;
>>
>> Shouldn't you check that exactly one bit is set? As in patch 9.
> 
> Because this code is wrong... the default rotation should be 
> DRM_COLOR_YCBCR_BT601 / DRM_COLOR_YCBCR_BT709 / DRM_COLOR_YCBCR_BT2020
> not a bitfield...

And after fixing this, I think I will keep bitmask with only one bit set 
so supported_color_encodings and default_color_encoding will have 
exactly the same values. Same for color ranges. Thanks for the report!

> 
>>> +
>>> +    scoped_guard(mutex, &plane->dev->lock) {
>>> +        /* Ensures that the default rotation is included in 
>>> supported rotation */
>>> +        if (plane->dev->enabled)
>>> +            return -EINVAL;
>>
>> As before, wrong comment.
>>
>> Luca
>>
>> -- 
>> Luca Ceresoli, Bootlin
>> Embedded Linux and Kernel engineering
>> https://bootlin.com
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ