From nobody Sat Oct 4 11:10:13 2025 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 880E11ADFE4 for ; Sun, 17 Aug 2025 23:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755472690; cv=none; b=bOPzIdpkjsTMopOVfX4m0TkYuOHCQR6H0bzrl7fXGgIbjXgdfZZKb8zuVv9y4iZNAUajjoyoDjkxIu5MY4GLOEj200pttEMEnw8T9eqI+cw+ak0cqmb8sfbaaqQ8dPDEQMMbPQu1T09hxfybcaRLq249p+xMRLIcCCaB7rJBaz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755472690; c=relaxed/simple; bh=/GxEl0QPjOg6ALkrg7qmzgWQ1rEayIF61MPgBUBRnkw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bz4I9R5YiQ9yyfqi7WJtrw3xQW0s+Ki1KlHAiernCdJi6zqUR2ZZ5tFeoOquVQ4jUnfreHO3qkbT+y9mlG8QVQqxO5ugFFvQviDCvjBj7zg6mXOPQDF+35MJGQtBAvVsNhqvajOUhF+LktcTtx8V85ogwz2oX7/J6kRq4ubdV+s= 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=MZMAzonE; arc=none smtp.client-ip=95.215.58.171 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="MZMAzonE" 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=1755472683; 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=APR/43NyS5T31TxBUdjop0LMI0MLna0XIyK/upjGzA0=; b=MZMAzonEWu7ErZsR8ivDZPZ1AdJYzj75AS2OkwuuZZHPhS13yIFXAyAea7L9zspIYYuV93 dfMI1XVpc4pKLSF4ZWFX8tZWh+pg7d7R6uqq5WE368Z6N0sdAbACEPRo7cOl9GXWqhspwb gfTETKj0caEG0lyFHs5/xg9jHlhDcFs= 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: Mon, 18 Aug 2025 01:17:50 +0200 Message-ID: <20250817231753.633899-1-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.50.1