Re: [PATCH net-next v3 2/2] selftests: ptp: add a regression test for the frequency adjustment overflow

From: Richard Cochran

Date: Sun Aug 02 2026 - 14:53:44 EST


On Sat, Aug 01, 2026 at 10:29:23PM +0000, Deep Shah wrote:
> testptp's -f option stores the requested adjustment as an int ppb and
> converts it to scaled ppm, so it cannot express the 64-bit scaled-ppm
> values needed to overflow scaled_ppm_to_ppb() and bypass the max_adj
> check enforced by ptp_clock_adjtime().
>
> Add a small test that crafts struct timex.freq directly and verifies that
> an overflowing frequency adjustment is rejected with -ERANGE. The test
> skips when no frequency-adjustable PTP device is available.
>
> Signed-off-by: Deep Shah <deepshah146@xxxxxxxxx>

Acked-by: Richard Cochran <richardcochran@xxxxxxxxx>