From: Hrushiraj Gandhi <hrushirajg23@gmail.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Hrushiraj Gandhi <hrushirajg23@gmail.com>
Subject: [PATCH] drm/fb-helper: use strscpy() instead of strcpy()
Date: Mon, 31 Aug 2026 20:14:05 +0530 [thread overview]
Message-ID: <20260831144405.320914-1-hrushirajg23@gmail.com> (raw)
strcpy() has no notion of the destination buffer's size, so it will
write past the end of fb_helper->fb->comm if the source string is
ever longer than expected. It isn't here today ("[fbcon]" always
fits), but strscpy() is the bounded, always-NUL-terminating
replacement recommended for all new and existing strcpy() users, so
convert this one too. fb->comm is a fixed-size array, so the
destination size can be derived automatically.
No functional change.
Signed-off-by: Hrushiraj Gandhi <hrushirajg23@gmail.com>
---
drivers/gpu/drm/drm_fb_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 80ca785bdb26..175311fac2e4 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1545,7 +1545,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
if (ret < 0)
return ret;
- strcpy(fb_helper->fb->comm, "[fbcon]");
+ strscpy(fb_helper->fb->comm, "[fbcon]");
return 0;
}
reply other threads:[~2026-08-31 14:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260831144405.320914-1-hrushirajg23@gmail.com \
--to=hrushirajg23@gmail.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®