From nobody Sun Feb 8 22:06:28 2026 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 68889332901 for ; Mon, 12 Jan 2026 07:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768203137; cv=none; b=HJ7x550m3sZt6uxmSKDLYzNAU6nrSyGLVbK51YBqcF75cxGsLgBpXNZhHm9mnauyYCoSLiXMf6g55eGtGCN0iyKgUCIoeG4USQlr43+pRMzbY2N7XH9w+VL8a+3l3/g6BImz+BqrmqZRlEz27m+ShdgsZhThYRL10ztrrFsCHiQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768203137; c=relaxed/simple; bh=/Pe3//9w7IjRlZ5PxKu63g76brGyRa5s21C2q9PEXSY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Fau91L7yPHq334MfM1p0D6SQbg9HIDfMFXW2ct2sVvxJ9x2/Eo2rTS9G9rAVhOJVSBPhw2LwlnNAerkv6uInXQ7j1DYZ7qe/uBtBkOxzoI691fKSkzGFV7m5n0GDWAwYGhRfE19nJzs6zdutY3OUntcgVrMLBaakjgU4OcXLlOY= 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=NkQ4kSRY; arc=none smtp.client-ip=91.218.175.172 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="NkQ4kSRY" 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=1768203131; 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: in-reply-to:in-reply-to:references:references; bh=dey/oVwL655ps/UccfLJszueXjmKm4iUYtixNmkF++Q=; b=NkQ4kSRYHQKog9dolagfPy1l0wY9hoVzmEFzdXdqH4dPhXxiyjiZiuHb5gP5imP5m1h/6k N49ll2G027dYaf1RuzrZDTzgdaiJkDyMdPxGz/D7J56gEF5JvM5WeYE7hOM6PE43uGmMv9 DTzCtcwOQfKAOFrNlm2dc1KTu2B+chw= From: Fushuai Wang To: tglx@kernel.org, peterz@infradead.org, mathieu.desnoyers@efficios.com, akpm@linux-foundation.org, aliceryhl@google.com, yury.norov@gmail.com, vmalik@redhat.com, kees@kernel.org, dave.hansen@linux.intel.com, luto@kernel.org, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, rostedt@goodmis.org, mhiramat@kernel.org, brauner@kernel.org, jack@suse.cz, cyphar@cyphar.com Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-trace-kernel@vger.kernel.org, wangfushuai@baidu.com Subject: [PATCH v2 5/6] time: Use copy_from_user_nul() instead of copy_from_user() Date: Mon, 12 Jan 2026 15:30:38 +0800 Message-Id: <20260112073039.1185-6-fushuai.wang@linux.dev> In-Reply-To: <20260112073039.1185-1-fushuai.wang@linux.dev> References: <20260112073039.1185-1-fushuai.wang@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" From: Fushuai Wang Use copy_from_user_nul() instead of copy_from_user() to simplify the code. No functional change. Signed-off-by: Fushuai Wang --- kernel/time/test_udelay.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/time/test_udelay.c b/kernel/time/test_udelay.c index 783f2297111b..08ff8fd43471 100644 --- a/kernel/time/test_udelay.c +++ b/kernel/time/test_udelay.c @@ -107,9 +107,8 @@ static ssize_t udelay_test_write(struct file *file, con= st char __user *buf, if (count >=3D sizeof(lbuf)) return -EINVAL; =20 - if (copy_from_user(lbuf, buf, count)) + if (copy_from_user_nul(lbuf, buf, count)) return -EFAULT; - lbuf[count] =3D '\0'; =20 ret =3D sscanf(lbuf, "%d %d", &usecs, &iters); if (ret < 1) --=20 2.36.1