All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Samuel Moelius <sam.moelius@trailofbits.com>
Cc: Ian Abbott <abbotti@mev.co.uk>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] comedi: comedi_test: avoid AI scan timing overflow
Date: Tue, 9 Jun 2026 07:18:30 +0200	[thread overview]
Message-ID: <2026060920-plural-shortwave-6231@gregkh> (raw)
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 <sam.moelius@trailofbits.com>

What commit id does this fix?  How was this tested?

thanks,

greg k-h

  reply	other threads:[~2026-06-09  5:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  0:14 [PATCH] comedi: comedi_test: avoid AI scan timing overflow Samuel Moelius
2026-06-09  5:18 ` Greg Kroah-Hartman [this message]
2026-06-09  8:54   ` Ian Abbott
2026-06-09 10:10     ` Greg Kroah-Hartman
2026-06-09  9:07 ` Ian Abbott
2026-06-09 10:28 ` Ian Abbott
2026-06-10  0:00   ` Samuel Moelius

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026060920-plural-shortwave-6231@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=abbotti@mev.co.uk \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam.moelius@trailofbits.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.