Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 755021DED56 for ; Mon, 21 Apr 2025 12:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745237853; cv=none; b=EpY4uIHXYgfv+M1vzdO4lRSl+MSvJRUCQeqLiwNA+3u5V76FNlstQUU6w4DBIX7bI3ZNchyAa+AyKIowrOl/ry+rRdjmHPrDg2u2P5fFTLtnAt/p7+3kT8eZIQujhWzgTseYlWELIFHUiZHQROo+nSnLg21htpZ7S4fdw9H3++A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745237853; c=relaxed/simple; bh=8NP9WnnAZwCWX5tKw+ExLTEaZQ3Kg5gbZX0q9rYXmxQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BzvehFc9z2tWtN4bpV3E3FTFPRbQ9o6gBV1X1l0QHhyDYy3TucIJdKrreYawynP7oQuGhI4iQEtWB8ijnC6QqngfdaK4+h13LkrB462a6KoAioxGEL/PttquVgqxGiZhUlLFpHIJ0nK+ePS/UfGvyX5S2hLkmKrmIXd5mw4jgh8= 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=XSuErmA3; arc=none smtp.client-ip=95.215.58.174 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="XSuErmA3" 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=1745237848; 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=nwUktnr64z5zMlLNBQ2cFN7az3BChCdsSCKSVZjBexg=; b=XSuErmA33/xKzulCpVZO7KHGtMhbNIyNGOCP/UMSjhOdwpaiXLDGgW6mbFZRmM9Db8CeKZ z8r2iqUiDO2lfjJpHiPqz0TW1Xq84gkkscOWZBRdqU1IrMvJ+9LbshLTa5mQrKoLed1Ney qOab8wBpY7sz2tY3Xf3J1/4B78bA5yo= From: Thorsten Blum To: "David S. Miller" , Andreas Larsson Cc: Thorsten Blum , linux-hardening@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] sparc: PCI: Replace deprecated strcpy() with strscpy() Date: Mon, 21 Apr 2025 14:16:23 +0200 Message-ID: <20250421121624.363034-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-hardening@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT strcpy() is deprecated; use strscpy() instead. No functional changes intended. Link: https://github.com/KSPP/linux/issues/88 Cc: linux-hardening@vger.kernel.org Signed-off-by: Thorsten Blum --- arch/sparc/kernel/pcic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 25fe0a061732..f894ae79e78a 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include /* for cache flushing. */ @@ -352,7 +353,7 @@ int __init pcic_probe(void) pbm = &pcic->pbm; pbm->prom_node = node; prom_getstring(node, "name", namebuf, 63); namebuf[63] = 0; - strcpy(pbm->prom_name, namebuf); + strscpy(pbm->prom_name, namebuf); { extern int pcic_nmi_trap_patch[4]; @@ -477,7 +478,7 @@ static void pcic_map_pci_device(struct linux_pcic *pcic, int j; if (node == 0 || node == -1) { - strcpy(namebuf, "???"); + strscpy(namebuf, "???"); } else { prom_getstring(node, "name", namebuf, 63); namebuf[63] = 0; } @@ -536,7 +537,7 @@ pcic_fill_irq(struct linux_pcic *pcic, struct pci_dev *dev, int node) char namebuf[64]; if (node == 0 || node == -1) { - strcpy(namebuf, "???"); + strscpy(namebuf, "???"); } else { prom_getstring(node, "name", namebuf, sizeof(namebuf)); } -- 2.49.0