Skip to content

Commit edc73c7

Browse files
xu xinakpm00
authored andcommitted
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]>
1 parent 0e0af57 commit edc73c7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/taskstats.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ static struct genl_family family __ro_after_init = {
688688
.module = THIS_MODULE,
689689
.ops = taskstats_ops,
690690
.n_ops = ARRAY_SIZE(taskstats_ops),
691+
.netnsok = true,
691692
};
692693

693694
/* Needed early in initialization */

0 commit comments

Comments
 (0)