From nobody Sat Oct 4 12:45:44 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 534442609FD for ; Fri, 15 Aug 2025 21:38:41 +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=1755293924; cv=none; b=res6WVczcU6CbXPO+KjK9X80EsYDbVrBGz2O6P2r+iqR+ABMlC5H+l7BLq8URKSBvI5nIWjL+gcmDZ/Be/a8SUZna4j4NudbnDzUIIgv8giV37Cf8muX+GA5zbKP7vv/Hmgn33W3PWG57vIfJ2zlJQEYrncloeqr4tbctKFPp04= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755293924; c=relaxed/simple; bh=m+SFyPZPdNLkEeh/Z9y98jQI5VDRudwIYZP3ks+Y9tk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tWVE9tEwf9gMro9NgCPPtUr28twyxl1g7g7F3Ha9IMRXiLeEJT9Pr3WTs2HTJ/qVm7FxfWNWEN/HRtaDlaWQEfAyaUOnjgFFlhGuJC/fKbCNRlvByOus1bV1EPHR5KoBLBDnttR5z6gciHTZZJZ+tBX6NZIkU6165H1f4K5Fshw= 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=Hx9iEQMT; 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="Hx9iEQMT" 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=1755293918; 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=Odl8SZESVhrHQmKkgQviMOnzxHTYvfzH2nuPTA/Ub7M=; b=Hx9iEQMTdLY8qQIghpT5o5Jto0B4N35X9rsIoqJLHmKviAyFctNdcqLDyuw61P0+jwJjTl WIm76CO0Sxlb1zY0qK+IgVWvIa3fKnEdKbCP0Yasg9ccU8svlcGy2I1gWxotis4b6n6cT+ FL44FGofAyctU/aP8n5zDAGEyqsEF7w= From: Thorsten Blum To: Marco Elver , Dmitry Vyukov Cc: linux-hardening@vger.kernel.org, Thorsten Blum , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH] kcsan: test: Replace deprecated strcpy() with strscpy() Date: Fri, 15 Aug 2025 23:37:44 +0200 Message-ID: <20250815213742.321911-3-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. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum Reviewed-by: Justin Stitt Reviewed-by: Marco Elver --- kernel/kcsan/kcsan_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/kcsan/kcsan_test.c b/kernel/kcsan/kcsan_test.c index 49ab81faaed9..ea1cb4c8a894 100644 --- a/kernel/kcsan/kcsan_test.c +++ b/kernel/kcsan/kcsan_test.c @@ -125,7 +125,7 @@ static void probe_console(void *ignore, const char *buf= , size_t len) goto out; =20 /* No second line of interest. */ - strcpy(observed.lines[nlines++], ""); + strscpy(observed.lines[nlines++], ""); } } =20 @@ -231,7 +231,7 @@ static bool __report_matches(const struct expect_report= *r) =20 if (!r->access[1].fn) { /* Dummy string if no second access is available. */ - strcpy(cur, ""); + strscpy(expect[2], ""); break; } } --=20 2.50.1