linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ethan Zhao <ethan.zhao@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, mcgrof@kernel.org, keescook@chromium.org,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	james.puthukattukaran@oracle.com, ethan.kernel@gmail.com
Subject: Re: [PATCH v2] sched: check user input value of sysctl_sched_time_avg
Date: Mon, 4 Sep 2017 15:54:23 +0800	[thread overview]
Message-ID: <759b1eb2-2d3d-89df-9ea0-38622f285284@oracle.com> (raw)
In-Reply-To: <20170904074931.oyhe4gz5jnhfmnw6@hirez.programming.kicks-ass.net>

Peter,


On 2017/9/4 15:49, Peter Zijlstra wrote:
> On Sat, Sep 02, 2017 at 02:57:32PM +0800, Ethan Zhao wrote:
>> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
>> index 6648fbb..609bed2 100644
>> --- a/kernel/sysctl.c
>> +++ b/kernel/sysctl.c
>> @@ -367,7 +367,7 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write,
>>   		.data		= &sysctl_sched_time_avg,
>>   		.maxlen		= sizeof(unsigned int),
>>   		.mode		= 0644,
>> -		.proc_handler	= proc_dointvec,
>> +		.proc_handler	= sched_time_avg_handler,
> *sigh*, what's wrong with the below? Too easy?
  :),  seems I walked zigzag several cycles to get the right point.

  Thanks,
  Ethan
>
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 6648fbbb8157..bbbc6a17c15e 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -367,7 +367,8 @@ static struct ctl_table kern_table[] = {
>   		.data		= &sysctl_sched_time_avg,
>   		.maxlen		= sizeof(unsigned int),
>   		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_min_max,
> +		.extra1		= &one,
>   	},
>   #ifdef CONFIG_SCHEDSTATS
>   	{
>
>

  reply	other threads:[~2017-09-04  7:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-02  6:57 [PATCH v2] sched: check user input value of sysctl_sched_time_avg Ethan Zhao
2017-09-02  7:10 ` Mike Galbraith
2017-09-04  7:49 ` Peter Zijlstra
2017-09-04  7:54   ` Ethan Zhao [this message]
2017-09-06 19:50     ` Luis R. Rodriguez
2017-09-07  4:21       ` Ethan Zhao

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=759b1eb2-2d3d-89df-9ea0-38622f285284@oracle.com \
    --to=ethan.zhao@oracle.com \
    --cc=ethan.kernel@gmail.com \
    --cc=james.puthukattukaran@oracle.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).