|
Message-ID: <CABgxDoLgJH4EYQgGkbWEJ=CFR1fQar6+Jcr3nARaPt__PO4jVQ@mail.gmail.com>
Date: Tue, 23 Feb 2021 10:43:48 +0100
From: Romain Perier <romain.perier@...il.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Kees Cook <keescook@...omium.org>,
Kernel Hardening <kernel-hardening@...ts.openwall.com>, linux-hwmon@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 11/20] hwmon: Manual replacement of the deprecated
strlcpy() with return values
Le lun. 22 févr. 2021 à 16:46, Guenter Roeck <linux@...ck-us.net> a écrit :
> On 2/22/21 7:12 AM, Romain Perier wrote:
> > The strlcpy() reads the entire source buffer first, it is dangerous if
> > the source buffer lenght is unbounded or possibility non NULL-terminated.
>
> length
>
> > It can lead to linear read overflows, crashes, etc...
> >
> Not here. This description is misleading.
>
> > As recommended in the deprecated interfaces [1], it should be replaced
> > by strscpy.
> >
> > This commit replaces all calls to strlcpy that handle the return values
> > by the corresponding strscpy calls with new handling of the return
> > values (as it is quite different between the two functions).
> >
> > [1]
> https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
> >
> > Signed-off-by: Romain Perier <romain.perier@...il.com>
>
> This patch just adds pain to injury, as the source 'buffers' are all fixed
> strings and their length will never exceed the maximum buffer length.
> I really don't see the point of using strscpy() in this situation.
>
>
Hi,
No, no insult or offense at all here (sorry if you understood like this, it
is not my intention ^^), it is just a general description of what the usage
of strlcpy might cause (the description is not specific to your code). The
initial idea was to globally replace all occurrences of the old by the new
functions (the old being deprecated for a reason), however, if some
maintainers disagree or don't think that their drivers are affected, no
problem we can exclude these from the patches series.
Romain
Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.