aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxu xin <[email protected]>2022-04-29 14:38:03 -0700
committerakpm <[email protected]>2022-04-29 14:38:03 -0700
commitedc73c7261ca3ea79867437bb0b9dab0e232436c (patch)
tree52acb8238e906a56dd3c3d8cef6dd236750fd3f4
parent0e0af57e0e91b304f36b7d1dba859e3c04094273 (diff)
kernel: make taskstats available from all net namespaces
If getdelays runs in a non-init network namespace, it will fail in getting delayacct stats even if it has privilege of root user, which seems to be not very reasonable. We can simply reproduce this by executing commands: unshare -n getdelays -d -p <pid> I don't think net namespace should be an obstacle to the normal execution of getdelay function. So let's make it available from all net namespaces. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: xu xin <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Yang Yang <[email protected]> Cc: "Dr. Thomas Orgis" <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Ismael Luceno <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--kernel/taskstats.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index 72415e22342b..f7e246336218 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -688,6 +688,7 @@ static struct genl_family family __ro_after_init = {
.module = THIS_MODULE,
.ops = taskstats_ops,
.n_ops = ARRAY_SIZE(taskstats_ops),
+ .netnsok = true,
};
/* Needed early in initialization */