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: <646893af-fea8-473f-ba1a-0980d770d81e@collabora.com>
Date: Tue, 24 Dec 2024 20:35:49 +0200
From: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
To: Maxime Ripard <mripard@...nel.org>
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
 Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
 Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
 Jonas Karlman <jonas@...boo.se>, Jernej Skrabec <jernej.skrabec@...il.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>,
 Dmitry Baryshkov <dmitry.baryshkov@...aro.org>, kernel@...labora.com,
 dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] drm/connector: hdmi: Validate supported_formats
 matches ycbcr_420_allowed

On 12/17/24 5:25 PM, Maxime Ripard wrote:
> On Tue, Dec 17, 2024 at 12:54:08AM +0200, Cristian Ciocaltea wrote:
>> Ensure HDMI connector initialization fails when the presence of
>> HDMI_COLORSPACE_YUV420 in the given supported_formats bitmask doesn't
>> match the value of drm_connector->ycbcr_420_allowed.
>>
>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
>> ---
>>  drivers/gpu/drm/drm_connector.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
>> index fc35f47e2849ed6786d6223ac9c69e1c359fc648..ca7f43c8d6f1b31ef9d3a1ee05f4df930ecffac4 100644
>> --- a/drivers/gpu/drm/drm_connector.c
>> +++ b/drivers/gpu/drm/drm_connector.c
>> @@ -507,6 +507,9 @@ int drmm_connector_hdmi_init(struct drm_device *dev,
>>  	if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB)))
>>  		return -EINVAL;
>>  
>> +	if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420)))
>> +		return -EINVAL;
>> +
>>  	if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12))
>>  		return -EINVAL;
> 
> The patch looks fine to me, but we need to have unit tests to cover this case.

Unit tests added in v4:

https://lore.kernel.org/lkml/20241224-bridge-conn-fmt-prio-v4-4-a9ceb5671379@collabora.com/

Thanks,
Cristian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ