diff options
| -rw-r--r-- | include/linux/ipc_namespace.h | 6 | ||||
| -rw-r--r-- | ipc/ipc_sysctl.c | 20 |
2 files changed, 15 insertions, 11 deletions
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 19c19a5eee29..f6c82de12541 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
| @@ -34,9 +34,9 @@ struct ipc_namespace { | |||
| 34 | int sem_ctls[4]; | 34 | int sem_ctls[4]; |
| 35 | int used_sems; | 35 | int used_sems; |
| 36 | 36 | ||
| 37 | int msg_ctlmax; | 37 | unsigned int msg_ctlmax; |
| 38 | int msg_ctlmnb; | 38 | unsigned int msg_ctlmnb; |
| 39 | int msg_ctlmni; | 39 | unsigned int msg_ctlmni; |
| 40 | atomic_t msg_bytes; | 40 | atomic_t msg_bytes; |
| 41 | atomic_t msg_hdrs; | 41 | atomic_t msg_hdrs; |
| 42 | int auto_msgmni; | 42 | int auto_msgmni; |
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c index 130dfece27ac..b0e99deb6d05 100644 --- a/ipc/ipc_sysctl.c +++ b/ipc/ipc_sysctl.c | |||
| @@ -62,7 +62,7 @@ static int proc_ipc_dointvec_minmax_orphans(ctl_table *table, int write, | |||
| 62 | return err; | 62 | return err; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | static int proc_ipc_callback_dointvec(ctl_table *table, int write, | 65 | static int proc_ipc_callback_dointvec_minmax(ctl_table *table, int write, |
| 66 | void __user *buffer, size_t *lenp, loff_t *ppos) | 66 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 67 | { | 67 | { |
| 68 | struct ctl_table ipc_table; | 68 | struct ctl_table ipc_table; |
| @@ -72,7 +72,7 @@ static int proc_ipc_callback_dointvec(ctl_table *table, int write, | |||
| 72 | memcpy(&ipc_table, table, sizeof(ipc_table)); | 72 | memcpy(&ipc_table, table, sizeof(ipc_table)); |
| 73 | ipc_table.data = get_ipc(table); | 73 | ipc_table.data = get_ipc(table); |
| 74 | 74 | ||
| 75 | rc = proc_dointvec(&ipc_table, write, buffer, lenp, ppos); | 75 | rc = proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos); |
| 76 | 76 | ||
| 77 | if (write && !rc && lenp_bef == *lenp) | 77 | if (write && !rc && lenp_bef == *lenp) |
| 78 | /* | 78 | /* |
| @@ -152,15 +152,13 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, | |||
| 152 | #define proc_ipc_dointvec NULL | 152 | #define proc_ipc_dointvec NULL |
| 153 | #define proc_ipc_dointvec_minmax NULL | 153 | #define proc_ipc_dointvec_minmax NULL |
| 154 | #define proc_ipc_dointvec_minmax_orphans NULL | 154 | #define proc_ipc_dointvec_minmax_orphans NULL |
| 155 | #define proc_ipc_callback_dointvec NULL | 155 | #define proc_ipc_callback_dointvec_minmax NULL |
| 156 | #define proc_ipcauto_dointvec_minmax NULL | 156 | #define proc_ipcauto_dointvec_minmax NULL |
| 157 | #endif | 157 | #endif |
| 158 | 158 | ||
| 159 | static int zero; | 159 | static int zero; |
| 160 | static int one = 1; | 160 | static int one = 1; |
| 161 | #ifdef CONFIG_CHECKPOINT_RESTORE | ||
| 162 | static int int_max = INT_MAX; | 161 | static int int_max = INT_MAX; |
| 163 | #endif | ||
| 164 | 162 | ||
| 165 | static struct ctl_table ipc_kern_table[] = { | 163 | static struct ctl_table ipc_kern_table[] = { |
| 166 | { | 164 | { |
| @@ -198,21 +196,27 @@ static struct ctl_table ipc_kern_table[] = { | |||
| 198 | .data = &init_ipc_ns.msg_ctlmax, | 196 | .data = &init_ipc_ns.msg_ctlmax, |
| 199 | .maxlen = sizeof (init_ipc_ns.msg_ctlmax), | 197 | .maxlen = sizeof (init_ipc_ns.msg_ctlmax), |
| 200 | .mode = 0644, | 198 | .mode = 0644, |
| 201 | .proc_handler = proc_ipc_dointvec, | 199 | .proc_handler = proc_ipc_dointvec_minmax, |
| 200 | .extra1 = &zero, | ||
| 201 | .extra2 = &int_max, | ||
| 202 | }, | 202 | }, |
| 203 | { | 203 | { |
| 204 | .procname = "msgmni", | 204 | .procname = "msgmni", |
| 205 | .data = &init_ipc_ns.msg_ctlmni, | 205 | .data = &init_ipc_ns.msg_ctlmni, |
| 206 | .maxlen = sizeof (init_ipc_ns.msg_ctlmni), | 206 | .maxlen = sizeof (init_ipc_ns.msg_ctlmni), |
| 207 | .mode = 0644, | 207 | .mode = 0644, |
| 208 | .proc_handler = proc_ipc_callback_dointvec, | 208 | .proc_handler = proc_ipc_callback_dointvec_minmax, |
| 209 | .extra1 = &zero, | ||
| 210 | .extra2 = &int_max, | ||
| 209 | }, | 211 | }, |
| 210 | { | 212 | { |
| 211 | .procname = "msgmnb", | 213 | .procname = "msgmnb", |
| 212 | .data = &init_ipc_ns.msg_ctlmnb, | 214 | .data = &init_ipc_ns.msg_ctlmnb, |
| 213 | .maxlen = sizeof (init_ipc_ns.msg_ctlmnb), | 215 | .maxlen = sizeof (init_ipc_ns.msg_ctlmnb), |
| 214 | .mode = 0644, | 216 | .mode = 0644, |
| 215 | .proc_handler = proc_ipc_dointvec, | 217 | .proc_handler = proc_ipc_dointvec_minmax, |
| 218 | .extra1 = &zero, | ||
| 219 | .extra2 = &int_max, | ||
| 216 | }, | 220 | }, |
| 217 | { | 221 | { |
| 218 | .procname = "sem", | 222 | .procname = "sem", |
