From nobody Sat Oct 4 12:41:18 2025 Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AADA58462 for ; Sat, 16 Aug 2025 15:30:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755358202; cv=none; b=GrQuIGX2Shy4G/mOpSOKbA+OKMFya1YW6y9otSv6N4InaeSUdHdoi8Mme4xo8ghsMrh81UASGMbLuz/sQ32wkXQrqvXHEXFw1sxXLYhb7wcgTlsGYduvJ05qg9mELWQCasGg3/F1mu+01pws/BC9TQJ2SLMKZKLRzNpmI27yYSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755358202; c=relaxed/simple; bh=+Spv1PsNit21/PUVejo5UL7D6iAmgNLhXurHkYoE/e8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mIoNqbTvX3sNdAbGnEYkVNDtsInWrdpC5zS2hvkaOOPcbPkp5dUv4cW6DkNn2Lkm2KWuYOP3Fgs0z+K3PKVQSKydfdh2sMZ+Miwoowq9e7oHx+JqD0kKNnEnae6UUJ3Zf1ZZAqwg/F9hUnUJoDe8tCkIHGS5hj4/dL9WdUn/zaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=PYbwC6m9; arc=none smtp.client-ip=91.218.175.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PYbwC6m9" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1755358198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=VO9LFrcZyjmUCjNxK9HB911t9pQCKhf3yh5jBn/3GgQ=; b=PYbwC6m9zDUptb5cBKZz1HsIx28Ara6mWX5/xGGImnr9PWMBt/f1mZwJFAjkoGyPIb417f zZoLm135hcsXefHkgkI8TzhWD/HkUcyDOJWrQPhx7EYzX292YNxfB7fxMwR45SZhwOgdAA ZPM16G2LRFXg3k8mDa+1VD3lAi1bnBA= From: Thorsten Blum To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Russell Senior Cc: Thorsten Blum , Ingo Molnar , linux-kernel@vger.kernel.org Subject: [PATCH] x86/cyrix: Replace deprecated strcpy() with strscpy() Date: Sat, 16 Aug 2025 17:29:15 +0200 Message-ID: <20250816152916.427883-2-thorsten.blum@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" strcpy() is deprecated; use strscpy() instead. Remove the local variable 'char *buf' and call strscpy() directly with 'c->x86_model_id', allowing the compiler to infer the fixed size of the destination buffer using sizeof(). Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum --- Note: I already submitted this in April as part of another patch [1] which doesn't apply anymore. Submitting this again as a separate patch. [1]: https://lore.kernel.org/lkml/20250425074917.1531-3-thorsten.blum@linux= .dev/ --- arch/x86/kernel/cpu/cyrix.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index dfec2c61e354..07521e3f94d8 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c @@ -192,7 +192,6 @@ static void early_init_cyrix(struct cpuinfo_x86 *c) static void init_cyrix(struct cpuinfo_x86 *c) { unsigned char dir0, dir0_msn, dir0_lsn, dir1 =3D 0; - char *buf =3D c->x86_model_id; const char *p =3D NULL; =20 /* @@ -352,9 +351,9 @@ static void init_cyrix(struct cpuinfo_x86 *c) dir0_msn =3D 7; break; } - strcpy(buf, Cx86_model[dir0_msn & 7]); + strscpy(c->x86_model_id, Cx86_model[dir0_msn & 7]); if (p) - strcat(buf, p); + strcat(c->x86_model_id, p); return; } =20 @@ -416,7 +415,7 @@ static void cyrix_identify(struct cpuinfo_x86 *c) if (c->x86 =3D=3D 4 && test_cyrix_52div()) { unsigned char dir0, dir1; =20 - strcpy(c->x86_vendor_id, "CyrixInstead"); + strscpy(c->x86_vendor_id, "CyrixInstead"); c->x86_vendor =3D X86_VENDOR_CYRIX; =20 /* Actually enable cpuid on the older cyrix */ --=20 2.50.1