lkml.org 
[lkml]   [2019]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload"
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

\
 
 \ /
  Last update: 2019-06-25 05:54    [W:0.080 / U:21.804 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site