public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 00/35] Use safer strscpy() instead of strcpy()
@ 2026-04-25  6:58 Ai Chao
  2026-04-25  6:58 ` [PATCH 01/35] fbdev: matroxfb: " Ai Chao
                   ` (18 more replies)
  0 siblings, 19 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

This patch series introduces wrapper functions strscpy().

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Summary:

  fbdev: matroxfb: Use safer strscpy() instead of strcpy()
  fbdev: i810: Use safer strscpy() instead of strcpy()
  fbdev: sisfb: Use safer strscpy() instead of strcpy()
  fbdev: geode: Use safer strscpy() instead of strcpy()
  fbdev: atafb: Use safer strscpy() instead of strcpy()
  fbdev: tdfxfb: Use safer strscpy() instead of strcpy()
  fbdev: pm2fb: Use safer strscpy() instead of strcpy()
  fbdev: xen-fbfront: Use safer strscpy() instead of strcpy()
  fbdev: controlfb: Use safer strscpy() instead of strcpy()
  fbdev: stifb: Use safer strscpy() instead of strcpy()
  fbdev: fm2fb: Use safer strscpy() instead of strcpy()
  fbdev: arkfb: Use safer strscpy() instead of strcpy()
  fbdev: vt8500lcdfb: Use safer strscpy() instead of strcpy()
  fbdev: vt8623fb: Use safer strscpy() instead of strcpy()
  fbdev: gbefb: Use safer strscpy() instead of strcpy()
  fbdev: wm8505fb: Use safer strscpy() instead of strcpy()
  fbdev: rivafb: Use safer strscpy() instead of strcpy()
  fbdev: sh7760fb: Use safer strscpy() instead of strcpy()
  fbdev: savage: Use safer strscpy() instead of strcpy()
  fbdev: atmel_lcdfb: Use safer strscpy() instead of strcpy()
  fbdev: aty128fb: Use safer strscpy() instead of strcpy()
  fbdev: amifb: Use safer strscpy() instead of strcpy()
  fbdev: s3fb: Use safer strscpy() instead of strcpy()
  fbdev: viafb: Use safer strscpy() instead of strcpy()
  fbdev: platinumfb: Use safer strscpy() instead of strcpy()
  fbdev: cyber2000fb: Use safer strscpy() instead of strcpy()
  fbdev: mb862xxfb: Use safer strscpy() instead of strcpy()
  fbdev: mmpfb: Use safer strscpy() instead of strcpy()
  fbdev: ep93xx-fb: Use safer strscpy() instead of strcpy()
  fbdev: valkyriefb: Use safer strscpy() instead of strcpy()
  fbdev: pxafb: Use safer strscpy() instead of strcpy()
  fbdev: sa1100fb: Use safer strscpy() instead of strcpy()
  fbdev: sm501fb: Use safer strscpy() instead of strcpy()
  fbdev: acornfb: Use safer strscpy() instead of strcpy()
  fbdev: ocfb: Use safer strscpy() instead of strcpy()

 drivers/video/fbdev/acornfb.c               |  2 +-
 drivers/video/fbdev/amifb.c                 |  2 +-
 drivers/video/fbdev/arkfb.c                 |  2 +-
 drivers/video/fbdev/atafb.c                 | 10 +++++-----
 drivers/video/fbdev/atmel_lcdfb.c           |  2 +-
 drivers/video/fbdev/aty/aty128fb.c          |  2 +-
 drivers/video/fbdev/controlfb.c             |  2 +-
 drivers/video/fbdev/cyber2000fb.c           |  2 +-
 drivers/video/fbdev/ep93xx-fb.c             |  2 +-
 drivers/video/fbdev/fm2fb.c                 |  2 +-
 drivers/video/fbdev/gbefb.c                 |  2 +-
 drivers/video/fbdev/geode/gx1fb_core.c      |  2 +-
 drivers/video/fbdev/geode/gxfb_core.c       |  2 +-
 drivers/video/fbdev/geode/lxfb_core.c       |  2 +-
 drivers/video/fbdev/i810/i810-i2c.c         |  2 +-
 drivers/video/fbdev/i810/i810_main.c        |  2 +-
 drivers/video/fbdev/matrox/matroxfb_base.c  |  6 +++---
 drivers/video/fbdev/matrox/matroxfb_crtc2.c |  2 +-
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c  |  2 +-
 drivers/video/fbdev/mmp/fb/mmpfb.c          |  2 +-
 drivers/video/fbdev/ocfb.c                  |  2 +-
 drivers/video/fbdev/platinumfb.c            |  2 +-
 drivers/video/fbdev/pm2fb.c                 |  6 +++---
 drivers/video/fbdev/pxafb.c                 |  2 +-
 drivers/video/fbdev/riva/rivafb-i2c.c       |  2 +-
 drivers/video/fbdev/s3fb.c                  |  2 +-
 drivers/video/fbdev/sa1100fb.c              |  2 +-
 drivers/video/fbdev/savage/savagefb-i2c.c   |  2 +-
 drivers/video/fbdev/sh7760fb.c              |  2 +-
 drivers/video/fbdev/sis/sis_main.c          | 16 ++++++++--------
 drivers/video/fbdev/sm501fb.c               |  2 +-
 drivers/video/fbdev/stifb.c                 |  2 +-
 drivers/video/fbdev/tdfxfb.c                |  6 +++---
 drivers/video/fbdev/valkyriefb.c            |  2 +-
 drivers/video/fbdev/via/viafbdev.c          |  2 +-
 drivers/video/fbdev/vt8500lcdfb.c           |  2 +-
 drivers/video/fbdev/vt8623fb.c              |  2 +-
 drivers/video/fbdev/wm8505fb.c              |  2 +-
 drivers/video/fbdev/xen-fbfront.c           |  2 +-
 39 files changed, 56 insertions(+), 56 deletions(-)

-- 
2.34.1



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

* [PATCH 01/35] fbdev: matroxfb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
@ 2026-04-25  6:58 ` Ai Chao
  2026-04-25  6:58 ` [PATCH 02/35] fbdev: i810: " Ai Chao
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/matrox/matroxfb_base.c  | 6 +++---
 drivers/video/fbdev/matrox/matroxfb_crtc2.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c
index e1a4bc7c2318..bd786543478c 100644
--- a/drivers/video/fbdev/matrox/matroxfb_base.c
+++ b/drivers/video/fbdev/matrox/matroxfb_base.c
@@ -709,7 +709,7 @@ static void matroxfb_init_fix(struct matrox_fb_info *minfo)
 	struct fb_fix_screeninfo *fix = &minfo->fbcon.fix;
 	DBG(__func__)
 
-	strcpy(fix->id,"MATROX");
+	strscpy(fix->id, "MATROX");
 
 	fix->xpanstep = 8;	/* 8 for 8bpp, 4 for 16bpp, 2 for 32bpp */
 	fix->ypanstep = 1;
@@ -1091,8 +1091,8 @@ static int matroxfb_ioctl(struct fb_info *info,
 				struct v4l2_capability r;
 
 				memset(&r, 0, sizeof(r));
-				strcpy(r.driver, "matroxfb");
-				strcpy(r.card, "Matrox");
+				strscpy(r.driver, "matroxfb");
+				strscpy(r.card, "Matrox");
 				sprintf(r.bus_info, "PCI:%s", pci_name(minfo->pcidev));
 				r.version = KERNEL_VERSION(1,0,0);
 				r.capabilities = V4L2_CAP_VIDEO_OUTPUT;
diff --git a/drivers/video/fbdev/matrox/matroxfb_crtc2.c b/drivers/video/fbdev/matrox/matroxfb_crtc2.c
index 8de882b09a24..c20dd06c5fcd 100644
--- a/drivers/video/fbdev/matrox/matroxfb_crtc2.c
+++ b/drivers/video/fbdev/matrox/matroxfb_crtc2.c
@@ -299,7 +299,7 @@ static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info)
 {
 	struct fb_fix_screeninfo *fix = &m2info->fbcon.fix;
 
-	strcpy(fix->id, "MATROX DH");
+	strscpy(fix->id, "MATROX DH");
 
 	fix->smem_start = m2info->video.base;
 	fix->smem_len = m2info->video.len_usable;
-- 
2.34.1



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

* [PATCH 02/35] fbdev: i810: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
  2026-04-25  6:58 ` [PATCH 01/35] fbdev: matroxfb: " Ai Chao
@ 2026-04-25  6:58 ` Ai Chao
  2026-04-25  6:58 ` [PATCH 03/35] fbdev: sisfb: " Ai Chao
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/i810/i810-i2c.c  | 2 +-
 drivers/video/fbdev/i810/i810_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/i810/i810-i2c.c b/drivers/video/fbdev/i810/i810-i2c.c
index 7db17d0d8a8c..6141e9d2fff4 100644
--- a/drivers/video/fbdev/i810/i810-i2c.c
+++ b/drivers/video/fbdev/i810/i810-i2c.c
@@ -91,7 +91,7 @@ static int i810_setup_i2c_bus(struct i810fb_i2c_chan *chan, const char *name)
 {
         int rc;
 
-        strcpy(chan->adapter.name, name);
+	strscpy(chan->adapter.name, name);
         chan->adapter.owner             = THIS_MODULE;
         chan->adapter.algo_data         = &chan->algo;
         chan->adapter.dev.parent        = &chan->par->dev->dev;
diff --git a/drivers/video/fbdev/i810/i810_main.c b/drivers/video/fbdev/i810/i810_main.c
index 10b914a24114..0499058a3ea8 100644
--- a/drivers/video/fbdev/i810/i810_main.c
+++ b/drivers/video/fbdev/i810/i810_main.c
@@ -1091,7 +1091,7 @@ static int encode_fix(struct fb_fix_screeninfo *fix, struct fb_info *info)
 
     	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
 
-    	strcpy(fix->id, "I810");
+	strscpy(fix->id, "I810");
 	mutex_lock(&info->mm_lock);
     	fix->smem_start = par->fb.physical;
     	fix->smem_len = par->fb.size;
-- 
2.34.1



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

* [PATCH 03/35] fbdev: sisfb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
  2026-04-25  6:58 ` [PATCH 01/35] fbdev: matroxfb: " Ai Chao
  2026-04-25  6:58 ` [PATCH 02/35] fbdev: i810: " Ai Chao
@ 2026-04-25  6:58 ` Ai Chao
  2026-04-25  8:08   ` Helge Deller
  2026-04-25  6:58 ` [PATCH 04/35] fbdev: geode: " Ai Chao
                   ` (15 subsequent siblings)
  18 siblings, 1 reply; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/sis/sis_main.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index 84567d67f71d..e87fa261f76c 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -205,7 +205,7 @@ static void sisfb_search_mode(char *name, bool quiet)
 	}
 
 	if(strlen(name) <= 19) {
-		strcpy(strbuf1, name);
+		strscpy(strbuf1, name);
 		for(i = 0; i < strlen(strbuf1); i++) {
 			if(strbuf1[i] < '0' || strbuf1[i] > '9') strbuf1[i] = ' ';
 		}
@@ -5947,33 +5947,33 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 #ifdef CONFIG_FB_SIS_300
 		case PCI_DEVICE_ID_SI_730:
 			ivideo->chip = SIS_730;
-			strcpy(ivideo->myid, "SiS 730");
+			strscpy(ivideo->myid, "SiS 730");
 			break;
 #endif
 #ifdef CONFIG_FB_SIS_315
 		case PCI_DEVICE_ID_SI_651:
 			/* ivideo->chip is ok */
-			strcpy(ivideo->myid, "SiS 651");
+			strscpy(ivideo->myid, "SiS 651");
 			break;
 		case PCI_DEVICE_ID_SI_740:
 			ivideo->chip = SIS_740;
-			strcpy(ivideo->myid, "SiS 740");
+			strscpy(ivideo->myid, "SiS 740");
 			break;
 		case PCI_DEVICE_ID_SI_661:
 			ivideo->chip = SIS_661;
-			strcpy(ivideo->myid, "SiS 661");
+			strscpy(ivideo->myid, "SiS 661");
 			break;
 		case PCI_DEVICE_ID_SI_741:
 			ivideo->chip = SIS_741;
-			strcpy(ivideo->myid, "SiS 741");
+			strscpy(ivideo->myid, "SiS 741");
 			break;
 		case PCI_DEVICE_ID_SI_760:
 			ivideo->chip = SIS_760;
-			strcpy(ivideo->myid, "SiS 760");
+			strscpy(ivideo->myid, "SiS 760");
 			break;
 		case PCI_DEVICE_ID_SI_761:
 			ivideo->chip = SIS_761;
-			strcpy(ivideo->myid, "SiS 761");
+			strscpy(ivideo->myid, "SiS 761");
 			break;
 #endif
 		default:
-- 
2.34.1



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

* [PATCH 04/35] fbdev: geode: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (2 preceding siblings ...)
  2026-04-25  6:58 ` [PATCH 03/35] fbdev: sisfb: " Ai Chao
@ 2026-04-25  6:58 ` Ai Chao
  2026-04-25  6:58 ` [PATCH 05/35] fbdev: atafb: " Ai Chao
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/geode/gx1fb_core.c | 2 +-
 drivers/video/fbdev/geode/gxfb_core.c  | 2 +-
 drivers/video/fbdev/geode/lxfb_core.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/geode/gx1fb_core.c b/drivers/video/fbdev/geode/gx1fb_core.c
index a1919c1934ac..c5a6e3038b98 100644
--- a/drivers/video/fbdev/geode/gx1fb_core.c
+++ b/drivers/video/fbdev/geode/gx1fb_core.c
@@ -274,7 +274,7 @@ static struct fb_info *gx1fb_init_fbinfo(struct device *dev)
 
 	par = info->par;
 
-	strcpy(info->fix.id, "GX1");
+	strscpy(info->fix.id, "GX1");
 
 	info->fix.type		= FB_TYPE_PACKED_PIXELS;
 	info->fix.type_aux	= 0;
diff --git a/drivers/video/fbdev/geode/gxfb_core.c b/drivers/video/fbdev/geode/gxfb_core.c
index 8d69be7c9d31..fe987829315b 100644
--- a/drivers/video/fbdev/geode/gxfb_core.c
+++ b/drivers/video/fbdev/geode/gxfb_core.c
@@ -289,7 +289,7 @@ static struct fb_info *gxfb_init_fbinfo(struct device *dev)
 
 	par = info->par;
 
-	strcpy(info->fix.id, "Geode GX");
+	strscpy(info->fix.id, "Geode GX");
 
 	info->fix.type		= FB_TYPE_PACKED_PIXELS;
 	info->fix.type_aux	= 0;
diff --git a/drivers/video/fbdev/geode/lxfb_core.c b/drivers/video/fbdev/geode/lxfb_core.c
index cad99f5b7fe8..3ae37ec9f151 100644
--- a/drivers/video/fbdev/geode/lxfb_core.c
+++ b/drivers/video/fbdev/geode/lxfb_core.c
@@ -412,7 +412,7 @@ static struct fb_info *lxfb_init_fbinfo(struct device *dev)
 
 	par = info->par;
 
-	strcpy(info->fix.id, "Geode LX");
+	strscpy(info->fix.id, "Geode LX");
 
 	info->fix.type		= FB_TYPE_PACKED_PIXELS;
 	info->fix.type_aux	= 0;
-- 
2.34.1



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

* [PATCH 05/35] fbdev: atafb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (3 preceding siblings ...)
  2026-04-25  6:58 ` [PATCH 04/35] fbdev: geode: " Ai Chao
@ 2026-04-25  6:58 ` Ai Chao
  2026-04-25  6:58 ` [PATCH 06/35] fbdev: tdfxfb: " Ai Chao
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/atafb.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/atafb.c b/drivers/video/fbdev/atafb.c
index b8ed1c537293..5f2d50919718 100644
--- a/drivers/video/fbdev/atafb.c
+++ b/drivers/video/fbdev/atafb.c
@@ -555,7 +555,7 @@ static int tt_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par)
 {
 	int mode;
 
-	strcpy(fix->id, "Atari Builtin");
+	strscpy(fix->id, "Atari Builtin");
 	fix->smem_start = phys_screen_base;
 	fix->smem_len = screen_len;
 	fix->type = FB_TYPE_INTERLEAVED_PLANES;
@@ -851,7 +851,7 @@ static inline int hxx_prescale(struct falcon_hw *hw)
 static int falcon_encode_fix(struct fb_fix_screeninfo *fix,
 			     struct atafb_par *par)
 {
-	strcpy(fix->id, "Atari Builtin");
+	strscpy(fix->id, "Atari Builtin");
 	fix->smem_start = phys_screen_base;
 	fix->smem_len = screen_len;
 	fix->type = FB_TYPE_INTERLEAVED_PLANES;
@@ -1770,7 +1770,7 @@ static int stste_encode_fix(struct fb_fix_screeninfo *fix,
 {
 	int mode;
 
-	strcpy(fix->id, "Atari Builtin");
+	strscpy(fix->id, "Atari Builtin");
 	fix->smem_start = phys_screen_base;
 	fix->smem_len = screen_len;
 	fix->type = FB_TYPE_INTERLEAVED_PLANES;
@@ -2069,7 +2069,7 @@ static void st_ovsc_switch(void)
 
 static int ext_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par)
 {
-	strcpy(fix->id, "Unknown Extern");
+	strscpy(fix->id, "Unknown Extern");
 	fix->smem_start = external_addr;
 	fix->smem_len = PAGE_ALIGN(external_len);
 	if (external_depth == 1) {
@@ -3100,7 +3100,7 @@ static int __init atafb_probe(struct platform_device *pdev)
 	}
 #endif /* ATAFB_EXT */
 
-//	strcpy(fb_info.mode->name, "Atari Builtin ");
+//	strscpy(fb_info.mode->name, "Atari Builtin ");
 	fb_info.fbops = &atafb_ops;
 	// try to set default (detected; requested) var
 	do_fb_set_var(&atafb_predefined[default_par - 1], 1);
-- 
2.34.1



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

* [PATCH 06/35] fbdev: tdfxfb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (4 preceding siblings ...)
  2026-04-25  6:58 ` [PATCH 05/35] fbdev: atafb: " Ai Chao
@ 2026-04-25  6:58 ` Ai Chao
  2026-04-25  6:58 ` [PATCH 07/35] fbdev: pm2fb: " Ai Chao
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/tdfxfb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/tdfxfb.c b/drivers/video/fbdev/tdfxfb.c
index 4c4e53aaea3a..b7cc2b1012eb 100644
--- a/drivers/video/fbdev/tdfxfb.c
+++ b/drivers/video/fbdev/tdfxfb.c
@@ -1401,15 +1401,15 @@ static int tdfxfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	/* Configure the default fb_fix_screeninfo first */
 	switch (pdev->device) {
 	case PCI_DEVICE_ID_3DFX_BANSHEE:
-		strcpy(info->fix.id, "3Dfx Banshee");
+		strscpy(info->fix.id, "3Dfx Banshee");
 		default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK;
 		break;
 	case PCI_DEVICE_ID_3DFX_VOODOO3:
-		strcpy(info->fix.id, "3Dfx Voodoo3");
+		strscpy(info->fix.id, "3Dfx Voodoo3");
 		default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK;
 		break;
 	case PCI_DEVICE_ID_3DFX_VOODOO5:
-		strcpy(info->fix.id, "3Dfx Voodoo5");
+		strscpy(info->fix.id, "3Dfx Voodoo5");
 		default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK;
 		break;
 	}
-- 
2.34.1



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

* [PATCH 07/35] fbdev: pm2fb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (5 preceding siblings ...)
  2026-04-25  6:58 ` [PATCH 06/35] fbdev: tdfxfb: " Ai Chao
@ 2026-04-25  6:58 ` Ai Chao
  2026-04-25  6:58 ` [PATCH 08/35] fbdev: xen-fbfront: " Ai Chao
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/pm2fb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/pm2fb.c b/drivers/video/fbdev/pm2fb.c
index f34429829b7d..ad1e4bc5fe6f 100644
--- a/drivers/video/fbdev/pm2fb.c
+++ b/drivers/video/fbdev/pm2fb.c
@@ -1543,15 +1543,15 @@ static int pm2fb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	switch (pdev->device) {
 	case  PCI_DEVICE_ID_TI_TVP4020:
-		strcpy(pm2fb_fix.id, "TVP4020");
+		strscpy(pm2fb_fix.id, "TVP4020");
 		default_par->type = PM2_TYPE_PERMEDIA2;
 		break;
 	case  PCI_DEVICE_ID_3DLABS_PERMEDIA2:
-		strcpy(pm2fb_fix.id, "Permedia2");
+		strscpy(pm2fb_fix.id, "Permedia2");
 		default_par->type = PM2_TYPE_PERMEDIA2;
 		break;
 	case  PCI_DEVICE_ID_3DLABS_PERMEDIA2V:
-		strcpy(pm2fb_fix.id, "Permedia2v");
+		strscpy(pm2fb_fix.id, "Permedia2v");
 		default_par->type = PM2_TYPE_PERMEDIA2V;
 		break;
 	}
-- 
2.34.1



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

* [PATCH 08/35] fbdev: xen-fbfront: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (6 preceding siblings ...)
  2026-04-25  6:58 ` [PATCH 07/35] fbdev: pm2fb: " Ai Chao
@ 2026-04-25  6:58 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 09/35] fbdev: controlfb: " Ai Chao
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:58 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/xen-fbfront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c
index 4385976277ac..1cc234751be5 100644
--- a/drivers/video/fbdev/xen-fbfront.c
+++ b/drivers/video/fbdev/xen-fbfront.c
@@ -429,7 +429,7 @@ static int xenfb_probe(struct xenbus_device *dev,
 	fb_info->fix.line_length = fb_info->var.xres * XENFB_DEPTH / 8;
 	fb_info->fix.smem_start = 0;
 	fb_info->fix.smem_len = fb_size;
-	strcpy(fb_info->fix.id, "xen");
+	strscpy(fb_info->fix.id, "xen");
 	fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
 	fb_info->fix.accel = FB_ACCEL_NONE;
 
-- 
2.34.1



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

* [PATCH 09/35] fbdev: controlfb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (7 preceding siblings ...)
  2026-04-25  6:58 ` [PATCH 08/35] fbdev: xen-fbfront: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 10/35] fbdev: stifb: " Ai Chao
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/controlfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c
index 4bb821d7f284..09cf6befd8d3 100644
--- a/drivers/video/fbdev/controlfb.c
+++ b/drivers/video/fbdev/controlfb.c
@@ -780,7 +780,7 @@ static void __init control_init_info(struct fb_info *info, struct fb_info_contro
 	fb_alloc_cmap(&info->cmap, 256, 0);
 
 	/* Fill fix common fields */
-	strcpy(info->fix.id, "control");
+	strscpy(info->fix.id, "control");
 	info->fix.mmio_start = p->control_regs_phys;
 	info->fix.mmio_len = sizeof(struct control_regs);
 	info->fix.type = FB_TYPE_PACKED_PIXELS;
-- 
2.34.1



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

* [PATCH 10/35] fbdev: stifb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (8 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 09/35] fbdev: controlfb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 11/35] fbdev: fm2fb: " Ai Chao
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/stifb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c
index 8e5bac27542d..578770bdee02 100644
--- a/drivers/video/fbdev/stifb.c
+++ b/drivers/video/fbdev/stifb.c
@@ -1357,7 +1357,7 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref)
 	var->yres = var->yres_virtual = yres;
 	var->bits_per_pixel = bpp;
 
-	strcpy(fix->id, "stifb");
+	strscpy(fix->id, "stifb");
 	info->fbops = &stifb_ops;
 	info->screen_base = ioremap(REGION_BASE(fb,1), fix->smem_len);
 	if (!info->screen_base) {
-- 
2.34.1



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

* [PATCH 11/35] fbdev: fm2fb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (9 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 10/35] fbdev: stifb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 12/35] fbdev: arkfb: " Ai Chao
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/fm2fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/fm2fb.c b/drivers/video/fbdev/fm2fb.c
index 25d2e716edf2..276e1dc1f57c 100644
--- a/drivers/video/fbdev/fm2fb.c
+++ b/drivers/video/fbdev/fm2fb.c
@@ -254,7 +254,7 @@ static int fm2fb_probe(struct zorro_dev *z, const struct zorro_device_id *id)
 	fb_fix.mmio_start = fb_fix.smem_start + FRAMEMASTER_REG;
 	fm2fb_reg  = (unsigned char *)(info->screen_base+FRAMEMASTER_REG);
 
-	strcpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II");
+	strscpy(fb_fix.id, is_fm ? "FrameMaster II" : "Rainbow II");
 
 	/* make EBU color bars on display */
 	ptr = (unsigned long *)fb_fix.smem_start;
-- 
2.34.1



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

* [PATCH 12/35] fbdev: arkfb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (10 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 11/35] fbdev: fm2fb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 13/35] fbdev: vt8500lcdfb: " Ai Chao
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/arkfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c
index 866c1165704e..a05900f0e691 100644
--- a/drivers/video/fbdev/arkfb.c
+++ b/drivers/video/fbdev/arkfb.c
@@ -1025,7 +1025,7 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	info->screen_size = (1 << (regval >> 6)) << 20;
 	info->fix.smem_len = info->screen_size;
 
-	strcpy(info->fix.id, "ARK 2000PV");
+	strscpy(info->fix.id, "ARK 2000PV");
 	info->fix.mmio_start = 0;
 	info->fix.mmio_len = 0;
 	info->fix.type = FB_TYPE_PACKED_PIXELS;
-- 
2.34.1



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

* [PATCH 13/35] fbdev: vt8500lcdfb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (11 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 12/35] fbdev: arkfb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 14/35] fbdev: vt8623fb: " Ai Chao
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/vt8500lcdfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c
index 85c7a99a7d64..d6e061628100 100644
--- a/drivers/video/fbdev/vt8500lcdfb.c
+++ b/drivers/video/fbdev/vt8500lcdfb.c
@@ -287,7 +287,7 @@ static int vt8500lcd_probe(struct platform_device *pdev)
 	if (!fbi)
 		return -ENOMEM;
 
-	strcpy(fbi->fb.fix.id, "VT8500 LCD");
+	strscpy(fbi->fb.fix.id, "VT8500 LCD");
 
 	fbi->fb.fix.type	= FB_TYPE_PACKED_PIXELS;
 	fbi->fb.fix.xpanstep	= 0;
-- 
2.34.1



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

* [PATCH 14/35] fbdev: vt8623fb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (12 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 13/35] fbdev: vt8500lcdfb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 15/35] fbdev: gbefb: " Ai Chao
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/vt8623fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
index df984f3a7ff6..521b60b8b3e4 100644
--- a/drivers/video/fbdev/vt8623fb.c
+++ b/drivers/video/fbdev/vt8623fb.c
@@ -752,7 +752,7 @@ static int vt8623_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	}
 
 	info->fix.smem_len = info->screen_size;
-	strcpy(info->fix.id, "VIA VT8623");
+	strscpy(info->fix.id, "VIA VT8623");
 	info->fix.type = FB_TYPE_PACKED_PIXELS;
 	info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
 	info->fix.ypanstep = 0;
-- 
2.34.1



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

* [PATCH 15/35] fbdev: gbefb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (13 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 14/35] fbdev: vt8623fb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 16/35] fbdev: wm8505fb: " Ai Chao
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/gbefb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c
index cb6ff15a21db..34da219b6e76 100644
--- a/drivers/video/fbdev/gbefb.c
+++ b/drivers/video/fbdev/gbefb.c
@@ -818,7 +818,7 @@ static void gbefb_encode_fix(struct fb_fix_screeninfo *fix,
 			     struct fb_var_screeninfo *var)
 {
 	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
-	strcpy(fix->id, "SGI GBE");
+	strscpy(fix->id, "SGI GBE");
 	fix->smem_start = (unsigned long) gbe_mem;
 	fix->smem_len = gbe_mem_size;
 	fix->type = FB_TYPE_PACKED_PIXELS;
-- 
2.34.1



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

* [PATCH 16/35] fbdev: wm8505fb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (14 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 15/35] fbdev: gbefb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 17/35] fbdev: rivafb: " Ai Chao
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/wm8505fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c
index 5caf74ca92fb..8d6b530e5ad3 100644
--- a/drivers/video/fbdev/wm8505fb.c
+++ b/drivers/video/fbdev/wm8505fb.c
@@ -278,7 +278,7 @@ static int wm8505fb_probe(struct platform_device *pdev)
 	if (!fbi)
 		return -ENOMEM;
 
-	strcpy(fbi->fb.fix.id, DRIVER_NAME);
+	strscpy(fbi->fb.fix.id, DRIVER_NAME);
 
 	fbi->fb.fix.type	= FB_TYPE_PACKED_PIXELS;
 	fbi->fb.fix.xpanstep	= 1;
-- 
2.34.1



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

* [PATCH 17/35] fbdev: rivafb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (15 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 16/35] fbdev: wm8505fb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 18/35] fbdev: sh7760fb: " Ai Chao
  2026-04-25  6:59 ` [PATCH 19/35] fbdev: savage: " Ai Chao
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/riva/rivafb-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/riva/rivafb-i2c.c b/drivers/video/fbdev/riva/rivafb-i2c.c
index 6a183375ced1..5ee59be01850 100644
--- a/drivers/video/fbdev/riva/rivafb-i2c.c
+++ b/drivers/video/fbdev/riva/rivafb-i2c.c
@@ -91,7 +91,7 @@ static int riva_setup_i2c_bus(struct riva_i2c_chan *chan, const char *name,
 {
 	int rc;
 
-	strcpy(chan->adapter.name, name);
+	strscpy(chan->adapter.name, name);
 	chan->adapter.owner		= THIS_MODULE;
 	chan->adapter.class		= i2c_class;
 	chan->adapter.algo_data		= &chan->algo;
-- 
2.34.1



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

* [PATCH 18/35] fbdev: sh7760fb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (16 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 17/35] fbdev: rivafb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  2026-04-25  6:59 ` [PATCH 19/35] fbdev: savage: " Ai Chao
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/sh7760fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c
index 130adef2e468..acd70dff3a65 100644
--- a/drivers/video/fbdev/sh7760fb.c
+++ b/drivers/video/fbdev/sh7760fb.c
@@ -508,7 +508,7 @@ static int sh7760fb_probe(struct platform_device *pdev)
 	info->var.transp.length = 0;
 	info->var.transp.msb_right = 0;
 
-	strcpy(info->fix.id, "sh7760-lcdc");
+	strscpy(info->fix.id, "sh7760-lcdc");
 
 	/* set the DON2 bit now, before cmap allocation, as it will randomize
 	 * palette memory.
-- 
2.34.1



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

* [PATCH 19/35] fbdev: savage: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
                   ` (17 preceding siblings ...)
  2026-04-25  6:59 ` [PATCH 18/35] fbdev: sh7760fb: " Ai Chao
@ 2026-04-25  6:59 ` Ai Chao
  18 siblings, 0 replies; 22+ messages in thread
From: Ai Chao @ 2026-04-25  6:59 UTC (permalink / raw)
  To: deller, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc, Ai Chao

Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
 drivers/video/fbdev/savage/savagefb-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/savage/savagefb-i2c.c b/drivers/video/fbdev/savage/savagefb-i2c.c
index 80fa87e2ae2f..820d1f83669d 100644
--- a/drivers/video/fbdev/savage/savagefb-i2c.c
+++ b/drivers/video/fbdev/savage/savagefb-i2c.c
@@ -136,7 +136,7 @@ static int savage_setup_i2c_bus(struct savagefb_i2c_chan *chan,
 	int rc = 0;
 
 	if (chan->par) {
-		strcpy(chan->adapter.name, name);
+		strscpy(chan->adapter.name, name);
 		chan->adapter.owner		= THIS_MODULE;
 		chan->adapter.algo_data		= &chan->algo;
 		chan->adapter.dev.parent	= &chan->par->pcidev->dev;
-- 
2.34.1



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

* Re: [PATCH 03/35] fbdev: sisfb: Use safer strscpy() instead of strcpy()
  2026-04-25  6:58 ` [PATCH 03/35] fbdev: sisfb: " Ai Chao
@ 2026-04-25  8:08   ` Helge Deller
  2026-04-25 11:02     ` David Laight
  0 siblings, 1 reply; 22+ messages in thread
From: Helge Deller @ 2026-04-25  8:08 UTC (permalink / raw)
  To: Ai Chao, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas
  Cc: linux-fbdev, dri-devel, linux-kernel, linux-arm-kernel,
	linux-geode, linux-parisc

Hello Ai,

Thanks that you want to contribute!

But your series isn't beneficial in most areas.
Some examples:

On 4/25/26 08:58, Ai Chao wrote:
> Use a safer function strscpy() instead of strcpy() for copying to arrays.
> 
> Only idiomatic code replacement, and no functional changes.
> 
> Signed-off-by: Ai Chao <aichao@kylinos.cn>
> ---
>   drivers/video/fbdev/sis/sis_main.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
> index 84567d67f71d..e87fa261f76c 100644
> --- a/drivers/video/fbdev/sis/sis_main.c
> +++ b/drivers/video/fbdev/sis/sis_main.c
> @@ -205,7 +205,7 @@ static void sisfb_search_mode(char *name, bool quiet)
>   	}
>   
>   	if(strlen(name) <= 19) {
> -		strcpy(strbuf1, name);
> +		strscpy(strbuf1, name);

We have strbuf1[20] above, and the length is checked.
There is no benefit of using strscpy() here.
(The code could be cleaned up in other ways though).

>   		for(i = 0; i < strlen(strbuf1); i++) {
>   			if(strbuf1[i] < '0' || strbuf1[i] > '9') strbuf1[i] = ' ';
>   		}
> @@ -5947,33 +5947,33 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>   #ifdef CONFIG_FB_SIS_300
>   		case PCI_DEVICE_ID_SI_730:
>   			ivideo->chip = SIS_730;
> -			strcpy(ivideo->myid, "SiS 730");
> +			strscpy(ivideo->myid, "SiS 730");

The compiler knows at build time the length of myid, and the "SIS 730" string.
Using strscpy() has no benefit here either. Contrary, the code generated
because of using strscpy() is probably even larger.
Don't replace such code with strscpy().


--- a/drivers/video/fbdev/i810/i810-i2c.c
+++ b/drivers/video/fbdev/i810/i810-i2c.c
@@ -91,7 +91,7 @@ static int i810_setup_i2c_bus(struct i810fb_i2c_chan *chan, const char *name)
  {
          int rc;
  
-        strcpy(chan->adapter.name, name);
+	strscpy(chan->adapter.name, name);

Here it might make sense to use strscpy(), but it should be checked manually
and not using scripts to simply replace code.

That said: Thanks for your patches, but as-is I won't take them.

Helge


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

* Re: [PATCH 03/35] fbdev: sisfb: Use safer strscpy() instead of strcpy()
  2026-04-25  8:08   ` Helge Deller
@ 2026-04-25 11:02     ` David Laight
  0 siblings, 0 replies; 22+ messages in thread
From: David Laight @ 2026-04-25 11:02 UTC (permalink / raw)
  To: Helge Deller
  Cc: Ai Chao, nicolas.ferre, alexandre.belloni, claudiu.beznea, linux,
	dilinger, adaplas, James.Bottomley, FlorianSchandinat, alchark,
	krzk, kees, rene, tzimmermann, rongqianfeng, thorsten.blum,
	chelsyratnawat2001, soci, gregkh, daniel, linmq006,
	fourier.thomas, linux-fbdev, dri-devel, linux-kernel,
	linux-arm-kernel, linux-geode, linux-parisc

On Sat, 25 Apr 2026 10:08:08 +0200
Helge Deller <deller@gmx.de> wrote:

> Hello Ai,
...
> > -			strcpy(ivideo->myid, "SiS 730");
> > +			strscpy(ivideo->myid, "SiS 730");  
> 
> The compiler knows at build time the length of myid, and the "SIS 730" string.
> Using strscpy() has no benefit here either. Contrary, the code generated
> because of using strscpy() is probably even larger.
> Don't replace such code with strscpy().

Both should get converted to a memcpy().

If you increase the literal to be too long I'm pretty sure you'll
get a compiler warning/error from strcpy().
OTOH strscpy() is more likely to truncate the string (I'd need to
check).

So leaving it as strcpy() is fine - and possibly even better.
The header files might get changed to error strcpy() unless the compiler
knows the source string has a constant length and the destination is
big enough - but that hasn't been done yet.

	David
 



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

end of thread, other threads:[~2026-04-25 11:02 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25  6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
2026-04-25  6:58 ` [PATCH 01/35] fbdev: matroxfb: " Ai Chao
2026-04-25  6:58 ` [PATCH 02/35] fbdev: i810: " Ai Chao
2026-04-25  6:58 ` [PATCH 03/35] fbdev: sisfb: " Ai Chao
2026-04-25  8:08   ` Helge Deller
2026-04-25 11:02     ` David Laight
2026-04-25  6:58 ` [PATCH 04/35] fbdev: geode: " Ai Chao
2026-04-25  6:58 ` [PATCH 05/35] fbdev: atafb: " Ai Chao
2026-04-25  6:58 ` [PATCH 06/35] fbdev: tdfxfb: " Ai Chao
2026-04-25  6:58 ` [PATCH 07/35] fbdev: pm2fb: " Ai Chao
2026-04-25  6:58 ` [PATCH 08/35] fbdev: xen-fbfront: " Ai Chao
2026-04-25  6:59 ` [PATCH 09/35] fbdev: controlfb: " Ai Chao
2026-04-25  6:59 ` [PATCH 10/35] fbdev: stifb: " Ai Chao
2026-04-25  6:59 ` [PATCH 11/35] fbdev: fm2fb: " Ai Chao
2026-04-25  6:59 ` [PATCH 12/35] fbdev: arkfb: " Ai Chao
2026-04-25  6:59 ` [PATCH 13/35] fbdev: vt8500lcdfb: " Ai Chao
2026-04-25  6:59 ` [PATCH 14/35] fbdev: vt8623fb: " Ai Chao
2026-04-25  6:59 ` [PATCH 15/35] fbdev: gbefb: " Ai Chao
2026-04-25  6:59 ` [PATCH 16/35] fbdev: wm8505fb: " Ai Chao
2026-04-25  6:59 ` [PATCH 17/35] fbdev: rivafb: " Ai Chao
2026-04-25  6:59 ` [PATCH 18/35] fbdev: sh7760fb: " Ai Chao
2026-04-25  6:59 ` [PATCH 19/35] fbdev: savage: " Ai Chao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox