Re: [GIT PULL] cgroup fixes for v4.15-rc7

From: Linus Torvalds
Date: Mon Jan 08 2018 - 14:20:48 EST


On Mon, Jan 8, 2018 at 6:52 AM, Tejun Heo <tj@xxxxxxxxxx> wrote:
>
> There also are two patches to replace unlimited strcpy() usages with
> strlcpy().

Christ, people.

strlcpy() is crap. It doesn't fix anything. If you have a untrusted
source string, then strlcpy() does "strlen()" on the source, so it
will overrun the source.

And if you don't have an untrusted source, why the hell are you using
that function in the first place?

The interface was designed by morons on crack.

Use "strscpy()", which got this _right_.

We should probably just remove that sh*t-for-brains strlcpy()
function. It's broken garbage.

Linus