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: <CAJX1YtZTr246sG5zs15apHw_EdfQeOWCFPG=z_ePoQ3BXDQY2g@mail.gmail.com>
Date:   Fri, 2 Apr 2021 21:43:31 +0200
From:   Gioh Kim <gi-oh.kim@...os.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     Nick Desaulniers <ndesaulniers@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Jinpu Wang <jinpu.wang@...os.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] lib/string: Introduce sysfs_streqcase

On Fri, Apr 2, 2021 at 8:24 PM Kees Cook <keescook@...omium.org> wrote:
>
> On Fri, Apr 02, 2021 at 11:17:13AM -0700, Nick Desaulniers wrote:
> > Thanks for the patch!
> >
> > + akpm (please remember to run ./scripts/get_maintainer.pl on your patch files)
> >
> > On Fri, Apr 2, 2021 at 2:41 AM Gioh Kim <gi-oh.kim@...os.com> wrote:
> > >
> > > As the name shows, it checks if strings are equal in case insensitive
> > > manner. I found some cases using strncasecmp to check the entire
> > > strings and they would not work as intended.
> > >
> > > For example, drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c uses
> > > strncasecmp to check that the input via sysfs is "mi". But it would
> > > work even-if the input is "min-wrongcommand".
> > > And also drivers/pnp/interface.c checks "disable" command with
> > > strncasecmp but it would also work if the command is "disable-wrong".
> >
> > Perhaps those callers should be using strcasecmp then, rather than strncasecmp?
> >
> > Also, if they're being liberal in accepting either case, I don't see
> > why the sysfs nodes should be strict in rejecting trailing input at
> > that point.
>
> I think this shouldn't be prefixed "sysfs_" -- name it for what it does,
> not where it gets used, if it's a general utility function.
>

I think sysfs_streqcase is another version of sysfs_streq.
That is why I use "sysfs_" prefix.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ