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]
Date:   Thu, 30 Nov 2023 10:10:41 -0500
From:   Marc Ferland <marc.ferland@...il.com>
To:     David Laight <David.Laight@...lab.com>
Cc:     "krzysztof.kozlowski@...aro.org" <krzysztof.kozlowski@...aro.org>,
        "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

On Thu, Nov 30, 2023 at 9:52 AM David Laight <David.Laight@...lab.com> wrote:
>
> 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 :-)
>
Sounds reasonable to me. Thanks for the tip!
Marc

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ