From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 35DFA25B0A2 for ; Tue, 9 Jun 2026 05:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780982370; cv=none; b=OD3UrVBgP84Wb2GYiJjcuBoQgZ2TnqhZI1ybaKu26D1Dzk1mIrUW6/1oFUNXdAHEDtRonw+c1FxBH3bhQNNWwyAJAQNZ5pWQBWy7xUjCs0PhjLUd7EeWXyV8sKjDqn34L0GYlr//yt/C6aJFnkqitb+w57ZEs0zgKIimdzukSpk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780982370; c=relaxed/simple; bh=yvA9ANdoU1mF717oQc/CP1Sfpy0C4ylhWvVzc3LMOy8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=taGF9Plxx/Y8MmBB3KsnMTDehIYzZ80dJqXfeVxYl+KWTfWxDgRl3/VUQ+VTDJxSUxxHB50gr2bIH7Vt91Zy75sFaZGGiSwAYdM7DMlrPQILMa7t81WJMS8tD7g4G/+YhzAbPWG5p5A7yW2JA/3UIdluZn73WmCCOP5xhqSINGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=On1La8T3; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="On1La8T3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 272021F00893; Tue, 9 Jun 2026 05:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780982368; bh=EX7uri1F0o6yIOnHkTUQn1ThAodFIebS8SOxqMfs1wY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=On1La8T3OSSEMWmNEld3l5jg7/tkMueMYIKaecx12zGWLDgozYvelHIYg726uv6lw P9uguGiiFYDjHeIz2h57F4Xd/jSs4hyryMCyaDgUzPDqiV4yyigwZN4oHqM2mYpaZJ 6zOuFcxm8+OlyYixDC5STf/675Ws5YydAQccOeMc= Date: Tue, 9 Jun 2026 07:18:30 +0200 From: Greg Kroah-Hartman To: Samuel Moelius Cc: Ian Abbott , H Hartley Sweeten , open list Subject: Re: [PATCH] comedi: comedi_test: avoid AI scan timing overflow Message-ID: <2026060920-plural-shortwave-6231@gregkh> References: <20260609001221.1234948.362a4ba725ef.comedi-test-ai-timing-overflow@trailofbits.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260609001221.1234948.362a4ba725ef.comedi-test-ai-timing-overflow@trailofbits.com> On Tue, Jun 09, 2026 at 12:14:04AM +0000, Samuel Moelius wrote: > `waveform_ai_cmdtest()` tries to keep timer-driven analog-input scans > representable by limiting `convert_arg` and by making `scan_begin_arg` > at least `convert_arg * scan_end_arg`. Please don't use markdown crud in changelog comments :( > The conversion clamp tested `scan_begin_arg == TRIG_TIMER` instead of > `scan_begin_src == TRIG_TIMER`, so normal timer scans skipped the clamp. > The later product was computed in `unsigned int`, allowing a large > conversion period to wrap and produce an accepted command whose true > scan conversion time exceeds the scan period. Is that a real problem as this is a test module? > Require timer conversions to be at least one microsecond, apply the > conversion limit when `scan_begin_src` is `TRIG_TIMER`, keep that limit > on the same microsecond granularity as the rounded argument, and compute > the scan-period floor in 64-bit before clamping it back to the ioctl > argument range. > > Assisted-by: Codex:gpt-5.5-cyber-preview > Signed-off-by: Samuel Moelius What commit id does this fix? How was this tested? thanks, greg k-h