All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] drivers: dio: replace deprecated strcpy with strscpy in dio_init
@ 2026-05-04  8:18 Thorsten Blum
  2026-05-04  8:18 ` [PATCH v2 2/2] drivers: dio: use tabs and avoid continuation logging " Thorsten Blum
  2026-05-04  9:31 ` [PATCH v2 1/2] drivers: dio: replace deprecated strcpy with strscpy " Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-05-04  8:18 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-kernel, linux-m68k, Thorsten Blum

strcpy() has been deprecated [1] because it performs no bounds checking
on the destination buffer, which can lead to buffer overflows. While the
current code works correctly, replace strcpy() with the safer strscpy()
to follow secure coding best practices.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/dio/dio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c
index 419b3c13d491..4a3ddda97d7c 100644
--- a/drivers/dio/dio.c
+++ b/drivers/dio/dio.c
@@ -247,7 +247,7 @@ static int __init dio_init(void)
 			dev->id = prid;
 
 		dev->ipl = DIO_IPL(va);
-		strcpy(dev->name, dio_getname(dev->id));
+		strscpy(dev->name, dio_getname(dev->id));
                 printk(KERN_INFO "select code %3d: ipl %d: ID %02X", dev->scode, dev->ipl, prid);
 		if (DIO_NEEDSSECID(prid))
                         printk(":%02X", secid);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-04  9:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-04  8:18 [PATCH v2 1/2] drivers: dio: replace deprecated strcpy with strscpy in dio_init Thorsten Blum
2026-05-04  8:18 ` [PATCH v2 2/2] drivers: dio: use tabs and avoid continuation logging " Thorsten Blum
2026-05-04  9:32   ` Geert Uytterhoeven
2026-05-04  9:31 ` [PATCH v2 1/2] drivers: dio: replace deprecated strcpy with strscpy " Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.