1. 03 2月, 2017 2 次提交
    • T
      cgroup: drop the matching uid requirement on migration for cgroup v2 · 576dd464
      Tejun Heo 提交于
      Along with the write access to the cgroup.procs or tasks file, cgroup
      has required the writer's euid, unless root, to match [s]uid of the
      target process or task.  On cgroup v1, this is necessary because
      there's nothing preventing a delegatee from pulling in tasks or
      processes from all over the system.
      
      If a user has a cgroup subdirectory delegated to it, the user would
      have write access to the cgroup.procs or tasks file.  If there are no
      further checks than file write access check, the user would be able to
      pull processes from all over the system into its subhierarchy which is
      clearly not the intended behavior.  The matching [s]uid requirement
      partially prevents this problem by allowing a delegatee to pull in the
      processes that belongs to it.  This isn't a sufficient protection
      however, because a user would still be able to jump processes across
      two disjoint sub-hierarchies that has been delegated to them.
      
      cgroup v2 resolves the issue by requiring the writer to have access to
      the common ancestor of the cgroup.procs file of the source and target
      cgroups.  This confines each delegatee to their own sub-hierarchy
      proper and bases all permission decisions on the cgroup filesystem
      rather than having to pull in explicit uid matching.
      
      cgroup v2 has still been applying the matching [s]uid requirement just
      for historical reasons.  On cgroup2, the requirement doesn't serve any
      purpose while unnecessarily complicating the permission model.  Let's
      drop it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      576dd464
    • T
      cgroup, perf_event: make perf_event controller work on cgroup2 hierarchy · 968ebff1
      Tejun Heo 提交于
      perf_event is a utility controller whose primary role is identifying
      cgroup membership to filter perf events; however, because it also
      tracks some per-css state, it can't be replaced by pure cgroup
      membership test.  Mark the controller as implicitly enabled on the
      default hierarchy so that perf events can always be filtered based on
      cgroup v2 path as long as the controller is not mounted on a legacy
      hierarchy.
      
      "perf record" is updated accordingly so that it searches for both v1
      and v2 hierarchies.  A v1 hierarchy is used if perf_event is mounted
      on it; otherwise, it uses the v2 hierarchy.
      
      v2: Doc updated to reflect more flexible rebinding behavior.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      968ebff1
  2. 11 1月, 2017 2 次提交
  3. 18 3月, 2016 3 次提交
  4. 12 3月, 2016 1 次提交
  5. 17 2月, 2016 2 次提交
  6. 04 2月, 2016 1 次提交
  7. 29 1月, 2016 1 次提交
  8. 21 1月, 2016 2 次提交
  9. 12 1月, 2016 1 次提交
  10. 17 11月, 2015 1 次提交