Skip to contentSkip to conversation

cgroup: Replace deprecated strcpy() with strscpy()

PATCH Applied Thorsten Blum 2 participants 2 messages Aug 12, 2025 cgroup

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgroup: Replace deprecated strcpy() with strscpy()

strcpy() is deprecated; use strscpy() instead.

---
 kernel/cgroup/cgroup-v1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/cgroup/cgroup-v1.c +2 -1
index fa24c032ed6f..b551d9f47af5 100644
@@ -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>
@@ -1129,7 +1130,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);
 	}
 
Signature · 1 line
2.50.1