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:   Thu, 2 Feb 2023 10:05:57 -0800
From:   Vipin Sharma <vipinsh@...gle.com>
To:     Andrew Jones <andrew.jones@...ux.dev>
Cc:     shahuang@...hat.com, kvm@...r.kernel.org,
        Paolo Bonzini <pbonzini@...hat.com>,
        Shuah Khan <shuah@...nel.org>,
        Sean Christopherson <seanjc@...gle.com>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] selftests: KVM: Replace optarg with arg in guest_modes_cmdline

On Thu, Feb 2, 2023 at 12:11 AM Andrew Jones <andrew.jones@...ux.dev> wrote:
>
> On Thu, Feb 02, 2023 at 10:57:15AM +0800, shahuang@...hat.com wrote:
> > From: Shaoqin Huang <shahuang@...hat.com>
> >
> > The parameter arg in guest_modes_cmdline not being used now, and the
> > optarg should be replaced with arg in guest_modes_cmdline.
> >
> > And this is the chance to change strtoul() to atoi_non_negative(), since
> > guest mode ID will never be negative.
>
> Fixes: e42ac777d661 ("KVM: selftests: Factor out guest mode code")
>
> >
> > Signed-off-by: Shaoqin Huang <shahuang@...hat.com>
> >
> > ---
> > Changes from v1:
> >   - Change strtoul() to atoi_non_negative(). [Vipin]
> >
> > ---
> >  tools/testing/selftests/kvm/lib/guest_modes.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/kvm/lib/guest_modes.c b/tools/testing/selftests/kvm/lib/guest_modes.c
> > index 99a575bbbc52..1df3ce4b16fd 100644
> > --- a/tools/testing/selftests/kvm/lib/guest_modes.c
> > +++ b/tools/testing/selftests/kvm/lib/guest_modes.c
> > @@ -127,7 +127,7 @@ void guest_modes_cmdline(const char *arg)
> >               mode_selected = true;
> >       }
> >
> > -     mode = strtoul(optarg, NULL, 10);
> > +     mode = atoi_non_negative("Guest mode ID", arg);
> >       TEST_ASSERT(mode < NUM_VM_MODES, "Guest mode ID %d too big", mode);
> >       guest_modes[mode].enabled = true;
> >  }
> > --
> > 2.39.0
> >
>
> Reviewed-by: Andrew Jones <andrew.jones@...ux.dev>
Reviewed-by: Vipin Sharma <vipinsh@...gle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ