From: sashiko-bot@kernel.org
To: "Ajith P V" <ajithpv.linux@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] video: fbdev: via: refactor strcpy and viafb_name
Date: Fri, 14 Aug 2026 07:01:16 +0000 [thread overview]
Message-ID: <20260814070116.A23B31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260814065433.269375-1-ajithpv.linux@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] Changing the driver identification string exposed in the fb_fix_screeninfo structure from "Via" to "viafb" breaks userspace ABI backward compatibility.
--
--- Patch [1]: [PATCH v2] video: fbdev: via: refactor strcpy and viafb_name ---
commit 31193988a75e693bb97d9723171d248ff11a2f17
Author: Ajith P V <ajithpv.linux@gmail.com>
video: fbdev: via: refactor strcpy and viafb_name
This commit replaces unbounded strcpy() calls with strscpy() to harden the
framebuffer screen info initialization. It also converts the viafb_name
pointer into a static const char array and changes its string value.
Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
Link: https://github.com/KSPP/linux/issues/88 [2]
> diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c
> index 80f95dac32c8c..b3a2e07b61a7c 100644
> --- a/drivers/video/fbdev/via/viafbdev.c
> +++ b/drivers/video/fbdev/via/viafbdev.c
> @@ -16,7 +16,7 @@
> #define _MASTER_FILE
> #include "global.h"
>
> -static char *viafb_name = "Via";
> +static const char viafb_name[] = "viafb";
[Severity: Critical]
Does changing this string from "Via" to "viafb" cause a userspace ABI
regression?
Userspace tools and display servers, such as Xorg's via driver, often
rely on the exact identification string returned in the id field of
fb_fix_screeninfo by the framebuffer ioctl to detect hardware and apply
specific quirks.
Could the compile-time bounds checking and optimization benefits still be
achieved without modifying the exposed string value, perhaps by defining
it as 'static const char viafb_name[] = "Via";' instead?
> static u32 pseudo_pal[17];
>
> /* video mode */
[ ... ]
> @@ -144,7 +144,7 @@ static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix,
> struct viafb_par *viaparinfo)
> {
> memset(fix, 0, sizeof(struct fb_fix_screeninfo));
> - strcpy(fix->id, viafb_name);
> + strscpy(fix->id, viafb_name, sizeof(fix->id));
>
> fix->smem_start = viaparinfo->fbmem;
> fix->smem_len = viaparinfo->fbmem_free;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260814065433.269375-1-ajithpv.linux@gmail.com?part=1
prev parent reply other threads:[~2026-08-14 7:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 6:54 [PATCH v2] video: fbdev: via: refactor strcpy and viafb_name Ajith P V
2026-08-14 7:01 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260814070116.A23B31F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ajithpv.linux@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.