net/sched: taprio: fix use-after-free in advance_sched() on schedule switch
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a3d43c0d56f1b94e74963a2fbadfb70126d92213 · < b73235da5dde77ed1264f9767b62c28c9d71fd78| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net/sched: taprio: fix use-after-free in advance_sched() on schedule switch
In advance_sched(), when should_change_schedules() returns true, switch_schedules() is called to promote the admin schedule to oper. switch_schedules() queues the old oper schedule for RCU freeing via call_rcu(), but 'next' still points into an entry of the old oper schedule. The subsequent 'next->end_time = end_time' and rcu_assign_pointer(q->current_entry, next) are use-after-free.
Fix this by selecting 'next' from the new oper schedule immediately after switch_schedules(), and using its pre-calculated end_time. setup_first_end_time() sets the first entry's end_time to base_time + interval when the schedule is installed, so the value is already correct.
The deleted 'end_time = sched_base_time(admin)' assignment was also harmful independently: it would overwrite the new first entry's pre-calculated end_time with just base_time.
From the CVE record · Linux
The Linux kernel’s taprio scheduler has a use-after-free in advance_sched() when an admin schedule replaces the operating schedule. The code can access an entry from the old schedule after queuing it for freeing. The input does not establish how an attacker could trigger this or whether authentication or user interaction is required.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.