Re: [PATCH] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Gioh Kim
On Wed, Apr 7, 2021 at 10:07 PM Nick Desaulniers wrote: > > On Tue, Apr 6, 2021 at 11:15 PM Gioh Kim wrote: > > > > As the name shows, it checks if strings are equal in case insensitive > > manner. > > > > For example, drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c uses > > strncasecmp to check tha

Re: [PATCH] lib/string: Introduce sysfs_streqcase

2021-04-07 Thread Nick Desaulniers
On Tue, Apr 6, 2021 at 11:15 PM Gioh Kim wrote: > > As the name shows, it checks if strings are equal in case insensitive > manner. > > 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 "

[PATCH] lib/string: Introduce sysfs_streqcase

2021-04-06 Thread Gioh Kim
As the name shows, it checks if strings are equal in case insensitive manner. 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". I found some more cases using strncasecmp

Re: [PATCH] lib/string: Introduce sysfs_streqcase

2021-04-02 Thread Gioh Kim
On Fri, Apr 2, 2021 at 8:24 PM Kees Cook 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 wrote: > > >

Re: [PATCH] lib/string: Introduce sysfs_streqcase

2021-04-02 Thread Gioh Kim
On Fri, Apr 2, 2021 at 8:17 PM 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 wrote: > > > > As the name shows, it checks if strings are equal in case insensitive

Re: [PATCH] lib/string: Introduce sysfs_streqcase

2021-04-02 Thread Kees Cook
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 wrote: > > > > As the name shows, it checks if strings are equal in case in

Re: [PATCH] lib/string: Introduce sysfs_streqcase

2021-04-02 Thread Nick Desaulniers
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 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 > stri

Re: [PATCH] lib/string: Introduce sysfs_streqcase

2021-04-02 Thread kernel test robot
Hi Gioh, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linux/master] [also build test WARNING on linus/master next-20210401] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as docume

[PATCH] lib/string: Introduce sysfs_streqcase

2021-04-02 Thread Gioh Kim
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".