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: <a440cbf7-c6d5-4286-a69f-05e668522931@moroto.mountain>
Date: Thu, 13 Jun 2024 22:58:40 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Kieran Bingham <kieran.bingham@...asonboard.com>
Cc: Umang Jain <umang.jain@...asonboard.com>,
	Florian Fainelli <florian.fainelli@...adcom.com>,
	linux-rpi-kernel@...ts.infradead.org,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Stefan Wahren <wahrenst@....net>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Dave Stevenson <dave.stevenson@...pberrypi.org>,
	detule <ogjoneski@...il.com>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" <linux-arm-kernel@...ts.infradead.org>,
	"open list:STAGING SUBSYSTEM" <linux-staging@...ts.linux.dev>,
	open list <linux-kernel@...r.kernel.org>,
	Julia Lawall <Julia.Lawall@...ia.fr>
Subject: Re: [PATCH] staging: vc04_services: vchiq_arm: Fix initialisation
 check

On Thu, Jun 13, 2024 at 08:41:45PM +0100, Kieran Bingham wrote:
> ---
>  .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c  | 4 ++--
>  .../staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 5 +++++
>  .../staging/vc04_services/interface/vchiq_arm/vchiq_dev.c  | 7 ++++++-
>  3 files changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index 54467be8c371..67d853f5f2a0 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -804,7 +804,7 @@ int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance
>  	 * block forever.
>  	 */
>  	for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
> -		if (state)
> +		if (vchiq_remote_initialised(state))
>  			break;
>  		usleep_range(500, 600);
>  	}

:/  In the original code, this would either break on the first iteration
or fail.  The diff looked like this:

        for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
-               state = vchiq_get_state();
                if (state)
                        break;

I feel bad for not spotting this.  A static checker which looked at
diffs could have made this work, but all of our tools look at a momement
in time instead of looking at the change over time.

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ