From nobody Sun Dec 14 19:21:32 2025 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 847471F92E for ; Wed, 21 May 2025 12:21:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747830062; cv=none; b=Zwg5ETsjNIvyb0+xTDMbJbCEaZNJdFcjKsUXEPqkQqQ0E1KgYS508765mWb7n9OYnfnbUuo5xy7MgvzN8x/6OYHvkmFR76tDiNGrbIyAfMbYnByRxNMBAjGHpphBTWv4OUNcTEaPp6seHyKDbr7tMvFruhRynR1q+dEzO1BRTzc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747830062; c=relaxed/simple; bh=GbdOj3vJ/q4X+/2t6OHFHhPM4HGzw4Vsiy/W4r3FnA0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=geblx+LTKGqf0zTI6rmad7Z1PP5Hx5aeju+pnjYtypztucsl4P3w6P5o9R3GE8eNdr8o3/bDYa+qw4Xozz8tmfK6sjktqemAjBVI/6JDE3bl3d0l3chHv182C43DEdW1FmYiMcGXlSo9el6mdQKxGT62QWrGRJhIozN3uqPdkMY= 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=GfjDWImK; arc=none smtp.client-ip=95.215.58.177 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="GfjDWImK" 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=1747830048; 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=Q9TvMyMwPK6rkSNheoWI19m/ZeeUWO8Bp2DZADsG/EE=; b=GfjDWImK+YPwdTT3RQre0t6LulVAB1uMQBuCwkjb3p6+j4IOv34/Y/fQi8EGEH8AdmLymZ YWVVBfGn3EFJyXKoJlhb1iRwdVv/lPrB5KE9ohM4CpaRuPWcDs88Zv7cuyGbVrYv5ZZkVk cPpPJQ/+1S8H+96rQAn2kU2DC+UtT14= From: Thorsten Blum To: Richard Henderson , Matt Turner Cc: linux-hardening@vger.kernel.org, Thorsten Blum , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] alpha: Replace strcpy() with strscpy() in setup_arch() Date: Wed, 21 May 2025 14:20:15 +0200 Message-ID: <20250521122016.5891-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. Since the destination buffer 'command_line' has a fixed length, strscpy() automatically determines its size using sizeof() when the size argument is omitted. This makes the explicit size argument for the existing strscpy() call unnecessary - remove it. No functional changes intended. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum --- arch/alpha/kernel/setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index bebdffafaee8..8b51e6ca83d6 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -468,8 +468,8 @@ setup_arch(char **cmdline_p) /*=20 * Locate the command line. */ - strscpy(command_line, COMMAND_LINE, sizeof(command_line)); - strcpy(boot_command_line, command_line); + strscpy(command_line, COMMAND_LINE); + strscpy(boot_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p =3D command_line; =20 /*=20 @@ -511,7 +511,7 @@ setup_arch(char **cmdline_p) } =20 /* Replace the command line, now that we've killed it with strsep. */ - strcpy(command_line, boot_command_line); + strscpy(command_line, boot_command_line); =20 /* If we want SRM console printk echoing early, do it now. */ if (alpha_using_srm && srmcons_output) { --=20 2.49.0