Skip to content

devcg: Store local settings for each device cgroup

[email protected] cgroups 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4devcg: move behavior and exceptions into its own structuresecurity/device_cgroup.c+42 -300 replies
2/4devcg: make dev_exception_ functions to use listssecurity/device_cgroup.c+12 -120 replies
3/4devcg: save locally saved settingssecurity/device_cgroup.c+31 -40 replies
4/4devcg: try to reapply local settingssecurity/device_cgroup.c+82 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] devcg: Store local settings for each device cgroup

This patchset makes possible for device cgroups to store locally set rules to be reapplied whenever possible. This is also desired when moving device cgroups around.

Consider:

          A
        /
       B

Behavior in both is deny. 'A' has this exception list:

	b 1:* rw
	c *:* rw
One can explicitely set on 'B':
	b 1:5 r

If for some reason 'A' removes 'b 1:* rw', 'B' exception 'b 1:5 r' will be removed because it's not allowed anymore and would be forever lost.

Now, consider that in the parent more fine grained exceptions were added:

	b 1:1 r
	b 1:2 rw
	b 1:4 rwc
	b 1:5 r

B would still be out of exceptions (we only propagate restrictions, not added access).

With this patchset, the 'b 1:5 r' exception will be kept and whenever possible (more specifically when the parent gets access to more devices) it'll be re-evaluated and applied if allowed. In this specific case, since it's allowed again, the exception 'b 1:5 r' will be reapplied to B.

This patchset is based on for-3.12 branch on Tejun's tree (bd8815a6d802fc16a7a106e170593aa05dc17e72) and it's available for review on my git tree:

	git://github.com/aristeu/linux-2.6.git
	branch: devcg-rename