Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 22 Feb 2021 09:36:51 -0700
From: Shuah Khan <>
To: Romain Perier <>, Kees Cook
 Tejun Heo <>, Zefan Li <>,
 Johannes Weiner <>,
 Herbert Xu <>,
 "David S. Miller" <>, Jiri Pirko <>,
 Sumit Semwal <>,
 Christian K├Ânig <>,
 Greg Kroah-Hartman <>,
 Mimi Zohar <>, Dmitry Kasatkin
 <>, "J. Bruce Fields" <>,
 Chuck Lever <>,
 Geert Uytterhoeven <>, Jessica Yu <>,
 Guenter Roeck <>, Heiko Carstens <>,
 Vasily Gorbik <>,
 Christian Borntraeger <>,
 Steffen Maier <>, Benjamin Block <>,
 "Martin K. Petersen" <>,
 Jaroslav Kysela <>, Takashi Iwai <>,
 Steven Rostedt <>, Ingo Molnar <>,
 Jiri Slaby <>, Felipe Balbi <>,
 Valentina Manea <>, Shuah Khan
 <>, Wim Van Sebroeck <>
 "Rafael J. Wysocki" <>,,,,,,,,,,,,
 Shuah Khan <>
Subject: Re: [PATCH 00/20] Manual replacement of all strlcpy in favor of

On 2/22/21 8:12 AM, Romain Perier wrote:
> strlcpy() copy a C-String into a sized buffer, the result is always a
> valid NULL-terminated that fits in the buffer, howerver it has severals
> issues. It reads the source buffer first, which is dangerous if it is non
> NULL-terminated or if the corresponding buffer is unbounded. Its safe
> replacement is strscpy(), as suggested in the deprecated interface [1].
> We plan to make this contribution in two steps:
> - Firsly all cases of strlcpy's return value are manually replaced by the
>    corresponding calls of strscpy() with the new handling of the return
>    value (as the return code is different in case of error).
> - Then all other cases are automatically replaced by using coccinelle.

Cool. A quick check shows me 1031 strscpy() calls with no return
checks. All or some of these probably need to be reviewed and add
return checks. Is this something that is in the plan to address as
part of this work?

-- Shuah

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.