ipc_sysctl.c (ecb41832bd2a7a3f8ac93527cec5e51e3827daed) ipc_sysctl.c (eec4844fae7c033a0c1fc1eb3b8517aeb8b6cc49)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2007
4 *
5 * Author: Eric Biederman <ebiederm@xmision.com>
6 */
7
8#include <linux/module.h>

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

108#define proc_ipc_doulongvec_minmax NULL
109#define proc_ipc_dointvec NULL
110#define proc_ipc_dointvec_minmax NULL
111#define proc_ipc_dointvec_minmax_orphans NULL
112#define proc_ipc_auto_msgmni NULL
113#define proc_ipc_sem_dointvec NULL
114#endif
115
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2007
4 *
5 * Author: Eric Biederman <ebiederm@xmision.com>
6 */
7
8#include <linux/module.h>

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

108#define proc_ipc_doulongvec_minmax NULL
109#define proc_ipc_dointvec NULL
110#define proc_ipc_dointvec_minmax NULL
111#define proc_ipc_dointvec_minmax_orphans NULL
112#define proc_ipc_auto_msgmni NULL
113#define proc_ipc_sem_dointvec NULL
114#endif
115
116static int zero;
117static int one = 1;
118static int int_max = INT_MAX;
119int ipc_mni = IPCMNI;
120int ipc_mni_shift = IPCMNI_SHIFT;
121int ipc_min_cycle = RADIX_TREE_MAP_SIZE;
122
123static struct ctl_table ipc_kern_table[] = {
124 {
125 .procname = "shmmax",
126 .data = &init_ipc_ns.shm_ctlmax,

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

136 .proc_handler = proc_ipc_doulongvec_minmax,
137 },
138 {
139 .procname = "shmmni",
140 .data = &init_ipc_ns.shm_ctlmni,
141 .maxlen = sizeof(init_ipc_ns.shm_ctlmni),
142 .mode = 0644,
143 .proc_handler = proc_ipc_dointvec_minmax,
116int ipc_mni = IPCMNI;
117int ipc_mni_shift = IPCMNI_SHIFT;
118int ipc_min_cycle = RADIX_TREE_MAP_SIZE;
119
120static struct ctl_table ipc_kern_table[] = {
121 {
122 .procname = "shmmax",
123 .data = &init_ipc_ns.shm_ctlmax,

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

133 .proc_handler = proc_ipc_doulongvec_minmax,
134 },
135 {
136 .procname = "shmmni",
137 .data = &init_ipc_ns.shm_ctlmni,
138 .maxlen = sizeof(init_ipc_ns.shm_ctlmni),
139 .mode = 0644,
140 .proc_handler = proc_ipc_dointvec_minmax,
144 .extra1 = &zero,
141 .extra1 = SYSCTL_ZERO,
145 .extra2 = &ipc_mni,
146 },
147 {
148 .procname = "shm_rmid_forced",
149 .data = &init_ipc_ns.shm_rmid_forced,
150 .maxlen = sizeof(init_ipc_ns.shm_rmid_forced),
151 .mode = 0644,
152 .proc_handler = proc_ipc_dointvec_minmax_orphans,
142 .extra2 = &ipc_mni,
143 },
144 {
145 .procname = "shm_rmid_forced",
146 .data = &init_ipc_ns.shm_rmid_forced,
147 .maxlen = sizeof(init_ipc_ns.shm_rmid_forced),
148 .mode = 0644,
149 .proc_handler = proc_ipc_dointvec_minmax_orphans,
153 .extra1 = &zero,
154 .extra2 = &one,
150 .extra1 = SYSCTL_ZERO,
151 .extra2 = SYSCTL_ONE,
155 },
156 {
157 .procname = "msgmax",
158 .data = &init_ipc_ns.msg_ctlmax,
159 .maxlen = sizeof(init_ipc_ns.msg_ctlmax),
160 .mode = 0644,
161 .proc_handler = proc_ipc_dointvec_minmax,
152 },
153 {
154 .procname = "msgmax",
155 .data = &init_ipc_ns.msg_ctlmax,
156 .maxlen = sizeof(init_ipc_ns.msg_ctlmax),
157 .mode = 0644,
158 .proc_handler = proc_ipc_dointvec_minmax,
162 .extra1 = &zero,
163 .extra2 = &int_max,
159 .extra1 = SYSCTL_ZERO,
160 .extra2 = SYSCTL_INT_MAX,
164 },
165 {
166 .procname = "msgmni",
167 .data = &init_ipc_ns.msg_ctlmni,
168 .maxlen = sizeof(init_ipc_ns.msg_ctlmni),
169 .mode = 0644,
170 .proc_handler = proc_ipc_dointvec_minmax,
161 },
162 {
163 .procname = "msgmni",
164 .data = &init_ipc_ns.msg_ctlmni,
165 .maxlen = sizeof(init_ipc_ns.msg_ctlmni),
166 .mode = 0644,
167 .proc_handler = proc_ipc_dointvec_minmax,
171 .extra1 = &zero,
168 .extra1 = SYSCTL_ZERO,
172 .extra2 = &ipc_mni,
173 },
174 {
175 .procname = "auto_msgmni",
176 .data = NULL,
177 .maxlen = sizeof(int),
178 .mode = 0644,
179 .proc_handler = proc_ipc_auto_msgmni,
169 .extra2 = &ipc_mni,
170 },
171 {
172 .procname = "auto_msgmni",
173 .data = NULL,
174 .maxlen = sizeof(int),
175 .mode = 0644,
176 .proc_handler = proc_ipc_auto_msgmni,
180 .extra1 = &zero,
181 .extra2 = &one,
177 .extra1 = SYSCTL_ZERO,
178 .extra2 = SYSCTL_ONE,
182 },
183 {
184 .procname = "msgmnb",
185 .data = &init_ipc_ns.msg_ctlmnb,
186 .maxlen = sizeof(init_ipc_ns.msg_ctlmnb),
187 .mode = 0644,
188 .proc_handler = proc_ipc_dointvec_minmax,
179 },
180 {
181 .procname = "msgmnb",
182 .data = &init_ipc_ns.msg_ctlmnb,
183 .maxlen = sizeof(init_ipc_ns.msg_ctlmnb),
184 .mode = 0644,
185 .proc_handler = proc_ipc_dointvec_minmax,
189 .extra1 = &zero,
190 .extra2 = &int_max,
186 .extra1 = SYSCTL_ZERO,
187 .extra2 = SYSCTL_INT_MAX,
191 },
192 {
193 .procname = "sem",
194 .data = &init_ipc_ns.sem_ctls,
195 .maxlen = 4*sizeof(int),
196 .mode = 0644,
197 .proc_handler = proc_ipc_sem_dointvec,
198 },
199#ifdef CONFIG_CHECKPOINT_RESTORE
200 {
201 .procname = "sem_next_id",
202 .data = &init_ipc_ns.ids[IPC_SEM_IDS].next_id,
203 .maxlen = sizeof(init_ipc_ns.ids[IPC_SEM_IDS].next_id),
204 .mode = 0644,
205 .proc_handler = proc_ipc_dointvec_minmax,
188 },
189 {
190 .procname = "sem",
191 .data = &init_ipc_ns.sem_ctls,
192 .maxlen = 4*sizeof(int),
193 .mode = 0644,
194 .proc_handler = proc_ipc_sem_dointvec,
195 },
196#ifdef CONFIG_CHECKPOINT_RESTORE
197 {
198 .procname = "sem_next_id",
199 .data = &init_ipc_ns.ids[IPC_SEM_IDS].next_id,
200 .maxlen = sizeof(init_ipc_ns.ids[IPC_SEM_IDS].next_id),
201 .mode = 0644,
202 .proc_handler = proc_ipc_dointvec_minmax,
206 .extra1 = &zero,
207 .extra2 = &int_max,
203 .extra1 = SYSCTL_ZERO,
204 .extra2 = SYSCTL_INT_MAX,
208 },
209 {
210 .procname = "msg_next_id",
211 .data = &init_ipc_ns.ids[IPC_MSG_IDS].next_id,
212 .maxlen = sizeof(init_ipc_ns.ids[IPC_MSG_IDS].next_id),
213 .mode = 0644,
214 .proc_handler = proc_ipc_dointvec_minmax,
205 },
206 {
207 .procname = "msg_next_id",
208 .data = &init_ipc_ns.ids[IPC_MSG_IDS].next_id,
209 .maxlen = sizeof(init_ipc_ns.ids[IPC_MSG_IDS].next_id),
210 .mode = 0644,
211 .proc_handler = proc_ipc_dointvec_minmax,
215 .extra1 = &zero,
216 .extra2 = &int_max,
212 .extra1 = SYSCTL_ZERO,
213 .extra2 = SYSCTL_INT_MAX,
217 },
218 {
219 .procname = "shm_next_id",
220 .data = &init_ipc_ns.ids[IPC_SHM_IDS].next_id,
221 .maxlen = sizeof(init_ipc_ns.ids[IPC_SHM_IDS].next_id),
222 .mode = 0644,
223 .proc_handler = proc_ipc_dointvec_minmax,
214 },
215 {
216 .procname = "shm_next_id",
217 .data = &init_ipc_ns.ids[IPC_SHM_IDS].next_id,
218 .maxlen = sizeof(init_ipc_ns.ids[IPC_SHM_IDS].next_id),
219 .mode = 0644,
220 .proc_handler = proc_ipc_dointvec_minmax,
224 .extra1 = &zero,
225 .extra2 = &int_max,
221 .extra1 = SYSCTL_ZERO,
222 .extra2 = SYSCTL_INT_MAX,
226 },
227#endif
228 {}
229};
230
231static struct ctl_table ipc_root_table[] = {
232 {
233 .procname = "kernel",

--- 23 unchanged lines hidden ---
223 },
224#endif
225 {}
226};
227
228static struct ctl_table ipc_root_table[] = {
229 {
230 .procname = "kernel",

--- 23 unchanged lines hidden ---