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] [day] [month] [year] [list]
Message-ID: <20220425172350.fggwi7a76v5d6cbh@pengutronix.de>
Date:   Mon, 25 Apr 2022 19:23:50 +0200
From:   Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To:     Michael Ellerman <mpe@...erman.id.au>
Cc:     Yihao Han <hanyihao@...o.com>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Mark Brown <broonie@...nel.org>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        William Breathitt Gray <vilhelm.gray@...il.com>,
        Sven Van Asbroeck <TheSven73@...il.com>,
        Corentin Labbe <clabbe@...libre.com>,
        linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
        kernel@...o.com
Subject: Re: [PATCH] macintosh: macio_asic: fix resource_size.cocci warnings

Hello Michael,

On Fri, Apr 22, 2022 at 04:44:24PM +1000, Michael Ellerman wrote:
> Yihao Han <hanyihao@...o.com> writes:
> > -		if (index == 0 && (res->end - res->start) > 0xfff)
> > +		if (index == 0 && (resource_size(res)) > 0xfff)
> >  			res->end = res->start + 0xfff;
> > -		if (index == 1 && (res->end - res->start) > 0xff)
> > +		if (index == 1 && (resource_size(res)) > 0xff)
> 
> Are you sure the conversion is correct? It's not exactly equivalent:
> 
> static inline resource_size_t resource_size(const struct resource *res)
> {
> 	return res->end - res->start + 1;
> }

Indeed. I pointed out this issue in the v2 that already hit my inbox.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ