diff options
| author | Tejun Heo <tj@kernel.org> | 2026-09-26 09:23:02 -1000 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-09-26 10:09:12 -1000 |
| commit | 94480606a677deb68d5622cf0ded88626514b3f2 (patch) | |
| tree | aea4107658e2745f85fe4af1e3d396183feeea5d /tools/perf/scripts/python/bin/stackcollapse-record | |
| parent | 4409a85735cdca5c4c400c0dad1feee091872eee (diff) | |
| download | linux-94480606a677deb68d5622cf0ded88626514b3f2.tar.gz linux-94480606a677deb68d5622cf0ded88626514b3f2.zip | |
sched_ext: Add a size argument to scx_bpf_cid_topo() so struct scx_cid_topo can grow
scx_bpf_cid_topo() copies struct scx_cid_topo into a buffer the BPF program
sized from its own vmlinux.h while the verifier sizes the write from the
running kernel's BTF. The struct may grow and each growth then breaks every
scheduler built against the older layout, rejected at load or written past
its buffer. This is the usual hole for a struct handed to BPF, closed
elsewhere with a size argument, and it was missed here.
Take the buffer size, copy the smaller of it and the kernel's struct and set
the rest to -1. Accesses to the copy are CO-RE relocated, so the struct can
grow by appending fields, which its comment now states. The kfunc changes in
place: the cid interface is still being finalized and no released scheduler
uses the current form.
Fixes: e9b55af47edf ("sched_ext: Add topological CPU IDs (cids)")
Cc: stable@vger.kernel.org # v7.2+
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions
