public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
* Using cgroup membership for resource access control?
@ 2023-02-06 21:21 Tony Luck
       [not found] ` <Y+FvQbfTdcTe9GVu-E6Nu+q68HHQWLgLFz2vlpa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Luck @ 2023-02-06 21:21 UTC (permalink / raw)
  To: Tejun Heo, Johannes Weiner; +Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, Ramesh Thomas

Hi,

Cgroups primary function seems to be to divide limited resources and
make sure that they are allocated "fairly" (where the sysadmin decides
what is fair, and how much of each resource should be made available to
groups of processes).

Intel has a h/w feature in the DSA (Data Streaming Accelerator) device
that will allow a process to offer access to bounded virtual windows
into its address space to other processes.

The case where one process wants to make this offer to just one other
process seems simple.

But the h/w allows, and a process might want, to offer a virtual window
to several other processes. As soon as anyone says the words "several
processes" the immediate thought is "can cgroups help with this?"

I'm thinking along these lines:

1) Sysadmin creates a cgroup for a "job". Initializes the limits on
how many of these virtual windows can be used (h/w has a fixed number).
Assigns tasks in the job to this cgroup.

2) Tasks in the job that want to offer virtual windows call into the
driver to allocate and partially set up windows tagged with "available
to any other process in my cgroup".

3) Other tasks in the group ask the driver to complete the h/w
initialization by adding them (their PASID) to the access list
for each window.

My questions:

1) Is this horrible - have I misunderstood cgroups?
	1a) If this is horrible, can it be rescued?

2) Will it work - is "membership in a cgroup" a valid security mechanism?

3) Has someone done something similar before (so I can learn from their code)?

4) Is there an existing exported API to help. I see task_cgroup_path()
which looks generally helpful (though I'd prefer a task_cgroup() that
just takes a task and gives me the cgroup to which it belongs.)

Thanks

-Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-07  0:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-06 21:21 Using cgroup membership for resource access control? Tony Luck
     [not found] ` <Y+FvQbfTdcTe9GVu-E6Nu+q68HHQWLgLFz2vlpa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2023-02-06 21:42   ` Tejun Heo
     [not found]     ` <Y+F0NA9iI0zlONz7-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2023-02-06 21:43       ` Tejun Heo
     [not found]         ` <Y+F0mXS9z0flDhf7-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2023-02-06 22:18           ` Luck, Tony
     [not found]             ` <SJ1PR11MB6083C61BCA70A31F8C0F12ECFCDA9-0NYKzF1JBnQoAmWoDslVMJPPoyLQLiKMvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2023-02-06 23:30               ` Tejun Heo
     [not found]                 ` <Y+GNp4VA1T9pV6nM-NiLfg/pYEd1N0TnZuCh8vA@public.gmane.org>
2023-02-07  0:48                   ` Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox