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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220818221236.7b16db07@thinkpad>
Date:   Thu, 18 Aug 2022 22:12:36 +0200
From:   Marek Behún <kabel@...nel.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Vinod Koul <vkoul@...nel.org>,
        Kishon Vijay Abraham I <kishon@...com>,
        Linux Phy <linux-phy@...ts.infradead.org>,
        Kees Cook <keescook@...omium.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Daniel Scally <djrscally@...il.com>,
        Gregory Clement <gregory.clement@...tlin.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Pali Rohár <pali@...nel.org>,
        josef.schlehofer@....cz
Subject: Re: [PATCH linux-phy v2 1/4] string.h: Add str_has_proper_prefix()

On Thu, 18 Aug 2022 22:56:14 +0300
Andy Shevchenko <andy.shevchenko@...il.com> wrote:

> On Thu, Aug 18, 2022 at 10:48 PM Marek Behún <kabel@...nel.org> wrote:
> > On Thu, 18 Aug 2022 22:10:58 +0300
> > Andy Shevchenko <andy.shevchenko@...il.com> wrote:  
> > > On Wed, Aug 17, 2022 at 11:06 PM Marek Behún <kabel@...nel.org> wrote:  
> 
> ...
> 
> > > Besides not the good naming (what 'proper' means),  
> >
> > The naming comes from similar naming in math: proper subset is as
> > subset that is not equal to the superset. See
> > https://en.wikipedia.org/wiki/Substring :
> >   "A proper prefix of a string is not equal to the string itself"  
> 
> It's nice to learn something, but I still think that name has too
> broad meaning(s) that may easily confuse the developers.
> 
> >  
> > > the entire function is not needed. You may simply call
> > >
> > >   str_has_prefix() && p[len] != '\0';
> > >
> > > Correct?  
> >
> > Do you mean that I should implement this function to simply return
> >   str_has_prefix() && p[len] != '\0'
> > or that this function should not exist at all and I should do that in
> > the code where I would have used the function?  
> 
> The latter since this seems do not have users, except a single newcomer,
> 

Just out of curiosity I grepped for all usages of str_has_prefix() and
there are some where it str_has_proper_prefix() could detect failure
earlier. For example in kernel/trace/trace_events_user.c in function
user_field_size().

Do you think I should propose converting those? There aren't that many
uses, so probably not.

Marek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ