From: "Serge E. Hallyn" <serge@hallyn.com>
To: Aaron Tomlin <atomlin@atomlin.com>
Cc: tsbogend@alpha.franken.de, paul@paul-moore.com,
jmorris@namei.org, mingo@redhat.com, peterz@infradead.org,
juri.lelli@redhat.com, vincent.guittot@linaro.org,
stephen.smalley.work@gmail.com, casey@schaufler-ca.com,
longman@redhat.com, tj@kernel.org, hannes@cmpxchg.org,
mkoutny@suse.com, chenridong@huaweicloud.com,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
kprateek.nayak@amd.com, omosnace@redhat.com, kees@kernel.org,
neelx@suse.com, sean@ashe.io, chjohnst@gmail.com, steve@abita.co,
mproche@gmail.com, nick.lange@gmail.com, cgroups@vger.kernel.org,
linux-mips@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-security-module@vger.kernel.org, selinux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5] security: Expand task_setscheduler LSM hook
Date: Fri, 6 Nov 2026 13:59:33 -0600 [thread overview]
Message-ID: <au4xpT1D8WzBxdvY@hallyn.com> (raw)
In-Reply-To: <kn57okulm7cmodzdzvzqqswzafu3vopsatfcsptyrz5ztknx4w@ngwh6si3zgpo>
On Fri, Nov 06, 2026 at 02:50:34PM -0500, Aaron Tomlin wrote:
> On Fri, Nov 06, 2026 at 01:21:34PM -0600, Serge E. Hallyn wrote:
> > > This change updates all in-tree security modules (capabilities, SELinux,
> > > and Smack) to accommodate the new parameters mechanically, while
> > > providing LSMs with the necessary context to enforce strict scheduling
> > > and affinity policies.
> > >
> > > Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
> >
> > This seems misleading - Casey explicitly said "for the smack bits". This
> > makes it seem like he reviewed and approved of the whole set.
>
> Hi Serge,
>
> Apologies for that, it was not my intention to misrepresent the scope of
> Casey's review. The qualifier line was dropped when collecting the trailer.
> I will update the tag in the next revision to explicitly scope it:
>
> Reviewed-by: Casey Schaufler <casey@schaufler-ca.com> # Smack
>
> > I see no issues with the commoncap.c and security.c changes, but as
> > Paul said two versions ago in
> > https://lore.kernel.org/lkml/CAHC9VhSROg6RGUN4_ZVBoEwYjRnKvyjnkbx2D88c09KiTgY3KQ@mail.gmail.com/
> > nothing appaers to be using these. Where is the user?
>
> The intended consumer is the BPF LSM (via the generated
> bpf_lsm_task_setscheduler() hook and the __nullable BTF annotations in
Ah, I see, thanks.
> include/linux/lsm_hook_defs.h). As discussed with Peter and Paul in the v3
> thread [1], when sched_setaffinity() is called, the cpuset controller
> silently intersects and truncates the requested mask without surfacing the
> original request, and seccomp cannot safely dereference the __user cpumask
> or sched_attr pointers without TOCTOU races. Exposing the copied-in
> sched_attr and cpumask to task_setscheduler allows BPF LSM programs to
> audit or mediate the actual userspace request before it is sanitised or
> applied.
>
> In my reply to Paul on v3 [1], I mentioned that once the MIPS prerequisite
> landed, I would include a concrete in-tree demonstration alongside the hook
> expansion, which I neglected to include in v4 and v5.
>
> Would adding a BPF LSM selftest (under tools/testing/selftests/bpf/) that
> attaches to lsm/task_setscheduler and exercises both the sched_attr and
> cpumask parameters (including NULL and non-NULL paths) be sufficient as an
> in-tree user/test?
Self-tests are good :)
> [1]: https://lore.kernel.org/lkml/ozsngetxq44lahategdi43sqrwdnpotsrebssczymqtkbh7snl@u6ytkznmpne5/
>
> Kind regards,
> --
> Aaron Tomlin
next prev parent reply other threads:[~2026-11-06 19:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 17:22 [PATCH v5] security: Expand task_setscheduler LSM hook Aaron Tomlin
2026-11-05 17:35 ` sashiko-bot
2026-11-06 19:21 ` Serge E. Hallyn
2026-11-06 19:50 ` Aaron Tomlin
2026-11-06 19:59 ` Serge E. Hallyn [this message]
2026-11-12 22:46 ` Chris Down
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=au4xpT1D8WzBxdvY@hallyn.com \
--to=serge@hallyn.com \
--cc=atomlin@atomlin.com \
--cc=bsegall@google.com \
--cc=casey@schaufler-ca.com \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huaweicloud.com \
--cc=chjohnst@gmail.com \
--cc=dietmar.eggemann@arm.com \
--cc=hannes@cmpxchg.org \
--cc=jmorris@namei.org \
--cc=juri.lelli@redhat.com \
--cc=kees@kernel.org \
--cc=kprateek.nayak@amd.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=mkoutny@suse.com \
--cc=mproche@gmail.com \
--cc=neelx@suse.com \
--cc=nick.lange@gmail.com \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sean@ashe.io \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=steve@abita.co \
--cc=tj@kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.