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: <20230830223741.7a4684d5@barney>
Date:   Wed, 30 Aug 2023 22:37:41 +0200
From:   Michael Büsch <m@...s.ch>
To:     Larry Finger <Larry.Finger@...inger.net>,
        Rand Deeb <deeb.rand@...fident.ru>
Cc:     linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
        lvc-project@...uxtesting.org, voskresenski.stanislav@...fident.ru
Subject: Re: [PATCH] ssb-main: Fix division by zero in ssb_calc_clock_rate()

On Wed, 30 Aug 2023 14:50:42 -0500
Larry Finger <Larry.Finger@...inger.net> wrote:

> I agree that clkfactor_f6_resolv() could return 0, but we have not
> been overrun with reports of divide by zero errors, which suggests
> that the branch is never taken. This patch will make your tool happy
> and is much simpler:
> 
> diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
> index ab080cf26c9f..b9934b9c2d70 100644
> --- a/drivers/ssb/main.c
> +++ b/drivers/ssb/main.c
> @@ -837,7 +837,7 @@ static u32 clkfactor_f6_resolve(u32 v)
>          case SSB_CHIPCO_CLK_F6_7:
>                  return 7;
>          }
> -       return 0;
> +       return 1;
>   }

Yes, I agree that this is the much simpler and also more sensible
solution to this theoretical problem.

-- 
Michael Büsch
https://bues.ch/

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ