Re: [PATCH v2 sched_ext/for-7.3 15/36] sched_ext: Add scx_cmask_ref for validated arena cmask access
From: Tejun Heo
Date: Mon Jul 06 2026 - 19:40:47 EST
Hi Andrea,
On Mon, 6 Jul 2026 11:04:56 +0200, Andrea Righi wrote:
> We validate the requested CID range, but not whether the cmask declares enough
> bits[] capacity for that range, unless I'm missing something. For example,
> nr_cids can require multiple words while alloc_words is one. Does the ref also
> need to account for the storage capacity described by alloc_words?
Right, that's a real gap - thanks. For v3, _init() also snapshots
alloc_words and rejects when SCX_CMASK_NR_WORDS(nr_cids) > alloc_words, so a
range that doesn't fit its declared storage is refused before any bits[]
access. I folded this into the patch together with dropping __counted_by,
which read the same BPF-writable count.
Thanks.