diff options
author | Elena Reshetova <elena.reshetova@intel.com> | 2017-03-08 11:00:40 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2017-03-09 01:46:03 +0300 |
commit | 4b9502e63b5e2b1b5ef491919d3219b9440fe0b3 (patch) | |
tree | 75ede84d703f3e230322be6f11b87625ba9ab72f /include/linux/cgroup-defs.h | |
parent | 387ad9674b0013c8756ad20d854ff005b0c313ad (diff) | |
download | linux-4b9502e63b5e2b1b5ef491919d3219b9440fe0b3.tar.xz |
kernel: convert css_set.refcount from atomic_t to refcount_t
refcount_t type and corresponding API should be
used instead of atomic_t when the variable is used as
a reference counter. This allows to avoid accidental
refcounter overflows that might lead to use-after-free
situations.
Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David Windsor <dwindsor@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup-defs.h')
-rw-r--r-- | include/linux/cgroup-defs.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 6a3f850cabab..c74b78ecd583 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -13,6 +13,7 @@ #include <linux/wait.h> #include <linux/mutex.h> #include <linux/rcupdate.h> +#include <linux/refcount.h> #include <linux/percpu-refcount.h> #include <linux/percpu-rwsem.h> #include <linux/workqueue.h> @@ -156,7 +157,7 @@ struct css_set { struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; /* reference count */ - atomic_t refcount; + refcount_t refcount; /* the default cgroup associated with this css_set */ struct cgroup *dfl_cgrp; |