Skip to contentSkip to conversation

smp: Replace deprecated strcpy() with strscpy()

PATCH In review Thorsten Blum 3 participants 5 messages Apr 17, 2025 – Jun 10, 2025 Alpha port

lore
Share & tools
lore
#0 lore raw

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

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

---
 arch/alpha/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/alpha/kernel/smp.c +1 -1
index ed06367ece57..56155b988b9c 100644
@@ -262,7 +262,7 @@ recv_secondary_console_msg(void)
 
 		cnt = cpu->ipc_buffer[0] >> 32;
 		if (cnt <= 0 || cnt >= 80)
-			strcpy(buf, "<<< BOGUS MSG >>>");
+			strscpy(buf, "<<< BOGUS MSG >>>");
 		else {
 			cp1 = (char *) &cpu->ipc_buffer[1];
 			cp2 = buf;
Signature · 1 line
2.49.0
#1 lore raw
Quoted 1 line · Thorsten Blum

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

Are there more strcpy() uses in arch/alpha? Maybe do all of them and give the Subject prefix as "alpha:". If not, the "smp:" prefix is likely to non-specific. Maybe "alpha: smp:".

-Kees

Quoted 25 lines
---
 arch/alpha/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/alpha/kernel/smp.c +1 -1
index ed06367ece57..56155b988b9c 100644
@@ -262,7 +262,7 @@ recv_secondary_console_msg(void)
 
 		cnt = cpu->ipc_buffer[0] >> 32;
 		if (cnt <= 0 || cnt >= 80)
-			strcpy(buf, "<<< BOGUS MSG >>>");
+			strscpy(buf, "<<< BOGUS MSG >>>");
 		else {
 			cp1 = (char *) &cpu->ipc_buffer[1];
 			cp2 = buf;
Signature · 1 line
2.49.0
Signature · 1 line
Kees Cook
#2 lore raw
Quoted 6 lines · Kees Cook
Quoted 1 line · Thorsten Blum

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

Are there more strcpy() uses in arch/alpha? Maybe do all of them and give the Subject prefix as "alpha:". If not, the "smp:" prefix is likely to non-specific. Maybe "alpha: smp:".

There are a handful left, but they're not as straightforward as this one - so I'd prefer to keep them separate.

Could the committer change the subject to "alpha: smp:" or should I submit a v2 just for the title?

Thanks,
Thorsten

maintainer
#3 lore raw
Quoted 9 lines · Thorsten Blum
Quoted 6 lines · Kees Cook
Quoted 1 line · Thorsten Blum

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

Are there more strcpy() uses in arch/alpha? Maybe do all of them and give the Subject prefix as "alpha:". If not, the "smp:" prefix is likely to non-specific. Maybe "alpha: smp:".

Quoted 5 lines

There are a handful left, but they're not as straightforward as this one - so I'd prefer to keep them separate.

Could the committer change the subject to "alpha: smp:" or should I submit a v2 just for the title?

I'll fix it up when I add it to my tree.

Thanks!
Matt

#4 lore raw

Hi Matt,

Quoted 10 lines · Matt Turner
Quoted 9 lines · Thorsten Blum
Quoted 6 lines · Kees Cook
Quoted 1 line · Thorsten Blum

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

Are there more strcpy() uses in arch/alpha? Maybe do all of them and give the Subject prefix as "alpha:". If not, the "smp:" prefix is likely to non-specific. Maybe "alpha: smp:".

Quoted 7 lines
Quoted 5 lines

There are a handful left, but they're not as straightforward as this one - so I'd prefer to keep them separate.

Could the committer change the subject to "alpha: smp:" or should I submit a v2 just for the title?

I'll fix it up when I add it to my tree.

This one didn't make it into the last merge window, did it?

Should I resend it or can you take care of it?

Thanks,
Thorsten