[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250816152820.427784-2-thorsten.blum@linux.dev>
Date: Sat, 16 Aug 2025 17:28:18 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Brian Gerst <brgerst@...il.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Brendan Jackman <jackmanb@...gle.com>,
"Xin Li (Intel)" <xin@...or.com>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
"Ahmed S. Darwish" <darwi@...utronix.de>
Cc: Thorsten Blum <thorsten.blum@...ux.dev>,
Ingo Molnar <mingo@...nel.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH] x86/common: Replace deprecated strcpy() with strscpy()
strcpy() is deprecated; use strscpy() instead.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
---
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/common.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 34a054181c4d..8aa170762cc7 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -184,9 +184,9 @@ static void default_init(struct cpuinfo_x86 *c)
if (c->cpuid_level == -1) {
/* No cpuid. It must be an ancient CPU */
if (c->x86 == 4)
- strcpy(c->x86_model_id, "486");
+ strscpy(c->x86_model_id, "486");
else if (c->x86 == 3)
- strcpy(c->x86_model_id, "386");
+ strscpy(c->x86_model_id, "386");
}
#endif
}
@@ -2013,7 +2013,7 @@ static void identify_cpu(struct cpuinfo_x86 *c)
const char *p;
p = table_lookup_model(c);
if (p)
- strcpy(c->x86_model_id, p);
+ strscpy(c->x86_model_id, p);
else
/* Last resort... */
sprintf(c->x86_model_id, "%02x/%02x",
--
2.50.1
Powered by blists - more mailing lists