All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload"
@ 2019-06-25  3:08 Eiichi Tsukata
  2019-06-25  3:08 ` [PATCH 2/2] net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down" Eiichi Tsukata
  2019-06-25  3:32 ` [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload" Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Eiichi Tsukata @ 2019-06-25  3:08 UTC (permalink / raw)
  To: gregkh, jslaby, davem, kuznet, yoshfuji, linux-kernel, netdev
  Cc: Eiichi Tsukata

/proc/sys/dev/tty/ldisc_autoload assumes given value to be 0 or 1. Use
proc_dointvec_minmax instead of proc_dointvec.

Fixes: 7c0cca7c847e "(tty: ldisc: add sysctl to prevent autoloading of ldiscs)"
Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
---
 drivers/tty/tty_ldisc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index e38f104db174..a8ea7a35c94e 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -863,7 +863,7 @@ static struct ctl_table tty_table[] = {
 		.data		= &tty_ldisc_autoload,
 		.maxlen		= sizeof(tty_ldisc_autoload),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= &zero,
 		.extra2		= &one,
 	},
-- 
2.21.0


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

* [PATCH 2/2] net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down"
  2019-06-25  3:08 [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload" Eiichi Tsukata
@ 2019-06-25  3:08 ` Eiichi Tsukata
  2019-06-25 19:59   ` David Miller
  2019-06-25  3:32 ` [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload" Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Eiichi Tsukata @ 2019-06-25  3:08 UTC (permalink / raw)
  To: gregkh, jslaby, davem, kuznet, yoshfuji, linux-kernel, netdev
  Cc: Eiichi Tsukata

/proc/sys/net/ipv6/route/skip_notify_on_dev_down assumes given value to be
0 or 1. Use proc_dointvec_minmax instead of proc_dointvec.

Fixes: 7c6bb7d2faaf ("net/ipv6: Add knob to skip DELROUTE message ondevice down")
Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 11ad62effd56..aade636c6be6 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5281,7 +5281,7 @@ static struct ctl_table ipv6_route_table_template[] = {
 		.data		=	&init_net.ipv6.sysctl.skip_notify_on_dev_down,
 		.maxlen		=	sizeof(int),
 		.mode		=	0644,
-		.proc_handler	=	proc_dointvec,
+		.proc_handler	=	proc_dointvec_minmax,
 		.extra1		=	&zero,
 		.extra2		=	&one,
 	},
-- 
2.21.0


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

* Re: [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload"
  2019-06-25  3:08 [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload" Eiichi Tsukata
  2019-06-25  3:08 ` [PATCH 2/2] net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down" Eiichi Tsukata
@ 2019-06-25  3:32 ` Greg KH
  2019-06-25  4:40   ` Eiichi Tsukata
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2019-06-25  3:32 UTC (permalink / raw)
  To: Eiichi Tsukata; +Cc: jslaby, davem, kuznet, yoshfuji, linux-kernel, netdev

On Tue, Jun 25, 2019 at 12:08:00PM +0900, Eiichi Tsukata wrote:
> /proc/sys/dev/tty/ldisc_autoload assumes given value to be 0 or 1. Use
> proc_dointvec_minmax instead of proc_dointvec.
> 
> Fixes: 7c0cca7c847e "(tty: ldisc: add sysctl to prevent autoloading of ldiscs)"
> Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
> ---
>  drivers/tty/tty_ldisc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
> index e38f104db174..a8ea7a35c94e 100644
> --- a/drivers/tty/tty_ldisc.c
> +++ b/drivers/tty/tty_ldisc.c
> @@ -863,7 +863,7 @@ static struct ctl_table tty_table[] = {
>  		.data		= &tty_ldisc_autoload,
>  		.maxlen		= sizeof(tty_ldisc_autoload),
>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_minmax,
>  		.extra1		= &zero,
>  		.extra2		= &one,

Ah, nice catch.  But this really isn't an issue as if you use a bigger
value, things will not "break", right?

thanks,

greg k-h

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

* Re: [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload"
  2019-06-25  3:32 ` [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload" Greg KH
@ 2019-06-25  4:40   ` Eiichi Tsukata
  0 siblings, 0 replies; 5+ messages in thread
From: Eiichi Tsukata @ 2019-06-25  4:40 UTC (permalink / raw)
  To: Greg KH; +Cc: jslaby, davem, kuznet, yoshfuji, linux-kernel, netdev



On 2019/06/25 12:32, Greg KH wrote:
> On Tue, Jun 25, 2019 at 12:08:00PM +0900, Eiichi Tsukata wrote:
>> /proc/sys/dev/tty/ldisc_autoload assumes given value to be 0 or 1. Use
>> proc_dointvec_minmax instead of proc_dointvec.
>>
>> Fixes: 7c0cca7c847e "(tty: ldisc: add sysctl to prevent autoloading of ldiscs)"
>> Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
>> ---
>>  drivers/tty/tty_ldisc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
>> index e38f104db174..a8ea7a35c94e 100644
>> --- a/drivers/tty/tty_ldisc.c
>> +++ b/drivers/tty/tty_ldisc.c
>> @@ -863,7 +863,7 @@ static struct ctl_table tty_table[] = {
>>  		.data		= &tty_ldisc_autoload,
>>  		.maxlen		= sizeof(tty_ldisc_autoload),
>>  		.mode		= 0644,
>> -		.proc_handler	= proc_dointvec,
>> +		.proc_handler	= proc_dointvec_minmax,
>>  		.extra1		= &zero,
>>  		.extra2		= &one,
> 
> Ah, nice catch.  But this really isn't an issue as if you use a bigger
> value, things will not "break", right?
> 

Someone may misuse -1 to disable ldisc autoload, but basically it does not
"break".

Thanks,

Eiichi

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

* Re: [PATCH 2/2] net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down"
  2019-06-25  3:08 ` [PATCH 2/2] net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down" Eiichi Tsukata
@ 2019-06-25 19:59   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2019-06-25 19:59 UTC (permalink / raw)
  To: devel; +Cc: gregkh, jslaby, kuznet, yoshfuji, linux-kernel, netdev

From: Eiichi Tsukata <devel@etsukata.com>
Date: Tue, 25 Jun 2019 12:08:01 +0900

> /proc/sys/net/ipv6/route/skip_notify_on_dev_down assumes given value to be
> 0 or 1. Use proc_dointvec_minmax instead of proc_dointvec.
> 
> Fixes: 7c6bb7d2faaf ("net/ipv6: Add knob to skip DELROUTE message ondevice down")
> Signed-off-by: Eiichi Tsukata <devel@etsukata.com>

Applied.

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

end of thread, other threads:[~2019-06-25 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25  3:08 [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload" Eiichi Tsukata
2019-06-25  3:08 ` [PATCH 2/2] net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down" Eiichi Tsukata
2019-06-25 19:59   ` David Miller
2019-06-25  3:32 ` [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload" Greg KH
2019-06-25  4:40   ` Eiichi Tsukata

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.