mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eiichi Tsukata <devel@etsukata.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: jslaby@suse.com, davem@davemloft.net, kuznet@ms2.inr.ac.ru,
	yoshfuji@linux-ipv6.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] tty: ldisc: Fix misuse of proc_dointvec "ldisc_autoload"
Date: Tue, 25 Jun 2019 13:40:05 +0900	[thread overview]
Message-ID: <ffef8850-7523-ad63-165d-2bde9a98e340@etsukata.com> (raw)
In-Reply-To: <20190625033216.GA11902@kroah.com>



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

      reply	other threads:[~2019-06-25  4:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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 message]

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=ffef8850-7523-ad63-165d-2bde9a98e340@etsukata.com \
    --to=devel@etsukata.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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

all inboxes | Powered by JetHome®