Lines Matching +full:write +full:- +full:data
1 // SPDX-License-Identifier: GPL-2.0-only
27 const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 };
42 * enum sysctl_writes_mode - supported sysctl write modes
44 * @SYSCTL_WRITES_LEGACY: each write syscall must fully contain the sysctl value
52 * sent to the write syscall. If dealing with strings respect the file
57 * These write modes control how current file position affects the behavior of
58 * updating sysctl values through the proc interface on each write.
61 SYSCTL_WRITES_LEGACY = -1,
76 static int _proc_do_string(char *data, int maxlen, int write, in _proc_do_string() argument
82 if (!data || !maxlen || !*lenp) { in _proc_do_string()
87 if (write) { in _proc_do_string()
90 len = strlen(data); in _proc_do_string()
91 if (len > maxlen - 1) in _proc_do_string()
92 len = maxlen - 1; in _proc_do_string()
104 while ((p - buffer) < *lenp && len < maxlen - 1) { in _proc_do_string()
108 data[len++] = c; in _proc_do_string()
110 data[len] = 0; in _proc_do_string()
112 len = strlen(data); in _proc_do_string()
121 data += *ppos; in _proc_do_string()
122 len -= *ppos; in _proc_do_string()
127 memcpy(buffer, data, len); in _proc_do_string()
142 "warning, set kernel.sysctl_writes_strict = -1\n", in warn_sysctl_write()
143 current->comm, table->procname); in warn_sysctl_write()
147 * proc_first_pos_non_zero_ignore - check if first position is allowed
151 * Returns true if the first position is non-zero and the sysctl_writes_strict
173 * proc_dostring - read a string sysctl
175 * @write: %TRUE if this is a write to the sysctl file
182 * string is truncated. The copied string is %NULL-terminated.
189 int proc_dostring(const struct ctl_table *table, int write, in proc_dostring() argument
192 if (write) in proc_dostring()
195 return _proc_do_string(table->data, table->maxlen, write, buffer, lenp, in proc_dostring()
204 (*size)--; in proc_skip_spaces()
214 (*size)--; in proc_skip_char()
220 * strtoul_lenient - parse an ASCII formatted integer from a buffer and only
243 return -ERANGE; in strtoul_lenient()
256 * proc_get_long - reads an ASCII formatted integer from a user buffer
267 * the amount of bytes read. If @tr is non-NULL and a trailing
268 * character exists (size is non-zero after returning from this
279 return -EINVAL; in proc_get_long()
281 if (len > TMPBUFLEN - 1) in proc_get_long()
282 len = TMPBUFLEN - 1; in proc_get_long()
288 if (*p == '-' && *size > 1) { in proc_get_long()
294 return -EINVAL; in proc_get_long()
297 return -EINVAL; in proc_get_long()
299 len = p - tmp; in proc_get_long()
304 if (len == TMPBUFLEN - 1) in proc_get_long()
305 return -EINVAL; in proc_get_long()
308 return -EINVAL; in proc_get_long()
314 *size -= len; in proc_get_long()
320 * proc_put_long - converts an integer to a decimal ASCII formatted string
335 sprintf(p, "%s%lu", neg ? "-" : "", val); in proc_put_long()
340 *size -= len; in proc_put_long()
351 (*size)--; in proc_put_char()
359 int write, void *data) in do_proc_dointvec_conv() argument
361 if (write) { in do_proc_dointvec_conv()
364 return -EINVAL; in do_proc_dointvec_conv()
365 WRITE_ONCE(*valp, -*lvalp); in do_proc_dointvec_conv()
368 return -EINVAL; in do_proc_dointvec_conv()
375 *lvalp = -(unsigned long)val; in do_proc_dointvec_conv()
386 int write, void *data) in do_proc_douintvec_conv() argument
388 if (write) { in do_proc_douintvec_conv()
390 return -EINVAL; in do_proc_douintvec_conv()
402 int write, void *buffer, in __do_proc_dointvec() argument
405 int write, void *data), in __do_proc_dointvec() argument
406 void *data) in __do_proc_dointvec()
412 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_dointvec()
418 vleft = table->maxlen / sizeof(*i); in __do_proc_dointvec()
424 if (write) { in __do_proc_dointvec()
428 if (left > PAGE_SIZE - 1) in __do_proc_dointvec()
429 left = PAGE_SIZE - 1; in __do_proc_dointvec()
433 for (; left && vleft--; i++, first=0) { in __do_proc_dointvec()
437 if (write) { in __do_proc_dointvec()
447 if (conv(&neg, &lval, i, 1, data)) { in __do_proc_dointvec()
448 err = -EINVAL; in __do_proc_dointvec()
452 if (conv(&neg, &lval, i, 0, data)) { in __do_proc_dointvec()
453 err = -EINVAL; in __do_proc_dointvec()
462 if (!write && !first && left && !err) in __do_proc_dointvec()
464 if (write && !err && left) in __do_proc_dointvec()
466 if (write && first) in __do_proc_dointvec()
467 return err ? : -EINVAL; in __do_proc_dointvec()
468 *lenp -= left; in __do_proc_dointvec()
474 static int do_proc_dointvec(const struct ctl_table *table, int write, in do_proc_dointvec() argument
477 int write, void *data), in do_proc_dointvec() argument
478 void *data) in do_proc_dointvec()
480 return __do_proc_dointvec(table->data, table, write, in do_proc_dointvec()
481 buffer, lenp, ppos, conv, data); in do_proc_dointvec()
490 int write, void *data), in do_proc_douintvec_w() argument
491 void *data) in do_proc_douintvec_w()
504 if (left > PAGE_SIZE - 1) in do_proc_douintvec_w()
505 left = PAGE_SIZE - 1; in do_proc_douintvec_w()
509 err = -EINVAL; in do_proc_douintvec_w()
517 err = -EINVAL; in do_proc_douintvec_w()
521 if (conv(&lval, tbl_data, 1, data)) { in do_proc_douintvec_w()
522 err = -EINVAL; in do_proc_douintvec_w()
531 return -EINVAL; in do_proc_douintvec_w()
545 int write, void *data), in do_proc_douintvec_r() argument
546 void *data) in do_proc_douintvec_r()
554 if (conv(&lval, tbl_data, 0, data)) { in do_proc_douintvec_r()
555 err = -EINVAL; in do_proc_douintvec_r()
566 *lenp -= left; in do_proc_douintvec_r()
573 int write, void *buffer, in __do_proc_douintvec() argument
577 int write, void *data), in __do_proc_douintvec() argument
578 void *data) in __do_proc_douintvec()
582 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_douintvec()
588 vleft = table->maxlen / sizeof(*i); in __do_proc_douintvec()
596 return -EINVAL; in __do_proc_douintvec()
602 if (write) in __do_proc_douintvec()
604 conv, data); in __do_proc_douintvec()
605 return do_proc_douintvec_r(i, buffer, lenp, ppos, conv, data); in __do_proc_douintvec()
608 int do_proc_douintvec(const struct ctl_table *table, int write, in do_proc_douintvec() argument
612 int write, void *data), in do_proc_douintvec() argument
613 void *data) in do_proc_douintvec()
615 return __do_proc_douintvec(table->data, table, write, in do_proc_douintvec()
616 buffer, lenp, ppos, conv, data); in do_proc_douintvec()
620 * proc_dobool - read/write a bool
622 * @write: %TRUE if this is a write to the sysctl file
630 * table->data must point to a bool variable and table->maxlen must
635 int proc_dobool(const struct ctl_table *table, int write, void *buffer, in proc_dobool() argument
639 bool *data = table->data; in proc_dobool() local
643 if (table->maxlen != sizeof(bool)) in proc_dobool()
644 return -EINVAL; in proc_dobool()
648 tmp.data = &val; in proc_dobool()
650 val = READ_ONCE(*data); in proc_dobool()
651 res = proc_dointvec(&tmp, write, buffer, lenp, ppos); in proc_dobool()
654 if (write) in proc_dobool()
655 WRITE_ONCE(*data, val); in proc_dobool()
660 * proc_dointvec - read a vector of integers
662 * @write: %TRUE if this is a write to the sysctl file
667 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
672 int proc_dointvec(const struct ctl_table *table, int write, void *buffer, in proc_dointvec() argument
675 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL); in proc_dointvec()
679 * proc_douintvec - read a vector of unsigned integers
681 * @write: %TRUE if this is a write to the sysctl file
686 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
691 int proc_douintvec(const struct ctl_table *table, int write, void *buffer, in proc_douintvec() argument
694 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec()
699 * struct do_proc_dointvec_minmax_conv_param - proc_dointvec_minmax() range checking structure
714 int write, void *data) in do_proc_dointvec_minmax_conv() argument
717 struct do_proc_dointvec_minmax_conv_param *param = data; in do_proc_dointvec_minmax_conv()
720 * bounds-check it before touching *valp. in do_proc_dointvec_minmax_conv()
722 int *ip = write ? &tmp : valp; in do_proc_dointvec_minmax_conv()
724 ret = do_proc_dointvec_conv(negp, lvalp, ip, write, data); in do_proc_dointvec_minmax_conv()
728 if (write) { in do_proc_dointvec_minmax_conv()
729 if ((param->min && *param->min > tmp) || in do_proc_dointvec_minmax_conv()
730 (param->max && *param->max < tmp)) in do_proc_dointvec_minmax_conv()
731 return -EINVAL; in do_proc_dointvec_minmax_conv()
739 * proc_dointvec_minmax - read a vector of integers with min/max values
741 * @write: %TRUE if this is a write to the sysctl file
746 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
750 * table->extra1 (min) and table->extra2 (max).
752 * Returns 0 on success or -EINVAL on write when the range check fails.
754 int proc_dointvec_minmax(const struct ctl_table *table, int write, in proc_dointvec_minmax() argument
758 .min = (int *) table->extra1, in proc_dointvec_minmax()
759 .max = (int *) table->extra2, in proc_dointvec_minmax()
761 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_minmax()
766 * struct do_proc_douintvec_minmax_conv_param - proc_douintvec_minmax() range checking structure
781 int write, void *data) in do_proc_douintvec_minmax_conv() argument
785 struct do_proc_douintvec_minmax_conv_param *param = data; in do_proc_douintvec_minmax_conv()
786 /* write via temporary local uint for bounds-checking */ in do_proc_douintvec_minmax_conv()
787 unsigned int *up = write ? &tmp : valp; in do_proc_douintvec_minmax_conv()
789 ret = do_proc_douintvec_conv(lvalp, up, write, data); in do_proc_douintvec_minmax_conv()
793 if (write) { in do_proc_douintvec_minmax_conv()
794 if ((param->min && *param->min > tmp) || in do_proc_douintvec_minmax_conv()
795 (param->max && *param->max < tmp)) in do_proc_douintvec_minmax_conv()
796 return -ERANGE; in do_proc_douintvec_minmax_conv()
805 * proc_douintvec_minmax - read a vector of unsigned ints with min/max values
807 * @write: %TRUE if this is a write to the sysctl file
812 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
817 * table->extra1 (min) and table->extra2 (max). There is a final sanity
821 * Returns 0 on success or -ERANGE on write when the range check fails.
823 int proc_douintvec_minmax(const struct ctl_table *table, int write, in proc_douintvec_minmax() argument
827 .min = (unsigned int *) table->extra1, in proc_douintvec_minmax()
828 .max = (unsigned int *) table->extra2, in proc_douintvec_minmax()
830 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec_minmax()
835 * proc_dou8vec_minmax - read a vector of unsigned chars with min/max values
837 * @write: %TRUE if this is a write to the sysctl file
842 * Reads/writes up to table->maxlen/sizeof(u8) unsigned chars
847 * table->extra1 (min) and table->extra2 (max).
849 * Returns 0 on success or an error on write when the range check fails.
851 int proc_dou8vec_minmax(const struct ctl_table *table, int write, in proc_dou8vec_minmax() argument
856 u8 *data = table->data; in proc_dou8vec_minmax() local
864 if (table->maxlen != sizeof(u8)) in proc_dou8vec_minmax()
865 return -EINVAL; in proc_dou8vec_minmax()
867 if (table->extra1) in proc_dou8vec_minmax()
868 min = *(unsigned int *) table->extra1; in proc_dou8vec_minmax()
869 if (table->extra2) in proc_dou8vec_minmax()
870 max = *(unsigned int *) table->extra2; in proc_dou8vec_minmax()
875 tmp.data = &val; in proc_dou8vec_minmax()
876 val = READ_ONCE(*data); in proc_dou8vec_minmax()
877 res = do_proc_douintvec(&tmp, write, buffer, lenp, ppos, in proc_dou8vec_minmax()
881 if (write) in proc_dou8vec_minmax()
882 WRITE_ONCE(*data, val); in proc_dou8vec_minmax()
887 static int __do_proc_doulongvec_minmax(void *data, in __do_proc_doulongvec_minmax() argument
888 const struct ctl_table *table, int write, in __do_proc_doulongvec_minmax() argument
897 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_doulongvec_minmax()
902 i = data; in __do_proc_doulongvec_minmax()
903 min = table->extra1; in __do_proc_doulongvec_minmax()
904 max = table->extra2; in __do_proc_doulongvec_minmax()
905 vleft = table->maxlen / sizeof(unsigned long); in __do_proc_doulongvec_minmax()
908 if (write) { in __do_proc_doulongvec_minmax()
912 if (left > PAGE_SIZE - 1) in __do_proc_doulongvec_minmax()
913 left = PAGE_SIZE - 1; in __do_proc_doulongvec_minmax()
917 for (; left && vleft--; i++, first = 0) { in __do_proc_doulongvec_minmax()
920 if (write) { in __do_proc_doulongvec_minmax()
931 err = -EINVAL; in __do_proc_doulongvec_minmax()
937 err = -EINVAL; in __do_proc_doulongvec_minmax()
949 if (!write && !first && left && !err) in __do_proc_doulongvec_minmax()
951 if (write && !err) in __do_proc_doulongvec_minmax()
953 if (write && first) in __do_proc_doulongvec_minmax()
954 return err ? : -EINVAL; in __do_proc_doulongvec_minmax()
955 *lenp -= left; in __do_proc_doulongvec_minmax()
961 static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write, in do_proc_doulongvec_minmax() argument
965 return __do_proc_doulongvec_minmax(table->data, table, write, in do_proc_doulongvec_minmax()
970 * proc_doulongvec_minmax - read a vector of long integers with min/max values
972 * @write: %TRUE if this is a write to the sysctl file
977 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
981 * table->extra1 (min) and table->extra2 (max).
985 int proc_doulongvec_minmax(const struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
988 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); in proc_doulongvec_minmax()
992 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
994 * @write: %TRUE if this is a write to the sysctl file
999 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
1004 * table->extra1 (min) and table->extra2 (max).
1008 int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1011 return do_proc_doulongvec_minmax(table, write, buffer, in proc_doulongvec_ms_jiffies_minmax()
1018 int write, void *data) in do_proc_dointvec_jiffies_conv() argument
1020 if (write) { in do_proc_dointvec_jiffies_conv()
1024 WRITE_ONCE(*valp, -*lvalp * HZ); in do_proc_dointvec_jiffies_conv()
1032 lval = -(unsigned long)val; in do_proc_dointvec_jiffies_conv()
1044 int write, void *data) in do_proc_dointvec_userhz_jiffies_conv() argument
1046 if (write) { in do_proc_dointvec_userhz_jiffies_conv()
1049 *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp); in do_proc_dointvec_userhz_jiffies_conv()
1055 lval = -(unsigned long)val; in do_proc_dointvec_userhz_jiffies_conv()
1067 int write, void *data) in do_proc_dointvec_ms_jiffies_conv() argument
1069 if (write) { in do_proc_dointvec_ms_jiffies_conv()
1070 unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); in do_proc_dointvec_ms_jiffies_conv()
1080 lval = -(unsigned long)val; in do_proc_dointvec_ms_jiffies_conv()
1091 int *valp, int write, void *data) in do_proc_dointvec_ms_jiffies_minmax_conv() argument
1094 struct do_proc_dointvec_minmax_conv_param *param = data; in do_proc_dointvec_ms_jiffies_minmax_conv()
1097 * bounds-check it before touching *valp. in do_proc_dointvec_ms_jiffies_minmax_conv()
1099 int *ip = write ? &tmp : valp; in do_proc_dointvec_ms_jiffies_minmax_conv()
1101 ret = do_proc_dointvec_ms_jiffies_conv(negp, lvalp, ip, write, data); in do_proc_dointvec_ms_jiffies_minmax_conv()
1105 if (write) { in do_proc_dointvec_ms_jiffies_minmax_conv()
1106 if ((param->min && *param->min > tmp) || in do_proc_dointvec_ms_jiffies_minmax_conv()
1107 (param->max && *param->max < tmp)) in do_proc_dointvec_ms_jiffies_minmax_conv()
1108 return -EINVAL; in do_proc_dointvec_ms_jiffies_minmax_conv()
1115 * proc_dointvec_jiffies - read a vector of integers as seconds
1117 * @write: %TRUE if this is a write to the sysctl file
1122 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1129 int proc_dointvec_jiffies(const struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1132 return do_proc_dointvec(table,write,buffer,lenp,ppos, in proc_dointvec_jiffies()
1136 int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies_minmax() argument
1140 .min = (int *) table->extra1, in proc_dointvec_ms_jiffies_minmax()
1141 .max = (int *) table->extra2, in proc_dointvec_ms_jiffies_minmax()
1143 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_ms_jiffies_minmax()
1148 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
1150 * @write: %TRUE if this is a write to the sysctl file
1155 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1162 int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1165 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_userhz_jiffies()
1170 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
1172 * @write: %TRUE if this is a write to the sysctl file
1177 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1184 int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, void *buffer, in proc_dointvec_ms_jiffies() argument
1187 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_ms_jiffies()
1192 * proc_do_large_bitmap - read/write from/to a large bitmap
1194 * @write: %TRUE if this is a write to the sysctl file
1199 * The bitmap is stored at table->data and the bitmap length (in bits)
1200 * in table->maxlen.
1202 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
1208 int proc_do_large_bitmap(const struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1213 unsigned long bitmap_len = table->maxlen; in proc_do_large_bitmap()
1214 unsigned long *bitmap = *(unsigned long **) table->data; in proc_do_large_bitmap()
1216 char tr_a[] = { '-', ',', '\n' }, tr_b[] = { ',', '\n', 0 }, c; in proc_do_large_bitmap()
1218 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) { in proc_do_large_bitmap()
1223 if (write) { in proc_do_large_bitmap()
1227 if (left > PAGE_SIZE - 1) { in proc_do_large_bitmap()
1228 left = PAGE_SIZE - 1; in proc_do_large_bitmap()
1230 skipped = *lenp - left; in proc_do_large_bitmap()
1235 return -ENOMEM; in proc_do_large_bitmap()
1242 /* In case we stop parsing mid-number, we can reset */ in proc_do_large_bitmap()
1248 * only one char is left (may be a "-"), then stop here, in proc_do_large_bitmap()
1259 err = -EINVAL; in proc_do_large_bitmap()
1266 left--; in proc_do_large_bitmap()
1269 if (c == '-') { in proc_do_large_bitmap()
1286 err = -EINVAL; in proc_do_large_bitmap()
1291 left--; in proc_do_large_bitmap()
1295 bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1); in proc_do_large_bitmap()
1308 bit_a + 1) - 1; in proc_do_large_bitmap()
1314 proc_put_char(&buffer, &left, '-'); in proc_do_large_bitmap()
1324 if (write) { in proc_do_large_bitmap()
1330 *lenp -= left; in proc_do_large_bitmap()
1340 int proc_dostring(const struct ctl_table *table, int write, in proc_dostring() argument
1343 return -ENOSYS; in proc_dostring()
1346 int proc_dobool(const struct ctl_table *table, int write, in proc_dobool() argument
1349 return -ENOSYS; in proc_dobool()
1352 int proc_dointvec(const struct ctl_table *table, int write, in proc_dointvec() argument
1355 return -ENOSYS; in proc_dointvec()
1358 int proc_douintvec(const struct ctl_table *table, int write, in proc_douintvec() argument
1361 return -ENOSYS; in proc_douintvec()
1364 int proc_dointvec_minmax(const struct ctl_table *table, int write, in proc_dointvec_minmax() argument
1367 return -ENOSYS; in proc_dointvec_minmax()
1370 int proc_douintvec_minmax(const struct ctl_table *table, int write, in proc_douintvec_minmax() argument
1373 return -ENOSYS; in proc_douintvec_minmax()
1376 int proc_dou8vec_minmax(const struct ctl_table *table, int write, in proc_dou8vec_minmax() argument
1379 return -ENOSYS; in proc_dou8vec_minmax()
1382 int proc_dointvec_jiffies(const struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1385 return -ENOSYS; in proc_dointvec_jiffies()
1388 int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies_minmax() argument
1391 return -ENOSYS; in proc_dointvec_ms_jiffies_minmax()
1394 int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1397 return -ENOSYS; in proc_dointvec_userhz_jiffies()
1400 int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, in proc_dointvec_ms_jiffies() argument
1403 return -ENOSYS; in proc_dointvec_ms_jiffies()
1406 int proc_doulongvec_minmax(const struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1409 return -ENOSYS; in proc_doulongvec_minmax()
1412 int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1415 return -ENOSYS; in proc_doulongvec_ms_jiffies_minmax()
1418 int proc_do_large_bitmap(const struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1421 return -ENOSYS; in proc_do_large_bitmap()
1427 int proc_do_static_key(const struct ctl_table *table, int write, in proc_do_static_key() argument
1430 struct static_key *key = (struct static_key *)table->data; in proc_do_static_key()
1434 .data = &val, in proc_do_static_key()
1436 .mode = table->mode, in proc_do_static_key()
1441 if (write && !capable(CAP_SYS_ADMIN)) in proc_do_static_key()
1442 return -EPERM; in proc_do_static_key()
1446 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); in proc_do_static_key()
1447 if (write && !ret) { in proc_do_static_key()
1461 .data = &sysctl_writes_strict,
1471 .data = (void *)&ngroups_max,
1478 .data = (void *)&cap_last_cap,
1485 .procname = "unaligned-trap",
1486 .data = &unaligned_enabled,
1494 .procname = "ignore-unaligned-usertrap",
1495 .data = &no_unaligned_warning,
1512 * exception granted :-)