ucount.c (ecb41832bd2a7a3f8ac93527cec5e51e3827daed) ucount.c (eec4844fae7c033a0c1fc1eb3b8517aeb8b6cc49)
1// SPDX-License-Identifier: GPL-2.0-only
2
3#include <linux/stat.h>
4#include <linux/sysctl.h>
5#include <linux/slab.h>
6#include <linux/cred.h>
7#include <linux/hash.h>
8#include <linux/kmemleak.h>

--- 38 unchanged lines hidden (view full) ---

47 return (mode << 6) | (mode << 3) | mode;
48}
49
50static struct ctl_table_root set_root = {
51 .lookup = set_lookup,
52 .permissions = set_permissions,
53};
54
1// SPDX-License-Identifier: GPL-2.0-only
2
3#include <linux/stat.h>
4#include <linux/sysctl.h>
5#include <linux/slab.h>
6#include <linux/cred.h>
7#include <linux/hash.h>
8#include <linux/kmemleak.h>

--- 38 unchanged lines hidden (view full) ---

47 return (mode << 6) | (mode << 3) | mode;
48}
49
50static struct ctl_table_root set_root = {
51 .lookup = set_lookup,
52 .permissions = set_permissions,
53};
54
55static int zero = 0;
56static int int_max = INT_MAX;
57#define UCOUNT_ENTRY(name) \
58 { \
59 .procname = name, \
60 .maxlen = sizeof(int), \
61 .mode = 0644, \
62 .proc_handler = proc_dointvec_minmax, \
55#define UCOUNT_ENTRY(name) \
56 { \
57 .procname = name, \
58 .maxlen = sizeof(int), \
59 .mode = 0644, \
60 .proc_handler = proc_dointvec_minmax, \
63 .extra1 = &zero, \
64 .extra2 = &int_max, \
61 .extra1 = SYSCTL_ZERO, \
62 .extra2 = SYSCTL_INT_MAX, \
65 }
66static struct ctl_table user_table[] = {
67 UCOUNT_ENTRY("max_user_namespaces"),
68 UCOUNT_ENTRY("max_pid_namespaces"),
69 UCOUNT_ENTRY("max_uts_namespaces"),
70 UCOUNT_ENTRY("max_ipc_namespaces"),
71 UCOUNT_ENTRY("max_net_namespaces"),
72 UCOUNT_ENTRY("max_mnt_namespaces"),

--- 169 unchanged lines hidden ---
63 }
64static struct ctl_table user_table[] = {
65 UCOUNT_ENTRY("max_user_namespaces"),
66 UCOUNT_ENTRY("max_pid_namespaces"),
67 UCOUNT_ENTRY("max_uts_namespaces"),
68 UCOUNT_ENTRY("max_ipc_namespaces"),
69 UCOUNT_ENTRY("max_net_namespaces"),
70 UCOUNT_ENTRY("max_mnt_namespaces"),

--- 169 unchanged lines hidden ---