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:   Wed, 3 May 2023 16:08:04 -0500
From:   Jorge Lopez <jorgealtxwork@...il.com>
To:     Thomas Weißschuh <thomas@...ch.de>
Cc:     hdegoede@...hat.com, platform-driver-x86@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v11 09/14] HP BIOSCFG driver - enum-attributes

On Wed, May 3, 2023 at 3:10 PM Thomas Weißschuh <thomas@...ch.de> wrote:
>
> On 2023-05-03 14:42:37-0500, Jorge Lopez wrote:
> > On Sun, Apr 23, 2023 at 7:55 AM Thomas Weißschuh <thomas@...ch.de> wrote:
> > >
> > > On 2023-04-20 11:54:49-0500, Jorge Lopez wrote:
> > > >  .../x86/hp/hp-bioscfg/enum-attributes.c       | 543 ++++++++++++++++++
> > > >  1 file changed, 543 insertions(+)
> > > >  create mode 100644 drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
> > > >
> > > > diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
>
> <snip>
>
> > > > +/*
> > > > + * validate_enumeration_input() -
> > > > + * Validate input of current_value against possible values
> > > > + *
> > > > + * @instance_id: The instance on which input is validated
> > > > + * @buf: Input value
> > > > + */
> > > > +static int validate_enumeration_input(int instance_id, const char *buf)
> > > > +{
> > > > +     int ret = 0;
> > > > +     int found = 0;
> > > > +     int i;
> > > > +     int possible_values;
> > > > +
> > > > +     /* Is it a read only attribute */
> > > > +     if (bioscfg_drv.enumeration_data[instance_id].common.is_readonly)
> > > > +             return -EIO;
> > > > +
> > > > +     possible_values = bioscfg_drv.enumeration_data[instance_id].possible_values_size;
> > > > +     for (i = 0; i < possible_values && !found; i++)
> > > > +             if (!strcasecmp(bioscfg_drv.enumeration_data[instance_id].possible_values[i], buf))
> > >
> > > Is this also intentionally case-insensitive?
> >
> > Yes
>
> Why? It is surprising.
>
> The behavior differs from sysfs_match_string() and friends.
> Thinking about it, this function should be able to use
> __sysfs_match_string().
>
sysfs_match_string will compare the current value against all possible
values in the array.
I will use the recommended sysfs call.  I will need to do some testing
since the documentation is not explicitly of what comparison it does.

> (Same for the ordered list type)

Will do.
>
> <snip>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ