[LTP] [PATCH 1/3] tst_timer_test: Fix out-of-bounds array access

Li Wang li.wang@linux.dev
Wed Oct 7 07:50:55 CEST 2026


On Tue, Oct 06, 2026 at 03:02:37PM +0200, Andrea Cervesato wrote:
> From: Andrea Cervesato <andrea.cervesato@suse.com>
> 
> Both outlier and early-wake loops in do_timer_test() evaluate
> samples[i] before verifying that index i is within bounds.
> When all samples are outliers or early, this causes heap buffer
> overreads at samples[nsamples] or samples[-1].
> 
> Check index bounds before indexing the samples array.
> 
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>

Reviewed-by: Li Wang <li.wang@linux.dev>

-- 
Regards,
Li Wang


More information about the ltp mailing list