tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload"
Subsystems (4)
PATCH 1/2 tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload"
/proc/sys/dev/tty/ldisc_autoload assumes given value to be 0 or 1. Use proc_dointvec_minmax instead of proc_dointvec.
--- drivers/tty/tty_ldisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/tty_ldisc.c +1 -1
@@ -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, },
Signature · 1 line
2.21.0
PATCH 2/2 net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down"
/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.
--- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/route.c +1 -1
@@ -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, },
Signature · 1 line
2.21.0
Re: [PATCH 2/2] net/ipv6: Fix misuse of proc_dointvec "skip_notify_on_dev_down"
From: Eiichi Tsukata <[email protected]>
Date: Tue, 25 Jun 2019 12:08:01 +0900
Quoted 5 lines
/proc/sys/net/ipv6/route/skip_notify_on_dev_downassumes given value to be 0 or 1. Useproc_dointvec_minmaxinstead ofproc_dointvec.Fixes 7c6bb7d2faaf ("net/ipv6: Add knob to skip DELROUTE message ondevice down")Signed-off-by Eiichi Tsukata <[email protected]>
Applied.
Greg KH
maintainerQuoted 14 lines · Eiichi Tsukata
/proc/sys/dev/tty/ldisc_autoloadassumes given value to be 0 or 1. Useproc_dointvec_minmaxinstead ofproc_dointvec.Fixes 7c0cca7c847e "(tty: ldisc: add sysctl to prevent autoloading of ldiscs)"Signed-off-by Eiichi Tsukata <[email protected]>--- drivers/tty/tty_ldisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/tty_ldisc.c +0
-0
drivers/tty/tty_ldisc.c static struct ctl_table tty_table[] = { · line 868
Quoted 7 lines
drivers/tty/tty_ldisc.c +1
-1@@ -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
Quoted 10 lines · Greg KH
Quoted 9 lines · Eiichi Tsukata
/proc/sys/dev/tty/ldisc_autoloadassumes given value to be 0 or 1. Useproc_dointvec_minmaxinstead ofproc_dointvec.Fixes 7c0cca7c847e "(tty: ldisc: add sysctl to prevent autoloading of ldiscs)"Signed-off-by Eiichi Tsukata <[email protected]>--- drivers/tty/tty_ldisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
drivers/tty/tty_ldisc.c static struct ctl_table tty_table[] = { · line 868
Quoted 12 lines
drivers/tty/tty_ldisc.c +1
-1@@ -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