• Home
  • Raw
  • Download

Lines Matching +full:write +full:- +full:data

1 // SPDX-License-Identifier: GPL-2.0-only
9 * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver.
11 * Added kswapd-interval, ctrl-alt-del, printk stuff, 1/8/97, Chris Horn.
149 * enum sysctl_writes_mode - supported sysctl write modes
151 * @SYSCTL_WRITES_LEGACY: each write syscall must fully contain the sysctl value
159 * sent to the write syscall. If dealing with strings respect the file
164 * These write modes control how current file position affects the behavior of
165 * updating sysctl values through the proc interface on each write.
168 SYSCTL_WRITES_LEGACY = -1,
188 static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
200 static int bpf_stats_handler(struct ctl_table *table, int write, in bpf_stats_handler() argument
203 struct static_key *key = (struct static_key *)table->data; in bpf_stats_handler()
207 .data = &val, in bpf_stats_handler()
209 .mode = table->mode, in bpf_stats_handler()
214 if (write && !capable(CAP_SYS_ADMIN)) in bpf_stats_handler()
215 return -EPERM; in bpf_stats_handler()
219 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); in bpf_stats_handler()
220 if (write && !ret && val != saved_val) { in bpf_stats_handler()
235 static int bpf_unpriv_handler(struct ctl_table *table, int write, in bpf_unpriv_handler() argument
238 int ret, unpriv_enable = *(int *)table->data; in bpf_unpriv_handler()
242 if (write && !capable(CAP_SYS_ADMIN)) in bpf_unpriv_handler()
243 return -EPERM; in bpf_unpriv_handler()
245 tmp.data = &unpriv_enable; in bpf_unpriv_handler()
246 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); in bpf_unpriv_handler()
247 if (write && !ret) { in bpf_unpriv_handler()
249 return -EPERM; in bpf_unpriv_handler()
250 *(int *)table->data = unpriv_enable; in bpf_unpriv_handler()
265 static int _proc_do_string(char *data, int maxlen, int write, in _proc_do_string() argument
271 if (!data || !maxlen || !*lenp) { in _proc_do_string()
276 if (write) { in _proc_do_string()
279 len = strlen(data); in _proc_do_string()
280 if (len > maxlen - 1) in _proc_do_string()
281 len = maxlen - 1; in _proc_do_string()
293 while ((p - buffer) < *lenp && len < maxlen - 1) { in _proc_do_string()
297 data[len++] = c; in _proc_do_string()
299 data[len] = 0; in _proc_do_string()
301 len = strlen(data); in _proc_do_string()
310 data += *ppos; in _proc_do_string()
311 len -= *ppos; in _proc_do_string()
316 memcpy(buffer, data, len); in _proc_do_string()
331 "warning, set kernel.sysctl_writes_strict = -1\n", in warn_sysctl_write()
332 current->comm, table->procname); in warn_sysctl_write()
336 * proc_first_pos_non_zero_ignore - check if first position is allowed
340 * Returns true if the first position is non-zero and the sysctl_writes_strict
362 * proc_dostring - read a string sysctl
364 * @write: %TRUE if this is a write to the sysctl file
371 * string is truncated. The copied string is %NULL-terminated.
378 int proc_dostring(struct ctl_table *table, int write, in proc_dostring() argument
381 if (write) in proc_dostring()
384 return _proc_do_string(table->data, table->maxlen, write, buffer, lenp, in proc_dostring()
393 (*size)--; in proc_skip_spaces()
403 (*size)--; in proc_skip_char()
409 * strtoul_lenient - parse an ASCII formatted integer from a buffer and only
432 return -ERANGE; in strtoul_lenient()
445 * proc_get_long - reads an ASCII formatted integer from a user buffer
456 * the amount of bytes read. If @tr is non-NULL and a trailing
457 * character exists (size is non-zero after returning from this
468 return -EINVAL; in proc_get_long()
470 if (len > TMPBUFLEN - 1) in proc_get_long()
471 len = TMPBUFLEN - 1; in proc_get_long()
477 if (*p == '-' && *size > 1) { in proc_get_long()
483 return -EINVAL; in proc_get_long()
486 return -EINVAL; in proc_get_long()
488 len = p - tmp; in proc_get_long()
493 if (len == TMPBUFLEN - 1) in proc_get_long()
494 return -EINVAL; in proc_get_long()
497 return -EINVAL; in proc_get_long()
503 *size -= len; in proc_get_long()
509 * proc_put_long - converts an integer to a decimal ASCII formatted string
524 sprintf(p, "%s%lu", neg ? "-" : "", val); in proc_put_long()
529 *size -= len; in proc_put_long()
540 (*size)--; in proc_put_char()
548 int write, void *data) in do_proc_dointvec_conv() argument
550 if (write) { in do_proc_dointvec_conv()
553 return -EINVAL; in do_proc_dointvec_conv()
554 WRITE_ONCE(*valp, -*lvalp); in do_proc_dointvec_conv()
557 return -EINVAL; in do_proc_dointvec_conv()
564 *lvalp = -(unsigned long)val; in do_proc_dointvec_conv()
575 int write, void *data) in do_proc_douintvec_conv() argument
577 if (write) { in do_proc_douintvec_conv()
579 return -EINVAL; in do_proc_douintvec_conv()
591 int write, void *buffer, in __do_proc_dointvec() argument
594 int write, void *data), in __do_proc_dointvec() argument
595 void *data) in __do_proc_dointvec()
601 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_dointvec()
607 vleft = table->maxlen / sizeof(*i); in __do_proc_dointvec()
613 if (write) { in __do_proc_dointvec()
617 if (left > PAGE_SIZE - 1) in __do_proc_dointvec()
618 left = PAGE_SIZE - 1; in __do_proc_dointvec()
622 for (; left && vleft--; i++, first=0) { in __do_proc_dointvec()
626 if (write) { in __do_proc_dointvec()
636 if (conv(&neg, &lval, i, 1, data)) { in __do_proc_dointvec()
637 err = -EINVAL; in __do_proc_dointvec()
641 if (conv(&neg, &lval, i, 0, data)) { in __do_proc_dointvec()
642 err = -EINVAL; in __do_proc_dointvec()
651 if (!write && !first && left && !err) in __do_proc_dointvec()
653 if (write && !err && left) in __do_proc_dointvec()
655 if (write && first) in __do_proc_dointvec()
656 return err ? : -EINVAL; in __do_proc_dointvec()
657 *lenp -= left; in __do_proc_dointvec()
663 static int do_proc_dointvec(struct ctl_table *table, int write, in do_proc_dointvec() argument
666 int write, void *data), in do_proc_dointvec() argument
667 void *data) in do_proc_dointvec()
669 return __do_proc_dointvec(table->data, table, write, in do_proc_dointvec()
670 buffer, lenp, ppos, conv, data); in do_proc_dointvec()
679 int write, void *data), in do_proc_douintvec_w() argument
680 void *data) in do_proc_douintvec_w()
693 if (left > PAGE_SIZE - 1) in do_proc_douintvec_w()
694 left = PAGE_SIZE - 1; in do_proc_douintvec_w()
698 err = -EINVAL; in do_proc_douintvec_w()
706 err = -EINVAL; in do_proc_douintvec_w()
710 if (conv(&lval, tbl_data, 1, data)) { in do_proc_douintvec_w()
711 err = -EINVAL; in do_proc_douintvec_w()
720 return -EINVAL; in do_proc_douintvec_w()
734 int write, void *data), in do_proc_douintvec_r() argument
735 void *data) in do_proc_douintvec_r()
743 if (conv(&lval, tbl_data, 0, data)) { in do_proc_douintvec_r()
744 err = -EINVAL; in do_proc_douintvec_r()
755 *lenp -= left; in do_proc_douintvec_r()
762 int write, void *buffer, in __do_proc_douintvec() argument
766 int write, void *data), in __do_proc_douintvec() argument
767 void *data) in __do_proc_douintvec()
771 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_douintvec()
777 vleft = table->maxlen / sizeof(*i); in __do_proc_douintvec()
785 return -EINVAL; in __do_proc_douintvec()
791 if (write) in __do_proc_douintvec()
793 conv, data); in __do_proc_douintvec()
794 return do_proc_douintvec_r(i, buffer, lenp, ppos, conv, data); in __do_proc_douintvec()
797 static int do_proc_douintvec(struct ctl_table *table, int write, in do_proc_douintvec() argument
801 int write, void *data), in do_proc_douintvec() argument
802 void *data) in do_proc_douintvec()
804 return __do_proc_douintvec(table->data, table, write, in do_proc_douintvec()
805 buffer, lenp, ppos, conv, data); in do_proc_douintvec()
809 * proc_dointvec - read a vector of integers
811 * @write: %TRUE if this is a write to the sysctl file
816 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
821 int proc_dointvec(struct ctl_table *table, int write, void *buffer, in proc_dointvec() argument
824 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL); in proc_dointvec()
829 int write, void *buffer, size_t *lenp, loff_t *ppos) in proc_dointvec_minmax_warn_RT_change() argument
833 if (!IS_ENABLED(CONFIG_PREEMPT_RT) || !write) in proc_dointvec_minmax_warn_RT_change()
834 return proc_dointvec_minmax(table, write, buffer, lenp, ppos); in proc_dointvec_minmax_warn_RT_change()
836 old = *(int *)table->data; in proc_dointvec_minmax_warn_RT_change()
837 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); in proc_dointvec_minmax_warn_RT_change()
840 if (old != *(int *)table->data) in proc_dointvec_minmax_warn_RT_change()
842 table->procname, current->comm, in proc_dointvec_minmax_warn_RT_change()
849 * proc_douintvec - read a vector of unsigned integers
851 * @write: %TRUE if this is a write to the sysctl file
856 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
861 int proc_douintvec(struct ctl_table *table, int write, void *buffer, in proc_douintvec() argument
864 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec()
872 static int proc_taint(struct ctl_table *table, int write, in proc_taint() argument
879 if (write && !capable(CAP_SYS_ADMIN)) in proc_taint()
880 return -EPERM; in proc_taint()
883 t.data = &tmptaint; in proc_taint()
884 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos); in proc_taint()
888 if (write) { in proc_taint()
897 return -EINVAL; in proc_taint()
912 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, in proc_dointvec_minmax_sysadmin() argument
915 if (write && !capable(CAP_SYS_ADMIN)) in proc_dointvec_minmax_sysadmin()
916 return -EPERM; in proc_dointvec_minmax_sysadmin()
918 return proc_dointvec_minmax(table, write, buffer, lenp, ppos); in proc_dointvec_minmax_sysadmin()
923 * struct do_proc_dointvec_minmax_conv_param - proc_dointvec_minmax() range checking structure
938 int write, void *data) in do_proc_dointvec_minmax_conv() argument
941 struct do_proc_dointvec_minmax_conv_param *param = data; in do_proc_dointvec_minmax_conv()
944 * bounds-check it before touching *valp. in do_proc_dointvec_minmax_conv()
946 int *ip = write ? &tmp : valp; in do_proc_dointvec_minmax_conv()
948 ret = do_proc_dointvec_conv(negp, lvalp, ip, write, data); in do_proc_dointvec_minmax_conv()
952 if (write) { in do_proc_dointvec_minmax_conv()
953 if ((param->min && *param->min > tmp) || in do_proc_dointvec_minmax_conv()
954 (param->max && *param->max < tmp)) in do_proc_dointvec_minmax_conv()
955 return -EINVAL; in do_proc_dointvec_minmax_conv()
963 * proc_dointvec_minmax - read a vector of integers with min/max values
965 * @write: %TRUE if this is a write to the sysctl file
970 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
974 * table->extra1 (min) and table->extra2 (max).
976 * Returns 0 on success or -EINVAL on write when the range check fails.
978 int proc_dointvec_minmax(struct ctl_table *table, int write, in proc_dointvec_minmax() argument
982 .min = (int *) table->extra1, in proc_dointvec_minmax()
983 .max = (int *) table->extra2, in proc_dointvec_minmax()
985 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_minmax()
990 * struct do_proc_douintvec_minmax_conv_param - proc_douintvec_minmax() range checking structure
1005 int write, void *data) in do_proc_douintvec_minmax_conv() argument
1009 struct do_proc_douintvec_minmax_conv_param *param = data; in do_proc_douintvec_minmax_conv()
1010 /* write via temporary local uint for bounds-checking */ in do_proc_douintvec_minmax_conv()
1011 unsigned int *up = write ? &tmp : valp; in do_proc_douintvec_minmax_conv()
1013 ret = do_proc_douintvec_conv(lvalp, up, write, data); in do_proc_douintvec_minmax_conv()
1017 if (write) { in do_proc_douintvec_minmax_conv()
1018 if ((param->min && *param->min > tmp) || in do_proc_douintvec_minmax_conv()
1019 (param->max && *param->max < tmp)) in do_proc_douintvec_minmax_conv()
1020 return -ERANGE; in do_proc_douintvec_minmax_conv()
1029 * proc_douintvec_minmax - read a vector of unsigned ints with min/max values
1031 * @write: %TRUE if this is a write to the sysctl file
1036 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
1041 * table->extra1 (min) and table->extra2 (max). There is a final sanity
1045 * Returns 0 on success or -ERANGE on write when the range check fails.
1047 int proc_douintvec_minmax(struct ctl_table *table, int write, in proc_douintvec_minmax() argument
1051 .min = (unsigned int *) table->extra1, in proc_douintvec_minmax()
1052 .max = (unsigned int *) table->extra2, in proc_douintvec_minmax()
1054 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_douintvec_minmax()
1059 * proc_dou8vec_minmax - read a vector of unsigned chars with min/max values
1061 * @write: %TRUE if this is a write to the sysctl file
1066 * Reads/writes up to table->maxlen/sizeof(u8) unsigned chars
1071 * table->extra1 (min) and table->extra2 (max).
1073 * Returns 0 on success or an error on write when the range check fails.
1075 int proc_dou8vec_minmax(struct ctl_table *table, int write, in proc_dou8vec_minmax() argument
1080 u8 *data = table->data; in proc_dou8vec_minmax() local
1088 if (table->maxlen != sizeof(u8)) in proc_dou8vec_minmax()
1089 return -EINVAL; in proc_dou8vec_minmax()
1091 if (table->extra1) { in proc_dou8vec_minmax()
1092 min = *(unsigned int *) table->extra1; in proc_dou8vec_minmax()
1094 return -EINVAL; in proc_dou8vec_minmax()
1096 if (table->extra2) { in proc_dou8vec_minmax()
1097 max = *(unsigned int *) table->extra2; in proc_dou8vec_minmax()
1099 return -EINVAL; in proc_dou8vec_minmax()
1105 tmp.data = &val; in proc_dou8vec_minmax()
1106 val = READ_ONCE(*data); in proc_dou8vec_minmax()
1107 res = do_proc_douintvec(&tmp, write, buffer, lenp, ppos, in proc_dou8vec_minmax()
1111 if (write) in proc_dou8vec_minmax()
1112 WRITE_ONCE(*data, val); in proc_dou8vec_minmax()
1119 int write, void *data) in do_proc_dopipe_max_size_conv() argument
1121 if (write) { in do_proc_dopipe_max_size_conv()
1126 return -EINVAL; in do_proc_dopipe_max_size_conv()
1137 static int proc_dopipe_max_size(struct ctl_table *table, int write, in proc_dopipe_max_size() argument
1140 return do_proc_douintvec(table, write, buffer, lenp, ppos, in proc_dopipe_max_size()
1158 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, in proc_dointvec_minmax_coredump() argument
1161 int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos); in proc_dointvec_minmax_coredump()
1168 static int proc_dostring_coredump(struct ctl_table *table, int write, in proc_dostring_coredump() argument
1171 int error = proc_dostring(table, write, buffer, lenp, ppos); in proc_dostring_coredump()
1179 static int sysrq_sysctl_handler(struct ctl_table *table, int write, in sysrq_sysctl_handler() argument
1186 ret = __do_proc_dointvec(&tmp, table, write, buffer, in sysrq_sysctl_handler()
1188 if (ret || !write) in sysrq_sysctl_handler()
1191 if (write) in sysrq_sysctl_handler()
1198 static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, in __do_proc_doulongvec_minmax() argument
1199 int write, void *buffer, size_t *lenp, loff_t *ppos, in __do_proc_doulongvec_minmax() argument
1207 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_doulongvec_minmax()
1212 i = (unsigned long *) data; in __do_proc_doulongvec_minmax()
1213 min = (unsigned long *) table->extra1; in __do_proc_doulongvec_minmax()
1214 max = (unsigned long *) table->extra2; in __do_proc_doulongvec_minmax()
1215 vleft = table->maxlen / sizeof(unsigned long); in __do_proc_doulongvec_minmax()
1218 if (write) { in __do_proc_doulongvec_minmax()
1222 if (left > PAGE_SIZE - 1) in __do_proc_doulongvec_minmax()
1223 left = PAGE_SIZE - 1; in __do_proc_doulongvec_minmax()
1227 for (; left && vleft--; i++, first = 0) { in __do_proc_doulongvec_minmax()
1230 if (write) { in __do_proc_doulongvec_minmax()
1246 err = -EINVAL; in __do_proc_doulongvec_minmax()
1258 if (!write && !first && left && !err) in __do_proc_doulongvec_minmax()
1260 if (write && !err) in __do_proc_doulongvec_minmax()
1262 if (write && first) in __do_proc_doulongvec_minmax()
1263 return err ? : -EINVAL; in __do_proc_doulongvec_minmax()
1264 *lenp -= left; in __do_proc_doulongvec_minmax()
1270 static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, in do_proc_doulongvec_minmax() argument
1274 return __do_proc_doulongvec_minmax(table->data, table, write, in do_proc_doulongvec_minmax()
1279 * proc_doulongvec_minmax - read a vector of long integers with min/max values
1281 * @write: %TRUE if this is a write to the sysctl file
1286 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
1290 * table->extra1 (min) and table->extra2 (max).
1294 int proc_doulongvec_minmax(struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1297 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); in proc_doulongvec_minmax()
1301 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
1303 * @write: %TRUE if this is a write to the sysctl file
1308 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
1313 * table->extra1 (min) and table->extra2 (max).
1317 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1320 return do_proc_doulongvec_minmax(table, write, buffer, in proc_doulongvec_ms_jiffies_minmax()
1327 int write, void *data) in do_proc_dointvec_jiffies_conv() argument
1329 if (write) { in do_proc_dointvec_jiffies_conv()
1333 WRITE_ONCE(*valp, -*lvalp * HZ); in do_proc_dointvec_jiffies_conv()
1341 lval = -(unsigned long)val; in do_proc_dointvec_jiffies_conv()
1353 int write, void *data) in do_proc_dointvec_userhz_jiffies_conv() argument
1355 if (write) { in do_proc_dointvec_userhz_jiffies_conv()
1358 *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp); in do_proc_dointvec_userhz_jiffies_conv()
1364 lval = -(unsigned long)val; in do_proc_dointvec_userhz_jiffies_conv()
1376 int write, void *data) in do_proc_dointvec_ms_jiffies_conv() argument
1378 if (write) { in do_proc_dointvec_ms_jiffies_conv()
1379 unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); in do_proc_dointvec_ms_jiffies_conv()
1389 lval = -(unsigned long)val; in do_proc_dointvec_ms_jiffies_conv()
1400 * proc_dointvec_jiffies - read a vector of integers as seconds
1402 * @write: %TRUE if this is a write to the sysctl file
1407 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1414 int proc_dointvec_jiffies(struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1417 return do_proc_dointvec(table,write,buffer,lenp,ppos, in proc_dointvec_jiffies()
1422 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
1424 * @write: %TRUE if this is a write to the sysctl file
1429 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1436 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1439 return do_proc_dointvec(table,write,buffer,lenp,ppos, in proc_dointvec_userhz_jiffies()
1444 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
1446 * @write: %TRUE if this is a write to the sysctl file
1452 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1459 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, void *buffer, in proc_dointvec_ms_jiffies() argument
1462 return do_proc_dointvec(table, write, buffer, lenp, ppos, in proc_dointvec_ms_jiffies()
1466 static int proc_do_cad_pid(struct ctl_table *table, int write, void *buffer, in proc_do_cad_pid() argument
1475 r = __do_proc_dointvec(&tmp, table, write, buffer, in proc_do_cad_pid()
1477 if (r || !write) in proc_do_cad_pid()
1482 return -ESRCH; in proc_do_cad_pid()
1489 * proc_do_large_bitmap - read/write from/to a large bitmap
1491 * @write: %TRUE if this is a write to the sysctl file
1496 * The bitmap is stored at table->data and the bitmap length (in bits)
1497 * in table->maxlen.
1499 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
1505 int proc_do_large_bitmap(struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1511 unsigned long bitmap_len = table->maxlen; in proc_do_large_bitmap()
1512 unsigned long *bitmap = *(unsigned long **) table->data; in proc_do_large_bitmap()
1514 char tr_a[] = { '-', ',', '\n' }, tr_b[] = { ',', '\n', 0 }, c; in proc_do_large_bitmap()
1516 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) { in proc_do_large_bitmap()
1521 if (write) { in proc_do_large_bitmap()
1525 if (left > PAGE_SIZE - 1) { in proc_do_large_bitmap()
1526 left = PAGE_SIZE - 1; in proc_do_large_bitmap()
1528 skipped = *lenp - left; in proc_do_large_bitmap()
1533 return -ENOMEM; in proc_do_large_bitmap()
1540 /* In case we stop parsing mid-number, we can reset */ in proc_do_large_bitmap()
1546 * only one char is left (may be a "-"), then stop here, in proc_do_large_bitmap()
1557 err = -EINVAL; in proc_do_large_bitmap()
1564 left--; in proc_do_large_bitmap()
1567 if (c == '-') { in proc_do_large_bitmap()
1584 err = -EINVAL; in proc_do_large_bitmap()
1589 left--; in proc_do_large_bitmap()
1593 bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1); in proc_do_large_bitmap()
1606 bit_a + 1) - 1; in proc_do_large_bitmap()
1612 proc_put_char(&buffer, &left, '-'); in proc_do_large_bitmap()
1622 if (write) { in proc_do_large_bitmap()
1628 *lenp -= left; in proc_do_large_bitmap()
1638 int proc_dostring(struct ctl_table *table, int write, in proc_dostring() argument
1641 return -ENOSYS; in proc_dostring()
1644 int proc_dointvec(struct ctl_table *table, int write, in proc_dointvec() argument
1647 return -ENOSYS; in proc_dointvec()
1650 int proc_douintvec(struct ctl_table *table, int write, in proc_douintvec() argument
1653 return -ENOSYS; in proc_douintvec()
1656 int proc_dointvec_minmax(struct ctl_table *table, int write, in proc_dointvec_minmax() argument
1659 return -ENOSYS; in proc_dointvec_minmax()
1662 int proc_douintvec_minmax(struct ctl_table *table, int write, in proc_douintvec_minmax() argument
1665 return -ENOSYS; in proc_douintvec_minmax()
1668 int proc_dou8vec_minmax(struct ctl_table *table, int write, in proc_dou8vec_minmax() argument
1671 return -ENOSYS; in proc_dou8vec_minmax()
1674 int proc_dointvec_jiffies(struct ctl_table *table, int write, in proc_dointvec_jiffies() argument
1677 return -ENOSYS; in proc_dointvec_jiffies()
1680 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, in proc_dointvec_userhz_jiffies() argument
1683 return -ENOSYS; in proc_dointvec_userhz_jiffies()
1686 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, in proc_dointvec_ms_jiffies() argument
1689 return -ENOSYS; in proc_dointvec_ms_jiffies()
1692 int proc_doulongvec_minmax(struct ctl_table *table, int write, in proc_doulongvec_minmax() argument
1695 return -ENOSYS; in proc_doulongvec_minmax()
1698 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, in proc_doulongvec_ms_jiffies_minmax() argument
1701 return -ENOSYS; in proc_doulongvec_ms_jiffies_minmax()
1704 int proc_do_large_bitmap(struct ctl_table *table, int write, in proc_do_large_bitmap() argument
1707 return -ENOSYS; in proc_do_large_bitmap()
1713 int proc_do_static_key(struct ctl_table *table, int write, in proc_do_static_key() argument
1716 struct static_key *key = (struct static_key *)table->data; in proc_do_static_key()
1720 .data = &val, in proc_do_static_key()
1722 .mode = table->mode, in proc_do_static_key()
1727 if (write && !capable(CAP_SYS_ADMIN)) in proc_do_static_key()
1728 return -EPERM; in proc_do_static_key()
1732 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos); in proc_do_static_key()
1733 if (write && !ret) { in proc_do_static_key()
1746 .data = &sysctl_sched_child_runs_first,
1754 .data = &sysctl_sched_enable_rt_cas,
1763 .data = &sysctl_sched_enable_rt_active_lb,
1772 .data = &sysctl_sched_use_walt_cpu_util,
1781 .data = &sysctl_sched_use_walt_task_util,
1790 .data = &sysctl_sched_walt_init_task_load_pct,
1797 .data = &sysctl_sched_cpu_high_irqload,
1806 .data = &sysctl_sched_min_granularity,
1815 .data = &sysctl_sched_latency,
1824 .data = &sysctl_sched_wakeup_granularity,
1834 .data = &sysctl_sched_tunable_scaling,
1843 .data = &sysctl_sched_migration_cost,
1850 .data = &sysctl_sched_nr_migrate,
1858 .data = NULL,
1870 .data = &sysctl_numa_balancing_scan_delay,
1877 .data = &sysctl_numa_balancing_scan_period_min,
1884 .data = &sysctl_numa_balancing_scan_period_max,
1891 .data = &sysctl_numa_balancing_scan_size,
1899 .data = NULL, /* filled in by handler */
1910 .data = &sysctl_sched_rt_period,
1917 .data = &sysctl_sched_rt_runtime,
1924 .data = &sysctl_sched_dl_period_max,
1931 .data = &sysctl_sched_dl_period_min,
1938 .data = &sysctl_sched_rr_timeslice,
1946 .data = &sysctl_sched_uclamp_util_min,
1953 .data = &sysctl_sched_uclamp_util_max,
1960 .data = &sysctl_sched_uclamp_util_min_rt_default,
1969 .data = &sysctl_sched_autogroup_enabled,
1980 .data = &sysctl_sched_cfs_bandwidth_slice,
1990 .data = &sysctl_sched_energy_aware,
2001 .data = &prove_locking,
2010 .data = &lock_stat,
2018 .data = &panic_timeout,
2026 .data = &core_uses_pid,
2033 .data = core_pattern,
2040 .data = &core_pipe_limit,
2055 .data = &sysctl_writes_strict,
2066 .data = &latencytop_enabled,
2074 .procname = "real-root-dev",
2075 .data = &real_root_dev,
2082 .procname = "print-fatal-signals",
2083 .data = &print_fatal_signals,
2090 .procname = "reboot-cmd",
2091 .data = reboot_command,
2097 .procname = "stop-a",
2098 .data = &stop_a_enabled,
2104 .procname = "scons-poweroff",
2105 .data = &scons_pwroff,
2113 .procname = "tsb-ratio",
2114 .data = &sysctl_tsb_ratio,
2122 .procname = "soft-power",
2123 .data = &pwrsw_enabled,
2131 .procname = "unaligned-trap",
2132 .data = &unaligned_enabled,
2139 .procname = "ctrl-alt-del",
2140 .data = &C_A_D,
2148 .data = &ftrace_enabled,
2157 .data = &stack_tracer_enabled,
2166 .data = &ftrace_dump_on_oops,
2173 .data = &__disable_trace_on_warning,
2180 .data = &tracepoint_printk,
2189 .data = &kexec_load_disabled,
2201 .data = &modprobe_path,
2208 .data = &modules_disabled,
2220 .data = &uevent_helper,
2228 .procname = "sg-big-buff",
2229 .data = &sg_big_buff,
2238 .data = &acct_parm,
2247 .data = NULL,
2256 .data = NULL,
2263 .procname = "threads-max",
2264 .data = NULL,
2288 .data = &overflowuid,
2297 .data = &overflowgid,
2307 .data = &show_unhandled_signals,
2315 .data = &pid_max,
2324 .data = &panic_on_oops,
2331 .data = &panic_print,
2339 .data = &console_loglevel,
2346 .data = &printk_ratelimit_state.interval,
2353 .data = &printk_ratelimit_state.burst,
2360 .data = &printk_delay_msec,
2369 .data = devkmsg_log_str,
2376 .data = &dmesg_restrict,
2385 .data = &kptr_restrict,
2395 .data = &ngroups_max,
2402 .data = (void *)&cap_last_cap,
2410 .data = &watchdog_user_enabled,
2419 .data = &watchdog_thresh,
2428 .data = &nmi_watchdog_user_enabled,
2437 .data = &watchdog_cpumask_bits,
2445 .data = &soft_watchdog_user_enabled,
2454 .data = &softlockup_panic,
2464 .data = &sysctl_softlockup_all_cpu_backtrace,
2476 .data = &hardlockup_panic,
2486 .data = &sysctl_hardlockup_all_cpu_backtrace,
2500 .data = &unknown_nmi_panic,
2511 .data = &sysctl_panic_on_stackoverflow,
2520 .data = &panic_on_unrecovered_nmi,
2527 .data = &panic_on_io_nmi,
2534 .data = &bootloader_type,
2541 .data = &bootloader_version,
2548 .data = &io_delay_type,
2557 .data = &randomize_va_space,
2566 .data = &spin_retry,
2575 .data = &acpi_realmode_flags,
2583 .procname = "ignore-unaligned-usertrap",
2584 .data = &no_unaligned_warning,
2592 .procname = "unaligned-dump-stack",
2593 .data = &unaligned_dump_stack,
2603 .data = &sysctl_hung_task_all_cpu_backtrace,
2613 .data = &sysctl_hung_task_panic,
2622 .data = &sysctl_hung_task_check_count,
2630 .data = &sysctl_hung_task_timeout_secs,
2638 .data = &sysctl_hung_task_check_interval_secs,
2646 .data = &sysctl_hung_task_warnings,
2656 .data = &max_lock_depth,
2664 .data = &poweroff_cmd,
2678 * User-space scripts rely on the existence of this file
2685 .data = &sysctl_perf_event_paranoid,
2692 .data = &sysctl_perf_event_mlock,
2699 .data = &sysctl_perf_event_sample_rate,
2707 .data = &sysctl_perf_cpu_time_max_percent,
2716 .data = &sysctl_perf_event_max_stack,
2725 .data = &sysctl_perf_event_max_contexts_per_stack,
2735 .data = &panic_on_warn,
2745 .data = &sysctl_timer_migration,
2756 .data = &sysctl_unprivileged_bpf_disabled,
2765 .data = &bpf_stats_enabled_key.key,
2774 .data = &sysctl_panic_on_rcu_stall,
2785 .data = NULL,
2799 .data = &sysctl_overcommit_memory,
2808 .data = &sysctl_panic_on_oom,
2817 .data = &sysctl_oom_kill_allocating_task,
2824 .data = &sysctl_oom_dump_tasks,
2831 .data = &sysctl_overcommit_ratio,
2838 .data = &sysctl_overcommit_kbytes,
2844 .procname = "page-cluster",
2845 .data = &page_cluster,
2853 .data = &dirty_background_ratio,
2862 .data = &dirty_background_bytes,
2870 .data = &vm_dirty_ratio,
2879 .data = &vm_dirty_bytes,
2887 .data = &dirty_writeback_interval,
2894 .data = &dirty_expire_interval,
2902 .data = &dirtytime_expire_interval,
2910 .data = &vm_swappiness,
2920 .data = &sysctl_vm_numa_stat,
2931 .data = NULL,
2939 .data = NULL,
2947 .data = &sysctl_hugetlb_shm_group,
2954 .data = NULL,
2962 .data = &sysctl_lowmem_reserve_ratio,
2969 .data = &sysctl_drop_caches,
2979 .data = &sysctl_compact_memory,
2986 .data = &sysctl_compaction_proactiveness,
2995 .data = &sysctl_extfrag_threshold,
3004 .data = &sysctl_compact_unevictable_allowed,
3015 .data = &min_free_kbytes,
3023 .data = &watermark_boost_factor,
3031 .data = &watermark_scale_factor,
3040 .data = &percpu_pagelist_fraction,
3048 .data = &sysctl_page_lock_unfairness,
3057 .data = &sysctl_max_map_count,
3066 .data = &sysctl_nr_trim_pages,
3075 .data = &laptop_mode,
3082 .data = &sysctl_vfs_cache_pressure,
3092 .data = &sysctl_legacy_va_layout,
3102 .data = &node_reclaim_mode,
3110 .data = &sysctl_min_unmapped_ratio,
3119 .data = &sysctl_min_slab_ratio,
3130 .data = &sysctl_stat_interval,
3137 .data = NULL,
3146 .data = &dac_mmap_min_addr,
3155 .data = &numa_zonelist_order,
3166 .data = &vdso32_enabled,
3169 .data = &vdso_enabled,
3180 .data = &vm_highmem_is_dirtyable,
3191 .data = &sysctl_memory_failure_early_kill,
3200 .data = &sysctl_memory_failure_recovery,
3210 .data = &sysctl_user_reserve_kbytes,
3217 .data = &sysctl_admin_reserve_kbytes,
3225 .data = &mmap_rnd_bits,
3236 .data = &mmap_rnd_compat_bits,
3247 .data = &sysctl_unprivileged_userfaultfd,
3260 .procname = "inode-nr",
3261 .data = &inodes_stat,
3267 .procname = "inode-state",
3268 .data = &inodes_stat,
3274 .procname = "file-nr",
3275 .data = &files_stat,
3281 .procname = "file-max",
3282 .data = &files_stat.max_files,
3291 .data = &sysctl_nr_open,
3299 .procname = "dentry-state",
3300 .data = &dentry_stat,
3307 .data = &fs_overflowuid,
3316 .data = &fs_overflowgid,
3325 .procname = "leases-enable",
3326 .data = &leases_enable,
3334 .procname = "dir-notify-enable",
3335 .data = &dir_notify_enable,
3344 .procname = "lease-break-time",
3345 .data = &lease_break_time,
3353 .procname = "aio-nr",
3354 .data = &aio_nr,
3360 .procname = "aio-max-nr",
3361 .data = &aio_max_nr,
3384 .data = &sysctl_protected_symlinks,
3393 .data = &sysctl_protected_hardlinks,
3402 .data = &sysctl_protected_fifos,
3411 .data = &sysctl_protected_regular,
3420 .data = &suid_dumpable,
3435 .procname = "pipe-max-size",
3436 .data = &pipe_max_size,
3442 .procname = "pipe-user-pages-hard",
3443 .data = &pipe_user_pages_hard,
3449 .procname = "pipe-user-pages-soft",
3450 .data = &pipe_user_pages_soft,
3456 .procname = "mount-max",
3457 .data = &sysctl_mount_max,
3469 .procname = "exception-trace",
3470 .data = &show_unhandled_signals,
3478 .procname = "kprobes-optimization",
3479 .data = &sysctl_kprobes_optimization,
3534 * exception granted :-)