[bug report] cgroup: Honor caller's cgroup NS when resolving path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Michal Koutný,

The patch 74e4b956eb1c: "cgroup: Honor caller's cgroup NS when
resolving path" from Aug 26, 2022, leads to the following Smatch
static checker warning:

	./include/linux/kernfs.h:600 kernfs_walk_and_get()
	warn: sleeping in atomic context

kernel/cgroup/cgroup.c
  6639  struct cgroup *cgroup_get_from_path(const char *path)
  6640  {
  6641          struct kernfs_node *kn;
  6642          struct cgroup *cgrp = ERR_PTR(-ENOENT);
  6643          struct cgroup *root_cgrp;
  6644  
  6645          spin_lock_irq(&css_set_lock);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  6646          root_cgrp = current_cgns_cgroup_from_root(&cgrp_dfl_root);
  6647          kn = kernfs_walk_and_get(root_cgrp->kn, path);
                     ^^^^^^^^^^^^^^^^^^^
The kernfs_walk_and_get() function calls down_read() (a semaphore) so
it can't be called while holding a spinlock.

  6648          spin_unlock_irq(&css_set_lock);
  6649          if (!kn)
  6650                  goto out;

regards,
dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux