projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b74440d
)
cgroup: use strscpy() is more robust and safer
author
ye xingchen
<ye.xingchen@zte.com.cn>
Wed, 21 Sep 2022 09:35:17 +0000
(09:35 +0000)
committer
Tejun Heo
<tj@kernel.org>
Sat, 24 Sep 2022 03:27:02 +0000
(17:27 -1000)
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c
patch
|
blob
|
blame
|
history
diff --git
a/kernel/cgroup/cgroup.c
b/kernel/cgroup/cgroup.c
index c37b8265c0a38f56baa7b02faafef466554a504b..151c55d2e01603c80d624c7f5a2e60c04d46abeb 100644
(file)
--- a/
kernel/cgroup/cgroup.c
+++ b/
kernel/cgroup/cgroup.c
@@
-2374,7
+2374,7
@@
int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen)
ret = cgroup_path_ns_locked(cgrp, buf, buflen, &init_cgroup_ns);
} else {
/* if no hierarchy exists, everyone is in "/" */
- ret = str
l
cpy(buf, "/", buflen);
+ ret = str
s
cpy(buf, "/", buflen);
}
spin_unlock_irq(&css_set_lock);