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: <94d8e411-1eef-1450-4828-5faabb03a3d1@arm.com>
Date:   Tue, 26 Mar 2019 11:34:42 +0000
From:   Steven Price <steven.price@....com>
To:     Kangjie Lu <kjlu@....edu>
Cc:     Sudeep Holla <sudeep.holla@....com>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, pakki001@....edu
Subject: Re: [PATCH] firmware: arm_scmi: check return value of idr_find

On 25/03/2019 20:48, Kangjie Lu wrote:
> Thanks for Steven Price's review of this patch. In the current code,

There's no need to include a "thanks" message in the commit message -
the "Reviewed-by" tag is sufficient. Please also remember to include an
appropriate version tag in the subject - this should be "v2".

Thanks,

Steve

> idr_find won't return NULL because the SCMI_PROTOCOL_BASE id must 
> exist. However, it might return NULL in the future code if the check
> is on another node while processing the children in subsequent calls 
> to scmi_mbox_chan_setup().
> Therefore, the patch conservatively checks the return value and 
> returns -EINVAL when it indeed failed.
> 
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> Reviewed-by: Steven Price <steven.price@....com>
> ---
>  drivers/firmware/arm_scmi/driver.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 8f952f2f1a29..35faa203d549 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -709,6 +709,8 @@ scmi_mbox_chan_setup(struct scmi_info *info, struct device *dev, int prot_id)
>  
>  	if (scmi_mailbox_check(np)) {
>  		cinfo = idr_find(&info->tx_idr, SCMI_PROTOCOL_BASE);
> +		if (!cinfo)
> +			return -EINVAL;
>  		goto idr_alloc;
>  	}
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ