public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch v2] KVM: selftests: Make reclaim_period_ms input always be positive
@ 2023-01-11 18:34 Vipin Sharma
  2023-01-11 21:25 ` Sean Christopherson
  2023-02-08  2:07 ` Sean Christopherson
  0 siblings, 2 replies; 5+ messages in thread
From: Vipin Sharma @ 2023-01-11 18:34 UTC (permalink / raw)
  To: seanjc, pbonzini, bgardon; +Cc: kvm, linux-kernel, Vipin Sharma

reclaim_period_ms use to be positive only but the commit 0001725d0f9b
("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input
validation") incorrectly changed it to non-negative validation.

Change validation to allow only positive input.

Fixes: 0001725d0f9b ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input validation")
Signed-off-by: Vipin Sharma <vipinsh@google.com>
Reported-by: Ben Gardon <bgardon@google.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
---

v2:
- Added Fixes and Reviewed-by tags

v1: https://lore.kernel.org/lkml/20230110215203.4144627-1-vipinsh@google.com/

 tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c b/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c
index ea0978f22db8..251794f83719 100644
--- a/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c
+++ b/tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c
@@ -241,7 +241,7 @@ int main(int argc, char **argv)
 	while ((opt = getopt(argc, argv, "hp:t:r")) != -1) {
 		switch (opt) {
 		case 'p':
-			reclaim_period_ms = atoi_non_negative("Reclaim period", optarg);
+			reclaim_period_ms = atoi_positive("Reclaim period", optarg);
 			break;
 		case 't':
 			token = atoi_paranoid(optarg);
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Patch v2] KVM: selftests: Make reclaim_period_ms input always be positive
  2023-01-11 18:34 [Patch v2] KVM: selftests: Make reclaim_period_ms input always be positive Vipin Sharma
@ 2023-01-11 21:25 ` Sean Christopherson
  2023-02-08  2:07 ` Sean Christopherson
  1 sibling, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2023-01-11 21:25 UTC (permalink / raw)
  To: Vipin Sharma; +Cc: pbonzini, bgardon, kvm, linux-kernel

On Wed, Jan 11, 2023, Vipin Sharma wrote:
> reclaim_period_ms use to be positive only but the commit 0001725d0f9b
> ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input
> validation") incorrectly changed it to non-negative validation.
> 
> Change validation to allow only positive input.
> 
> Fixes: 0001725d0f9b ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input validation")
> Signed-off-by: Vipin Sharma <vipinsh@google.com>
> Reported-by: Ben Gardon <bgardon@google.com>
> Reviewed-by: Ben Gardon <bgardon@google.com>
> ---

Reviewed-by: Sean Christopherson <seanjc@google.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch v2] KVM: selftests: Make reclaim_period_ms input always be positive
  2023-01-11 18:34 [Patch v2] KVM: selftests: Make reclaim_period_ms input always be positive Vipin Sharma
  2023-01-11 21:25 ` Sean Christopherson
@ 2023-02-08  2:07 ` Sean Christopherson
  2023-02-08  4:29   ` Vipin Sharma
  1 sibling, 1 reply; 5+ messages in thread
From: Sean Christopherson @ 2023-02-08  2:07 UTC (permalink / raw)
  To: Sean Christopherson, pbonzini, bgardon, Vipin Sharma; +Cc: kvm, linux-kernel

On Wed, 11 Jan 2023 10:34:08 -0800, Vipin Sharma wrote:
> reclaim_period_ms use to be positive only but the commit 0001725d0f9b
> ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input
> validation") incorrectly changed it to non-negative validation.
> 
> Change validation to allow only positive input.
> 
> 
> [...]

Applied to kvm-x86 selftests, thanks!

[1/1] KVM: selftests: Make reclaim_period_ms input always be positive
      https://github.com/kvm-x86/linux/commit/4dfd8e37fa0f

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch v2] KVM: selftests: Make reclaim_period_ms input always be positive
  2023-02-08  2:07 ` Sean Christopherson
@ 2023-02-08  4:29   ` Vipin Sharma
  2023-02-08 14:40     ` Sean Christopherson
  0 siblings, 1 reply; 5+ messages in thread
From: Vipin Sharma @ 2023-02-08  4:29 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: pbonzini, bgardon, kvm, linux-kernel

On Tue, Feb 7, 2023 at 6:10 PM Sean Christopherson <seanjc@google.com> wrote:
>
> On Wed, 11 Jan 2023 10:34:08 -0800, Vipin Sharma wrote:
> > reclaim_period_ms use to be positive only but the commit 0001725d0f9b
> > ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input
> > validation") incorrectly changed it to non-negative validation.
> >
> > Change validation to allow only positive input.
> >
> >
> > [...]
>
> Applied to kvm-x86 selftests, thanks!

Just FYI, this patch has already been applied to kvm/master branch.
https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=c2c46b10d52624376322b01654095a84611c7e09

>
> [1/1] KVM: selftests: Make reclaim_period_ms input always be positive
>       https://github.com/kvm-x86/linux/commit/4dfd8e37fa0f
>
> --
> https://github.com/kvm-x86/linux/tree/next
> https://github.com/kvm-x86/linux/tree/fixes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch v2] KVM: selftests: Make reclaim_period_ms input always be positive
  2023-02-08  4:29   ` Vipin Sharma
@ 2023-02-08 14:40     ` Sean Christopherson
  0 siblings, 0 replies; 5+ messages in thread
From: Sean Christopherson @ 2023-02-08 14:40 UTC (permalink / raw)
  To: Vipin Sharma; +Cc: pbonzini, bgardon, kvm, linux-kernel

On Tue, Feb 07, 2023, Vipin Sharma wrote:
> On Tue, Feb 7, 2023 at 6:10 PM Sean Christopherson <seanjc@google.com> wrote:
> >
> > On Wed, 11 Jan 2023 10:34:08 -0800, Vipin Sharma wrote:
> > > reclaim_period_ms use to be positive only but the commit 0001725d0f9b
> > > ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input
> > > validation") incorrectly changed it to non-negative validation.
> > >
> > > Change validation to allow only positive input.
> > >
> > >
> > > [...]
> >
> > Applied to kvm-x86 selftests, thanks!
> 
> Just FYI, this patch has already been applied to kvm/master branch.
> https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=c2c46b10d52624376322b01654095a84611c7e09

Now I know why I was getting deja vu...  Dropped, thanks Vipin!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-08 14:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-11 18:34 [Patch v2] KVM: selftests: Make reclaim_period_ms input always be positive Vipin Sharma
2023-01-11 21:25 ` Sean Christopherson
2023-02-08  2:07 ` Sean Christopherson
2023-02-08  4:29   ` Vipin Sharma
2023-02-08 14:40     ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox