lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 11 Nov 2022 10:35:24 -0800
From:   Kristen Carlson Accardi <kristen@...ux.intel.com>
To:     jarkko@...nel.org, dave.hansen@...ux.kernel.org, tj@...nel.org,
        linux-kernel@...r.kernel.org, linux-sgx@...r.kernel.org,
        cgroups@...r.kernel.org, Zefan Li <lizefan.x@...edance.com>,
        Johannes Weiner <hannes@...xchg.org>
Cc:     zhiquan1.li@...el.com,
        Kristen Carlson Accardi <kristen@...ux.intel.com>
Subject: [PATCH 19/26] cgroup/misc: Expose parent_misc()

To manage the SGX EPC memory via the misc controller, the SGX
driver will need to be able to iterate over the misc cgroup
hierarchy. Make parent_misc() available for a future patch
that will utilize it.

Signed-off-by: Kristen Carlson Accardi <kristen@...ux.intel.com>
---
 include/linux/misc_cgroup.h | 6 ++++++
 kernel/cgroup/misc.c        | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/linux/misc_cgroup.h b/include/linux/misc_cgroup.h
index b79c78378f17..d1aeb85f2ed6 100644
--- a/include/linux/misc_cgroup.h
+++ b/include/linux/misc_cgroup.h
@@ -60,6 +60,7 @@ struct misc_cg {
 };
 
 struct misc_cg *root_misc(void);
+struct misc_cg *parent_misc(struct misc_cg *cg);
 unsigned long misc_cg_res_total_usage(enum misc_res_type type);
 int misc_cg_set_capacity(enum misc_res_type type, unsigned long capacity);
 int misc_cg_try_charge(enum misc_res_type type, struct misc_cg *cg,
@@ -112,6 +113,11 @@ static inline struct misc_cg *root_misc(void)
 	return NULL;
 }
 
+static inline struct misc_cg *parent_misc(struct misc_cg *cg)
+{
+	return NULL;
+}
+
 static inline unsigned long misc_cg_res_total_usage(enum misc_res_type type)
 {
 	return 0;
diff --git a/kernel/cgroup/misc.c b/kernel/cgroup/misc.c
index 8aa994d9cd02..b22a055af9ad 100644
--- a/kernel/cgroup/misc.c
+++ b/kernel/cgroup/misc.c
@@ -63,10 +63,11 @@ EXPORT_SYMBOL_GPL(root_misc);
  * * struct misc_cg* - Parent of the @cgroup.
  * * %NULL - If @cgroup is null or the passed cgroup does not have a parent.
  */
-static struct misc_cg *parent_misc(struct misc_cg *cgroup)
+struct misc_cg *parent_misc(struct misc_cg *cgroup)
 {
 	return cgroup ? css_misc(cgroup->css.parent) : NULL;
 }
+EXPORT_SYMBOL_GPL(parent_misc);
 
 /**
  * valid_type() - Check if @type is valid or not.
-- 
2.37.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ