bpf: require an owned cpumask for bpf_cpumask_populate()
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first
Changes in v3 from the cover letter
* Split the fix and selftest into separate patches.
* Target bpf-next instead of bpf.
Patches in v3 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Require a BPF cpumask for bpf_cpumask_populate()kernel/ tools/ | +4 | 5 replies | Applied |
| 2/2 | selftests/bpf: test bpf_cpumask_populate() rejects a borrowed cpumasktools/ tools/ tools/ | +25 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Emil Tsalapatis | Tejun Heo |
|---|---|---|
| Series | A-b | |
| 1/2 | R-b | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf-next v3 0/2] bpf: require an owned cpumask for bpf_cpumask_populate()
bpf_cpumask_populate() writes its destination with bitmap_copy() but types it as struct cpumask *, so the verifier accepts a borrowed, read-only cpumask (for example from scx_bpf_get_online_cpumask()) as a writable destination. Fix it and add a selftest for coverage.
Changelog:
----------
v2 -> v3 (v1/v2 were a private report to [email protected])
* Split the fix and selftest into separate patches.
* Target bpf-next instead of bpf.
Nicholas Dudar (2):
bpf: Require a BPF cpumask for bpf_cpumask_populate() selftests/bpf: test bpf_cpumask_populate() rejects a borrowed cpumask
kernel/bpf/cpumask.c | 6 ++--- tools/sched_ext/include/scx/compat.bpf.h | 2 +- .../selftests/bpf/progs/cpumask_common.h | 2 +- .../selftests/bpf/progs/cpumask_failure.c | 23 +++++++++++++++++-- .../selftests/bpf/progs/cpumask_success.c | 6 ++--- 5 files changed, 29 insertions(+), 10 deletions(-)
base-commit: 36ffa86c42f91c8a57071e024afc4ffb51a8958f
Signature · 1 line
2.34.1