From nobody Tue Aug 25 14:31:37 2026 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A05A40DB5B for ; Fri, 14 Aug 2026 07:44:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786693498; cv=none; b=UHrz/QLUaVtoq6vwRqG7XZCUnXfr4whTq+slqTIppy9lSq1wJrczzHMDRoQm+Bk3qyOxOQmea9L0iFzRWPzl/V7qrMMnIom5ciRmasGuT8zW8nWg5HbbRB3a+k9UAspuhGbnTZ5E9k668+Hrr6xAxZishW+gxpscJGGlbh3ZxzU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786693498; c=relaxed/simple; bh=JgaZlVMkDe6qDCqmgpIIx3QmwudO6Mvh8tOMiOQ11bU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XcnqVKfz1h3HD3V7233cIFj/VODqt784vy5AJNZiZYFos/41hjWd17TsWMbOy6vDtg1gPXTOqHd17aKW7CKZseK9wGpg46GRUfu9jO4sgim7CJASfGf/aq7dU2WYRUbxzve04g0tN7lPolxjagb9TNIG93AbmNHZe9HF3T860S0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WuQZQOUg; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WuQZQOUg" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-383b4a3755fso755844a91.3 for ; Fri, 14 Aug 2026 00:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786693484; x=1787298284; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=cwYk4ejoNMOniCBgkjcxx38Ml00PjaYwyPcbfZWz9ws=; b=WuQZQOUgwfu5zQxjbX5x1vuUUv9Enuispsa3bTGii2PdLecScU/nr1vnXb3PSYxtPD QNx901YmAeDeREmuB/IyyoFzdJxX2iTRxuZWaWXzLm6wdZ8I8lp+AVM/jMNSXcLXBt5k BJRsn95bIDYQdVlFSJ5sa29hTxi9yWJnSYyY/d38Iw3lUzWsYB5hGxIwPQPojneeEZWy CGnTjahbOKbHI0fH2kmMAqKxADK4ZfoQtT4YgIeI9i0ky9R+FljGmEOfMmpAjegODhO3 fc8OEdZBC+uIDd75ZJoB64typ81TWbPZg+MPXzoFzdciocNGEA0biolONXgqaPWx5OzQ BqRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786693484; x=1787298284; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cwYk4ejoNMOniCBgkjcxx38Ml00PjaYwyPcbfZWz9ws=; b=Zh4a8YSWOgGp0nVCcoUNP/euxqGQZ71CtH3OPUJU48q+qip6LvjzGZE/yUMfhKEMyL St3Dsmtse9Z/5o25AqqwfE520/3IXvRo/oTgliqVhSwiDJvcHZDObrsfxnacIBW0+gOk BnQPVeKZGNSaoevrig8gF+GFaHwtyNR4fwNTC++5ovCcirCpbNqWww/w0Ce7C/TRXT4V SpM8r2cwAZrzHbFz8lIe1JPu9pHg1/i0Nzmo59HXf/eWOa6ufmwuYTSk1Mtkc1CIp0R+ EJw3B2MEkWQc0sPvAXe/PQZmC2l2L74xBt98FLhjgi0qIRCh9SuUzUsvZM08ZP9hwBon m+oQ== X-Forwarded-Encrypted: i=1; AHgh+Ro9xg14faJmLC+9XN/R1PuYgT3qHww1MTQIxdlj5gO329FIgWlGjk5I66kPBTlO7U3qdIwXp+F8iZxZNJI=@vger.kernel.org X-Gm-Message-State: AOJu0YzZN+V+OFMx5bItHDpcDpL19bmY2sN4kwfIpRz46nFQigtp32Nz OtgMRTKLVEjxfEBnDPj+uHiWgOyAZevqf+GIyyipx+aSjOjhSl3+ldMP X-Gm-Gg: AR+sD11RqN7uITbQGkSgBxSspV6dr/XAMFC4IkkHRNM2KTzp4yC3eb/zL7lem7IvCKp YttstADzI1o9/IrSE5q9t/qNp0fyhicJ6kURsR2tQnFAlwuPzQYQBq2WEi7B/2xL8X6f1WMyGhG z+/1rgwC9J1vfsilftNJohyksrsoObNpFHDuSx8MxbnnLEzyVU5yK7Cuka4JkJJ/A/WKxjRJXhm Jfxh4wDWwoMEmu7OlcFVgwLkdoWe5YkyJXvDlwdCQAi6TaD54/Y+ouuoqptdc3qN2f73PugQ9Oj AkCBdZMo7wTItv55hOtOAfWB7ABvWDsdbuybmzDqTlz5SZQ0YuGyg5B9DsTiV+FNUsegGTwBJEH td273mP7woyzCya32y++/Qolqgg+B1619w0A5NeCEDqZselAU5vt3vi0DAk2e7OtdE5EbI0bw1S +6CSUkFc3tD1yu+pydSlgJ9Vbu7d1v1yKd9Ms3aO6UiCfs4c47Haoav4CQhRhSki/phMm1GjEQL 9g= X-Received: by 2002:a17:90a:ec83:b0:381:e74f:8a6a with SMTP id 98e67ed59e1d1-3933b8c1041mr4446396a91.16.1786693483969; Fri, 14 Aug 2026 00:44:43 -0700 (PDT) Received: from ubuntu.. ([49.205.39.116]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-394ebbcc34csm1462260a91.15.2026.08.14.00.44.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 00:44:43 -0700 (PDT) From: Ajith P V To: FlorianSchandinat@gmx.de, deller@gmx.de Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ajith P V Subject: [PATCH v3] video: fbdev: via: refactor strcpy and viafb_name Date: Fri, 14 Aug 2026 07:44:35 +0000 Message-ID: <20260814074435.277441-1-ajithpv.linux@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace the deprecated and unbounded strcpy() function with the safer strscpy() alternative when setting up the framebuffer fixed screen information [1][2]. It aligns this driver with the ongoing kernel-wide security initiative to eliminate unbounded string copies, hardening the code against future modifications. Additionally, convert the file-scope `viafb_name` pointer into a `static const char[]` array while preserving its original value "Via". This allows the compiler to execute compile-time bounds checking and optimize the string copy operation without breaking userspace ABI backward compatibility. This is a proactive API cleanup and there is no functional performance or truncation risk. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy= [1] Link: https://github.com/KSPP/linux/issues/88 [2] Signed-off-by: Ajith P V --- v3: - Restore the original "Via" string value to prevent userspace ABI=20 regressions, while keeping the 'static const char[]' optimization as suggested by Sashiko AI. v2: - Keep variable static but change it to a const array 'static const char viafb_name[] =3D "viafb"' as suggested by Helge Dell= er to let the compiler leverage compile-time checks. drivers/video/fbdev/via/viafbdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/v= iafbdev.c index 80f95dac32c8..f6823beb4d7e 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" =20 -static char *viafb_name =3D "Via"; +static const char viafb_name[] =3D "Via"; static u32 pseudo_pal[17]; =20 /* video mode */ @@ -144,7 +144,7 @@ static void viafb_setup_fixinfo(struct fb_fix_screeninf= o *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)); =20 fix->smem_start =3D viaparinfo->fbmem; fix->smem_len =3D viaparinfo->fbmem_free; --=20 2.43.0