]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cgroup: Replace deprecated strcpy() with strscpy()
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 12 Aug 2025 11:50:35 +0000 (13:50 +0200)
committerTejun Heo <tj@kernel.org>
Tue, 12 Aug 2025 18:57:03 +0000 (08:57 -1000)
strcpy() is deprecated; use strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup-v1.c

index 2a4a387f867abcf8dd534981b7b6e2cb45caa52c..763343fbd5a174503aeedb9292c0a9f8764f3af7 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/sched/task.h>
 #include <linux/magic.h>
 #include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/vmalloc.h>
 #include <linux/delayacct.h>
 #include <linux/pid_namespace.h>
@@ -1133,7 +1134,7 @@ int cgroup1_reconfigure(struct fs_context *fc)
 
        if (ctx->release_agent) {
                spin_lock(&release_agent_path_lock);
-               strcpy(root->release_agent_path, ctx->release_agent);
+               strscpy(root->release_agent_path, ctx->release_agent);
                spin_unlock(&release_agent_path_lock);
        }