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: <d123196b2c5d486cbf3b2e7e4b1fc774@AcuMS.aculab.com>
Date:   Thu, 30 Nov 2023 14:52:10 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     "'marc.ferland@...il.com'" <marc.ferland@...il.com>,
        "krzysztof.kozlowski@...aro.org" <krzysztof.kozlowski@...aro.org>
CC:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "marc.ferland@...atest.com" <marc.ferland@...atest.com>,
        "jeff.dagenais@...il.com" <jeff.dagenais@...il.com>,
        "rdunlap@...radead.org" <rdunlap@...radead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 4/5] w1: ds2433: use the kernel bitmap implementation

From: marc.ferland@...il.com
> Sent: 30 November 2023 13:53
> 
> The ds2433 driver uses the 'validcrc' variable to mark out which pages
> have been successfully (crc is valid) retrieved from the eeprom and
> placed in the internal 'memory' buffer (see CONFIG_W1_SLAVE_DS2433_CRC).
> 
> The current implementation assumes that the number of pages will never
> go beyond 32 pages (bit field is a u32). This is fine for the ds2433
> since it only has 16 pages.
> 
> Use a dynamically allocated bitmap so that we can support eeproms with
> more than 32 pages which is the case for the ds28ec20 (80 pages).

Dynamically allocating seems excessive.
Why not just make the maximum a compile-time constant (say 96 or 128)
and just check that the actual size isn't too big.

> As an added bonus, the code also gets easier on the eye.

and slower :-)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ