Re: [PATCH net v2 1/2] net/sched: taprio: reject software schedules that overflow their timestamps

From: Vinicius Costa Gomes

Date: Mon Oct 12 2026 - 18:37:05 EST


Krystian Kaniewski <krystianmkaniewski@xxxxxxxxx> writes:

> taprio takes base-time as an unbounded signed 64-bit value. A base time
> in the future is used as the schedule start unchanged, and
> setup_first_end_time() then adds the cycle time, the first interval and
> the gate durations of the first entry to it. With a start close to
> KTIME_MAX these sums overflow, and the software schedule starts with end
> and gate close times that lie far in the past.
>
> If this is the first schedule, the qdisc timer is armed for its future
> start. With an operational schedule running, taprio_start_sched() keeps
> the earlier operational expiry instead. A large cycle-time-extension
> can then trigger an early handover to the pending admin schedule.
> advance_sched() uses the invalid entry end as the next expiry and can
> keep restarting inside the same timer interrupt.
>
> Before a software schedule is initialized and published, check that the
> computed start is not negative and leaves room for every timestamp
> initialized from it, and reject the schedule with -ERANGE otherwise. Full
> offload and txtime-assist do not use the software timer and are not
> affected. Schedules with a reasonable base time behave as before.
>
> Fixes: 5a781ccbd19e ("tc: Add support for configuring the taprio scheduler")
> Assisted-by: Codex:gpt-6.1-sol
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Krystian Kaniewski <krystianmkaniewski@xxxxxxxxx>
> ---

Acked-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxx>


--
Vinicius