[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202006260845.B573D53@keescook>
Date: Fri, 26 Jun 2020 08:51:50 -0700
From: Kees Cook <keescook@...omium.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
rjw@...ysocki.net, viresh.kumar@...aro.org, lenb@...nel.org,
dsmythies@...us.net, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, x86@...nel.org, jic23@....ac.uk,
akpm@...ux-foundation.org
Subject: Re: [PATCH] lib: Extend kstrtobool() to accept "true"/"false"
On Fri, Jun 26, 2020 at 12:44:42PM +0200, Peter Zijlstra wrote:
> On Fri, Jun 26, 2020 at 12:22:55PM +0200, Peter Zijlstra wrote:
>
> > > This is too lax - it will be enabled for any !0 value. Please accept
> > > only 0 and 1.
> >
> > kstrtobool() ftw
>
> And looking at that, I find it really strange it does not in fact accept
> "true" / "false", so how about this?
>
> ---
> Subject: lib: Extend kstrtobool() to accept "true"/"false"
>
> Extend the strings recognised by kstrtobool() to cover:
>
> - 1/0
> - y/n
> - yes/no (new)
> - t/f (new)
> - true/false (new)
> - on/off
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
There were some worries about dealing with unterminated strings when I
did the original conversion[1], but I think those all got fixed.
Reviewed-by: Kees Cook <keescook@...omium.org>
[1] https://lore.kernel.org/lkml/CAGXu5jJrFv5Y8Q_i3yFYBDmT0+pO05dS3ijB0gOn-huasxZWmA@mail.gmail.com/
--
Kees Cook
Powered by blists - more mailing lists