Re: [PATCH 01/20] cgroup: Manual replacement of the deprecated strlcpy() with return values

2021-02-23 Thread Michal Koutný
Hello. On Mon, Feb 22, 2021 at 04:12:12PM +0100, Romain Perier wrote: > --- a/kernel/cgroup/cgroup.c > +++ b/kernel/cgroup/cgroup.c > @@ -2265,7 +2265,7 @@ int task_cgroup_path(struct task_struct *task, char > *buf, size_t buflen) Actually, this function isn't used at all. So I'd instead propos

[PATCH 01/20] cgroup: Manual replacement of the deprecated strlcpy() with return values

2021-02-22 Thread Romain Perier
The strlcpy() reads the entire source buffer first, it is dangerous if the source buffer lenght is unbounded or possibility non NULL-terminated. It can lead to linear read overflows, crashes, etc... As recommended in the deprecated interfaces [1], it should be replaced by strscpy. This commit rep