public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: poornima nayak <mpnayak@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, arun@linux.vnet.ibm.com,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] timer_migration interface accepts any number as input in 2.6.30-git9
Date: Wed, 17 Jun 2009 16:11:09 +0530	[thread overview]
Message-ID: <1245235269.2603.2.camel@ht.satnam> (raw)
In-Reply-To: <1245229936.3345.67.camel@localhost.localdomain>

On Wed, 2009-06-17 at 14:42 +0530, poornima nayak wrote:
> Hi
> 
> Timer migration interface /proc/sys/kernel/timer_migration in
> 2.6.30-git9 accepts any numerical value as input.
> Steps to reproduce 
> 1. echo -6666666 > /proc/sys/kernel/timer_migration
> 2. cat /proc/sys/kernel/timer_migration
> -6666666
> 
> 1. echo 44444444444444444444444444444444444444444444444444444444444 > /proc/sys/kernel/timer_migration
> 2. cat /proc/sys/kernel/timer_migration
> -1357789412
> 
> Expected behavior: Should 'echo: write error: Invalid argument' while
> setting any value other then 0 & 1
> 

Is this patch fix your problem:

[PATCH] kernel/sysctl: fix timer migration interface

Timer migration interface /proc/sys/kernel/timer_migration in
2.6.30-git9 accepts any numerical value as input.
Steps to reproduce
1. echo -6666666 > /proc/sys/kernel/timer_migration
2. cat /proc/sys/kernel/timer_migration
-6666666

1. echo 44444444444444444444444444444444444444444444444444444444444 > /proc/sys/kernel/timer_migration
2. cat /proc/sys/kernel/timer_migration
-1357789412

Expected behavior: Should 'echo: write error: Invalid argument' while
setting any value other then 0 & 1

Reported-by: Poornima Nayak <mpnayak@linux.vnet.ibm.com>
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 kernel/sysctl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index ac57832..d0f65e4 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -334,7 +334,10 @@ static struct ctl_table kern_table[] = {
 		.data		= &sysctl_timer_migration,
 		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= &proc_dointvec,
+		.proc_handler	= &proc_dointvec_minmax,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero,
+		.extra2		= &one,
 	},
 #endif
 	{
-- 
1.6.0.6





      parent reply	other threads:[~2009-06-17 10:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17  9:12 [BUG] timer_migration interface accepts any number as input in 2.6.30-git9 poornima nayak
2009-06-17 10:21 ` Arun R Bharadwaj
2009-06-17 10:41   ` Amerigo Wang
2009-06-22 11:22   ` poornima nayak
2009-06-23  4:30     ` Arun R Bharadwaj
2009-06-23  8:51       ` [tip:timers/urgent] timers: Fix timer_migration interface which accepts any number as input tip-bot for Arun R Bharadwaj
2009-06-17 10:41 ` Jaswinder Singh Rajput [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245235269.2603.2.camel@ht.satnam \
    --to=jaswinder@kernel.org \
    --cc=arun@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mpnayak@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox