From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796327415; b=mC72pr5zmXxWGbJP0OraW95vhDqD51VZ4GGTrnwrMAJ1ygVDNco+tT6BDfetzueRr5HQ xB5Us5UtHN3C3vE4W8Zgn/N8tFGs/oIjQ8By0Mb/mySFy466i3hkq00+do1oSmopMXdsm aUD3yg5Nog1H2+9WO6W/+hwV9Vz1j3QxJihL5T/jMZqF7e9e8bAYiUmHnXz5Fr08TGkXd z5rlHFHS/7nPbVDPAei1EFgMJVSMkwFDCZn5nuRNg33H0LksCDJCwIqGMhm7QSWp0mUoN PVv8WjLNn//HygcjhgDqtDuVwJyZXNUTaExygI34Y1ibBI0vjQWN0kR+WH7TnkE/5hQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796327415; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=/nFjdA8sYpK6bukyEWRqn8B8XmTOoZNvZQpifoYOv+Q=; b=KZV0GAdKDB1NIYyr3TGZVldZQPoG1QtQVgw8j37VRDrLFJZdtxf+COFZmbDJq+hmhTea jwsxX+kzSa1aSJ9Ec/Z8wqZgI8efvdk4J+H0JHKoMm6mPapXeKrfFsHWMK3WWDfjZRmcS zc75t/K5/PKtak9/nvZ9RX8iJlv0DVI1VAX1dsUgVf5u3KYILH+4mcmTl1QokM93/wbPq hY10T64sTP+UKj0hPddtx4wcPomdDqwZG+ayf7KiSFHvUWB2f9aMYlXgZNInQAQcUMyLu if/Q1YwrP4ooaAHPqt2jB4PjvuU5NXVQBCiwICpjZfTDf6skJNd+i4mumDFlFNaAl4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lBRfppDB; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD474606A322 for ; Thu, 3 Dec 2026 19:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lBRfppDB Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41BC51F000C2; Thu, 3 Dec 2026 19:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796327415; bh=/nFjdA8sYpK6bukyEWRqn8B8XmTOoZNvZQpifoYOv+Q=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=lBRfppDBlx31TuTA4q4LU3YYmb0oFEqBBzwXizBFw4gIHhTo6Wtl7mFcucvd8vLk6 R8sb7gAyC6GIE8rbmrKJqfpmPmhtEUPiXipadHNY8THydaVyKaWb6a+tLExos5x61r SsKhYv8v/erpT6St4/hL4tHs9kiIY3JGeUn6DgV1Dn+bF4Tv4rckTT8WXLCbfDDgoc g68IDpFkmxEPeb/qK2QDpHcy6T4nLn5/BSAP976lSln7SI5EbKVnje0cxA5okTzvRr CmFbW7TNlq5E/Bctp4jAMWw6wpkWz/a8Ci4irco13QO37SA+sc6kCUTLdj9RbbXsxZ kzp8TBh0IxaaA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v10 16/19] tracing/remotes: Add poll_ms tracefs file Reply-To: sashiko-reviews@lists.linux.dev To: "Vincent Donnefort" , linux-trace-kernel@vger.kernel.org In-Reply-To: <20261203190007.2431041-17-vdonnefort@google.com> References: <20261203190007.2431041-1-vdonnefort@google.com> <20261203190007.2431041-17-vdonnefort@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 19:50:14 +0000 X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] tracing/remotes: missing upper bound on val in poll_ms_write() -- commit 85ff7f2dcbcb7b597ab19aeb9070e673e12a0d49 Author: Vincent Donnefort tracing/remotes: Add poll_ms tracefs file This commit adds a poll_ms tracefs file to trace remotes so userspace can configure the remote buffer polling interval. > diff --git a/kernel/trace/trace_remote.c b/kernel/trace/trace_remote.c > index a317a417207d8..7a79e43dcd46a 100644 > --- a/kernel/trace/trace_remote.c > +++ b/kernel/trace/trace_remote.c > @@ -1137,6 +1137,46 @@ static int dump_on_panic_show(struct seq_file *s, = void *unused) > } > DEFINE_TRACE_REMOTE_ATTRIBUTE(dump_on_panic); > =20 > +static ssize_t poll_ms_write(struct file *filp, const char __user *ubuf,= size_t cnt, loff_t *ppos) > +{ > + struct seq_file *seq =3D filp->private_data; > + struct trace_remote *remote =3D seq->private; > + unsigned int val; > + int ret; > + > + ret =3D kstrtouint_from_user(ubuf, cnt, 10, &val); > + if (ret) > + return ret; > + > + if (!val) > + return -EINVAL; > + > + guard(mutex)(&remote->lock); > + > + if (val =3D=3D remote->poll_ms) > + return cnt; > + > + if (remote->poll_cnt) > + cancel_delayed_work_sync(&remote->poll_work); > + > + WRITE_ONCE(remote->poll_ms, val); > + > + if (remote->poll_cnt) > + schedule_delayed_work(&remote->poll_work, msecs_to_jiffies(val)); > + > + return cnt; > +} [Severity: Low] Should poll_ms_write() enforce an upper bound on val? Currently any non-zero unsigned int is accepted, stored in remote->poll_ms, and passed to msecs_to_jiffies() here and in trace_remote_do_poll(). For values above INT_MAX, __msecs_to_jiffies() treats (int)m < 0 as MAX_JIFFY_OFFSET while poll_ms_show() still reports the out-of-range value. On 32-bit kernels with HZ =3D=3D 1000, values near INT_MAX pass through _msecs_to_jiffies() unclamped, exceeding MAX_JIFFY_OFFSET (0x3ffffffe). When base->clk lags jiffies by a tick, calc_wheel_index() sees a negative signed delta and expires poll_work immediately. Rejecting values above a supported maximum (or where msecs_to_jiffies(val) reaches MAX_JIFFY_OFFSET) would avoid both issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203190007.2431= 041-1-vdonnefort@google.com?part=3D16