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: <20230427123733.15ad4aa3@aktux>
Date:   Thu, 27 Apr 2023 12:37:33 +0200
From:   Andreas Kemnade <andreas@...nade.info>
To:     Christophe Leroy <christophe.leroy@...roup.eu>
Cc:     Andy Shevchenko <andy.shevchenko@...il.com>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "brgl@...ev.pl" <brgl@...ev.pl>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        ": Tony Lindgren" <tony@...mide.com>,
        Aaro Koskinen <aaro.koskinen@....fi>,
        "linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>
Subject: Re: [PATCH] gpiolib: fix allocation of mixed dynamic/static GPIOs

On Thu, 27 Apr 2023 06:20:34 +0000
Christophe Leroy <christophe.leroy@...roup.eu> wrote:

> Le 27/04/2023 à 08:00, Andy Shevchenko a écrit :
> > On Thu, Apr 27, 2023 at 8:40 AM Christophe Leroy
> > <christophe.leroy@...roup.eu> wrote:  
> >>
> >>
> >>
> >> Le 27/04/2023 à 00:03, Andreas Kemnade a écrit :  
> >>> [Vous ne recevez pas souvent de courriers de andreas@...nade.info. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> >>>
> >>> If static allocation and dynamic allocation GPIOs are present,
> >>> dynamic allocation pollutes the numberspace for static allocation,
> >>> causing static allocation to fail.
> >>> Enfore dynamic allocation above GPIO_DYNAMIC_BASE.  
> >>
> >> Hum ....
> >>
> >> Commit 7b61212f2a07 ("gpiolib: Get rid of ARCH_NR_GPIOS") was supposed
> >> to enforce dynamic allocation above GPIO_DYNAMIC_BASE already.
> >>
> >> Can you describe what is going wrong exactly with the above commit ?  
> > 
> > Above commit only works to the first dynamic allocation, if you need
> > more than one with static ones present it mistakenly will give you a
> > base _below_ DYNAMIC_BASE.  
> 
> Ah right, that needs to be fixed.
> 
> > 
> > However, this change is just PoC I proposed, the conditional and
> > action should be slightly different to cover a corner case, when
> > statically allocated chip overlaps the DYNAMIC_BASE, i.e. gdev->base <
> > DYNAMIC_BASE, while gdev->base + gdev->ngpio >= DYNAMIC_BASE.
> >   
> 
> Yes you are right, that's gdev->base + gdev->ngpio that should be checked.
> 
and that not with simple continue or base might simply stay at DYNAMIC_BASE.

I will send a v2 of this patch with refined logic.

Regards,
Andreas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ