From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 4F7641F92E for ; Wed, 21 May 2025 12:20:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747830052; cv=none; b=gyquAGizqwRxnASXo4YhnBPhJNlrQ6Utu8oep9D9ZF1MMCa+PQ50u8yFDP6BtGkkDyrm46WhNhPlLuFIWCT9a0JwMzhf+KomcpCwCSsI00JGUhW9XNWjOrODdyF75aU6WAEktgD9IdHBfXUQWIIpbLQ9jyJbBJASHiSCZwMps40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747830052; c=relaxed/simple; bh=GbdOj3vJ/q4X+/2t6OHFHhPM4HGzw4Vsiy/W4r3FnA0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=olu+ITobp38IzmkdVnq/bfNgYi//651RqILmhrpNEpn01jLF5D8hvJ8PZluPWrtH2lSmLpM5M++G2ikuD0VBY8K6VoR9RFyC4hXtaOaa7J2zg0lZd/wQ72TmeGnQT98ib6lFN7d7c5P5Y8VAG8g7ELqnlR7OJszr0MG65lX/HLo= 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.189 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-alpha@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. 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) /* * 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 = command_line; /* @@ -511,7 +511,7 @@ setup_arch(char **cmdline_p) } /* Replace the command line, now that we've killed it with strsep. */ - strcpy(command_line, boot_command_line); + strscpy(command_line, boot_command_line); /* If we want SRM console printk echoing early, do it now. */ if (alpha_using_srm && srmcons_output) { -- 2.49.0