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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210208141803.bqbnbgvprtlo3vs6@skbuf>
Date:   Mon, 8 Feb 2021 14:18:04 +0000
From:   Ioana Ciornei <ioana.ciornei@....com>
To:     Dan Carpenter <dan.carpenter@...cle.com>
CC:     Stuart Yoder <stuyoder@...il.com>,
        Laurentiu Tudor <laurentiu.tudor@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] bus: fsl-mc: Fix test for end of loop

On Mon, Feb 01, 2021 at 03:28:54PM +0300, Dan Carpenter wrote:
> The "desc" pointer can't possibly be NULL here.  If we can't find the
> correct "desc" then tt points to the last element of the
> fsl_mc_accepted_cmds[] array.  Fix this by testing if
> "i == FSL_MC_NUM_ACCEPTED_CMDS" instead.
> 
> Fixes: 2cf1e703f066 ("bus: fsl-mc: add fsl-mc userspace support")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

Hi,

I just noticed that Greg wasn't copied on the initial email.

If you don't mind I will re-submit your patch along with other updates
to the fsl-mc bus so that you don't have to bother.

Ioana

> ---
>  drivers/bus/fsl-mc/fsl-mc-uapi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c
> index eeb988c9f4bb..bdcd9d983a78 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-uapi.c
> +++ b/drivers/bus/fsl-mc/fsl-mc-uapi.c
> @@ -338,7 +338,7 @@ static int fsl_mc_command_check(struct fsl_mc_device *mc_dev,
>  		if ((cmdid & desc->cmdid_mask) == desc->cmdid_value)
>  			break;
>  	}
> -	if (!desc) {
> +	if (i == FSL_MC_NUM_ACCEPTED_CMDS) {
>  		dev_err(&mc_dev->dev, "MC command 0x%04x: cmdid not accepted\n", cmdid);
>  		return -EACCES;
>  	}
> -- 
> 2.29.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ