public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/05] use proc_dointvec_minmax to check boundaries while needed
@ 2011-03-03 13:58 Dave Young
  2011-03-03 14:59 ` Don Zickus
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Young @ 2011-03-03 13:58 UTC (permalink / raw)
  To: Andrew Morton, Ingo Molnar, David Miller, Don Zickus,
	linux-kernel

proc_dointvec doesn't check extra minmax params, use proc_dointvec_minmax
instead of proc_dointvec for cases need boundaries check.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
 kernel/sysctl.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- linux-2.6.orig/kernel/sysctl.c	2011-03-03 10:44:53.000000000 +0800
+++ linux-2.6/kernel/sysctl.c	2011-03-03 11:02:43.736663258 +0800
@@ -374,7 +374,7 @@ static struct ctl_table kern_table[] = {
 		.data		= &sysctl_sched_autogroup_enabled,
 		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= &zero,
 		.extra2		= &one,
 	},
@@ -1204,7 +1204,7 @@ static struct ctl_table vm_table[] = {
 		.data		= &block_dump,
 		.maxlen		= sizeof(block_dump),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= &zero,
 	},
 	{
@@ -1212,7 +1212,7 @@ static struct ctl_table vm_table[] = {
 		.data		= &sysctl_vfs_cache_pressure,
 		.maxlen		= sizeof(sysctl_vfs_cache_pressure),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= &zero,
 	},
 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
@@ -1221,7 +1221,7 @@ static struct ctl_table vm_table[] = {
 		.data		= &sysctl_legacy_va_layout,
 		.maxlen		= sizeof(sysctl_legacy_va_layout),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= &zero,
 	},
 #endif
@@ -1231,7 +1231,7 @@ static struct ctl_table vm_table[] = {
 		.data		= &zone_reclaim_mode,
 		.maxlen		= sizeof(zone_reclaim_mode),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= &zero,
 	},
 	{
@@ -1287,7 +1287,7 @@ static struct ctl_table vm_table[] = {
 		.data		= &vdso_enabled,
 		.maxlen		= sizeof(vdso_enabled),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= &zero,
 	},
 #endif

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

* Re: [PATCH 01/05] use proc_dointvec_minmax to check boundaries while needed
  2011-03-03 13:58 [PATCH 01/05] use proc_dointvec_minmax to check boundaries while needed Dave Young
@ 2011-03-03 14:59 ` Don Zickus
  2011-03-04  1:41   ` Dave Young
  0 siblings, 1 reply; 5+ messages in thread
From: Don Zickus @ 2011-03-03 14:59 UTC (permalink / raw)
  To: Dave Young; +Cc: Andrew Morton, Ingo Molnar, David Miller, linux-kernel

On Thu, Mar 03, 2011 at 09:58:20PM +0800, Dave Young wrote:
> proc_dointvec doesn't check extra minmax params, use proc_dointvec_minmax
> instead of proc_dointvec for cases need boundaries check.

Is this patch needed, if you are basically changing it again in patches 3
and 5?

Cheers,
Don

> 
> Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
> ---
>  kernel/sysctl.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> --- linux-2.6.orig/kernel/sysctl.c	2011-03-03 10:44:53.000000000 +0800
> +++ linux-2.6/kernel/sysctl.c	2011-03-03 11:02:43.736663258 +0800
> @@ -374,7 +374,7 @@ static struct ctl_table kern_table[] = {
>  		.data		= &sysctl_sched_autogroup_enabled,
>  		.maxlen		= sizeof(unsigned int),
>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_minmax,
>  		.extra1		= &zero,
>  		.extra2		= &one,
>  	},
> @@ -1204,7 +1204,7 @@ static struct ctl_table vm_table[] = {
>  		.data		= &block_dump,
>  		.maxlen		= sizeof(block_dump),
>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_minmax,
>  		.extra1		= &zero,
>  	},
>  	{
> @@ -1212,7 +1212,7 @@ static struct ctl_table vm_table[] = {
>  		.data		= &sysctl_vfs_cache_pressure,
>  		.maxlen		= sizeof(sysctl_vfs_cache_pressure),
>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_minmax,
>  		.extra1		= &zero,
>  	},
>  #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
> @@ -1221,7 +1221,7 @@ static struct ctl_table vm_table[] = {
>  		.data		= &sysctl_legacy_va_layout,
>  		.maxlen		= sizeof(sysctl_legacy_va_layout),
>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_minmax,
>  		.extra1		= &zero,
>  	},
>  #endif
> @@ -1231,7 +1231,7 @@ static struct ctl_table vm_table[] = {
>  		.data		= &zone_reclaim_mode,
>  		.maxlen		= sizeof(zone_reclaim_mode),
>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_minmax,
>  		.extra1		= &zero,
>  	},
>  	{
> @@ -1287,7 +1287,7 @@ static struct ctl_table vm_table[] = {
>  		.data		= &vdso_enabled,
>  		.maxlen		= sizeof(vdso_enabled),
>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_minmax,
>  		.extra1		= &zero,
>  	},
>  #endif

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

* Re: [PATCH 01/05] use proc_dointvec_minmax to check boundaries while needed
  2011-03-03 14:59 ` Don Zickus
@ 2011-03-04  1:41   ` Dave Young
  2011-03-04 14:04     ` Don Zickus
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Young @ 2011-03-04  1:41 UTC (permalink / raw)
  To: Don Zickus; +Cc: Andrew Morton, Ingo Molnar, David Miller, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 3775 bytes --]

On Thu, Mar 3, 2011 at 10:59 PM, Don Zickus <dzickus@redhat.com> wrote:
> On Thu, Mar 03, 2011 at 09:58:20PM +0800, Dave Young wrote:
>> proc_dointvec doesn't check extra minmax params, use proc_dointvec_minmax
>> instead of proc_dointvec for cases need boundaries check.
>
> Is this patch needed, if you are basically changing it again in patches 3
> and 5?

Sure if 3 and 5 is acked, if someone object them then this is good?

>
> Cheers,
> Don
>
>>
>> Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
>> ---
>>  kernel/sysctl.c |   12 ++++++------
>>  1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> --- linux-2.6.orig/kernel/sysctl.c    2011-03-03 10:44:53.000000000 +0800
>> +++ linux-2.6/kernel/sysctl.c 2011-03-03 11:02:43.736663258 +0800
>> @@ -374,7 +374,7 @@ static struct ctl_table kern_table[] = {
>>               .data           = &sysctl_sched_autogroup_enabled,
>>               .maxlen         = sizeof(unsigned int),
>>               .mode           = 0644,
>> -             .proc_handler   = proc_dointvec,
>> +             .proc_handler   = proc_dointvec_minmax,
>>               .extra1         = &zero,
>>               .extra2         = &one,
>>       },
>> @@ -1204,7 +1204,7 @@ static struct ctl_table vm_table[] = {
>>               .data           = &block_dump,
>>               .maxlen         = sizeof(block_dump),
>>               .mode           = 0644,
>> -             .proc_handler   = proc_dointvec,
>> +             .proc_handler   = proc_dointvec_minmax,
>>               .extra1         = &zero,
>>       },
>>       {
>> @@ -1212,7 +1212,7 @@ static struct ctl_table vm_table[] = {
>>               .data           = &sysctl_vfs_cache_pressure,
>>               .maxlen         = sizeof(sysctl_vfs_cache_pressure),
>>               .mode           = 0644,
>> -             .proc_handler   = proc_dointvec,
>> +             .proc_handler   = proc_dointvec_minmax,
>>               .extra1         = &zero,
>>       },
>>  #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
>> @@ -1221,7 +1221,7 @@ static struct ctl_table vm_table[] = {
>>               .data           = &sysctl_legacy_va_layout,
>>               .maxlen         = sizeof(sysctl_legacy_va_layout),
>>               .mode           = 0644,
>> -             .proc_handler   = proc_dointvec,
>> +             .proc_handler   = proc_dointvec_minmax,
>>               .extra1         = &zero,
>>       },
>>  #endif
>> @@ -1231,7 +1231,7 @@ static struct ctl_table vm_table[] = {
>>               .data           = &zone_reclaim_mode,
>>               .maxlen         = sizeof(zone_reclaim_mode),
>>               .mode           = 0644,
>> -             .proc_handler   = proc_dointvec,
>> +             .proc_handler   = proc_dointvec_minmax,
>>               .extra1         = &zero,
>>       },
>>       {
>> @@ -1287,7 +1287,7 @@ static struct ctl_table vm_table[] = {
>>               .data           = &vdso_enabled,
>>               .maxlen         = sizeof(vdso_enabled),
>>               .mode           = 0644,
>> -             .proc_handler   = proc_dointvec,
>> +             .proc_handler   = proc_dointvec_minmax,
>>               .extra1         = &zero,
>>       },
>>  #endif
>



-- 
Regards
dave
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH 01/05] use proc_dointvec_minmax to check boundaries while needed
  2011-03-04  1:41   ` Dave Young
@ 2011-03-04 14:04     ` Don Zickus
  2011-03-04 15:21       ` Dave Young
  0 siblings, 1 reply; 5+ messages in thread
From: Don Zickus @ 2011-03-04 14:04 UTC (permalink / raw)
  To: Dave Young; +Cc: Andrew Morton, Ingo Molnar, David Miller, linux-kernel

On Fri, Mar 04, 2011 at 09:41:59AM +0800, Dave Young wrote:
> On Thu, Mar 3, 2011 at 10:59 PM, Don Zickus <dzickus@redhat.com> wrote:
> > On Thu, Mar 03, 2011 at 09:58:20PM +0800, Dave Young wrote:
> >> proc_dointvec doesn't check extra minmax params, use proc_dointvec_minmax
> >> instead of proc_dointvec for cases need boundaries check.
> >
> > Is this patch needed, if you are basically changing it again in patches 3
> > and 5?
> 
> Sure if 3 and 5 is acked, if someone object them then this is good?

Ok.  I guess I would have posted patches 2-4 first to get everyone's
opinion.  Then if the reaction was negative, try with patch 1.

Personally I don't see any problems with patches 2-4.  Then again I don't
deal with sysctl that much, so I don't what rules there are in that area of
code.

Cheers,
Don

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

* Re: [PATCH 01/05] use proc_dointvec_minmax to check boundaries while needed
  2011-03-04 14:04     ` Don Zickus
@ 2011-03-04 15:21       ` Dave Young
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Young @ 2011-03-04 15:21 UTC (permalink / raw)
  To: Don Zickus; +Cc: Andrew Morton, Ingo Molnar, David Miller, linux-kernel

On Fri, Mar 4, 2011 at 10:04 PM, Don Zickus <dzickus@redhat.com> wrote:
> On Fri, Mar 04, 2011 at 09:41:59AM +0800, Dave Young wrote:
>> On Thu, Mar 3, 2011 at 10:59 PM, Don Zickus <dzickus@redhat.com> wrote:
>> > On Thu, Mar 03, 2011 at 09:58:20PM +0800, Dave Young wrote:
>> >> proc_dointvec doesn't check extra minmax params, use proc_dointvec_minmax
>> >> instead of proc_dointvec for cases need boundaries check.
>> >
>> > Is this patch needed, if you are basically changing it again in patches 3
>> > and 5?
>>
>> Sure if 3 and 5 is acked, if someone object them then this is good?
>
> Ok.  I guess I would have posted patches 2-4 first to get everyone's
> opinion.  Then if the reaction was negative, try with patch 1.
>
> Personally I don't see any problems with patches 2-4.  Then again I don't
> deal with sysctl that much, so I don't what rules there are in that area of
> code.

No problem, I will try resend 2-4 with first one merged, Thanks.
-- 
Regards
dave

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

end of thread, other threads:[~2011-03-04 15:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03 13:58 [PATCH 01/05] use proc_dointvec_minmax to check boundaries while needed Dave Young
2011-03-03 14:59 ` Don Zickus
2011-03-04  1:41   ` Dave Young
2011-03-04 14:04     ` Don Zickus
2011-03-04 15:21       ` Dave Young

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