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>] [day] [month] [year] [list]
Message-Id: <1635993584-3414975-1-git-send-email-jiasheng@iscas.ac.cn>
Date:   Thu,  4 Nov 2021 02:39:44 +0000
From:   Jiasheng Jiang <jiasheng@...as.ac.cn>
To:     marex@...x.de, stefan@...er.ch, airlied@...ux.ie, daniel@...ll.ch,
        shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
        festevam@...il.com, linux-imx@....com
Cc:     dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: Re: Re: [PATCH] drm: mxsfb: Check NULL pointer

On 11/3/21 8:58 AM, Marek Vasut wrote:
>> As we see in the drm_connector_list_iter_next(), it could return
>> NULL. In order to avoid the use of the NULL pointer, it may be
>> better to check the return value.
>> 
>> Fixes: c42001e ("drm: mxsfb: Use drm_panel_bridge")
>> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
>> ---
>>   drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 ++
>>   1 file changed, 2 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
>> index 6da9355..b875c11 100644
>> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
>> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
>> @@ -145,6 +145,8 @@ static int mxsfb_attach_bridge(struct mxsfb_drm_private *mxsfb)
>>   	 */
>>   	drm_connector_list_iter_begin(drm, &iter);
>>   	mxsfb->connector = drm_connector_list_iter_next(&iter);
>> +	if (!mxsfb->connector)
>> +		return 1;

> In which case does this happen failure happen ?
> What is the test case ?

As fas as I am concerned, 'connector_list' in the
drm_connector_list_iter_next() is initialized in the
drm_mode_config_init(), which is 'connector_list->next = connector_list'.
And therefore, the check in drm_connector_list_iter_next() that
'if (lhead->next == &config->connector_list)' is directly satisfied and
returns NULL.
I am not sure wheter it is designed on purpose. If not, please fix it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ