Lines Matching +full:user +full:- +full:defined

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.
94 #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
107 #if defined(CONFIG_SYSCTL)
114 static int __maybe_unused neg_one = -1;
155 * enum sysctl_writes_mode - supported sysctl write modes
174 SYSCTL_WRITES_LEGACY = -1,
182 #if defined(HAVE_ARCH_PICK_MMAP_LAYOUT) || \
183 defined(CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT)
194 static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
205 #if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_SYSCTL)
209 struct static_key *key = (struct static_key *)table->data; in bpf_stats_handler()
215 .mode = table->mode, in bpf_stats_handler()
221 return -EPERM; in bpf_stats_handler()
259 if (len > maxlen - 1) in _proc_do_string()
260 len = maxlen - 1; in _proc_do_string()
272 while ((p - buffer) < *lenp && len < maxlen - 1) { in _proc_do_string()
290 len -= *ppos; in _proc_do_string()
310 "warning, set kernel.sysctl_writes_strict = -1\n", in warn_sysctl_write()
311 current->comm, table->procname); in warn_sysctl_write()
315 * proc_first_pos_non_zero_ignore - check if first position is allowed
319 * Returns true if the first position is non-zero and the sysctl_writes_strict
341 * proc_dostring - read a string sysctl
344 * @buffer: the user buffer
345 * @lenp: the size of the user buffer
348 * Reads/writes a string from/to the user buffer. If the kernel
350 * string is truncated. The copied string is %NULL-terminated.
351 * If the string is being read by the user process, it is copied
363 return _proc_do_string(table->data, table->maxlen, write, buffer, lenp, in proc_dostring()
371 ret = tmp - *buf; in proc_skip_spaces()
381 (*size)--; in proc_skip_char()
387 * strtoul_lenient - parse an ASCII formatted integer from a buffer and only
410 return -ERANGE; in strtoul_lenient()
423 * proc_get_long - reads an ASCII formatted integer from a user buffer
434 * the amount of bytes read. If @tr is non-NULL and a trailing
435 * character exists (size is non-zero after returning from this
446 return -EINVAL; in proc_get_long()
449 if (len > TMPBUFLEN - 1) in proc_get_long()
450 len = TMPBUFLEN - 1; in proc_get_long()
456 if (*p == '-' && *size > 1) { in proc_get_long()
462 return -EINVAL; in proc_get_long()
465 return -EINVAL; in proc_get_long()
467 len = p - tmp; in proc_get_long()
472 if (len == TMPBUFLEN - 1) in proc_get_long()
473 return -EINVAL; in proc_get_long()
476 return -EINVAL; in proc_get_long()
482 *size -= len; in proc_get_long()
488 * proc_put_long - converts an integer to a decimal ASCII formatted string
490 * @buf: the user buffer
491 * @size: the size of the user buffer
503 sprintf(p, "%s%lu", neg ? "-" : "", val); in proc_put_long()
508 *size -= len; in proc_put_long()
519 (*size)--; in proc_put_char()
532 return -EINVAL; in do_proc_dointvec_conv()
533 *valp = -*lvalp; in do_proc_dointvec_conv()
536 return -EINVAL; in do_proc_dointvec_conv()
543 *lvalp = -(unsigned long)val; in do_proc_dointvec_conv()
558 return -EINVAL; in do_proc_douintvec_conv()
580 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_dointvec()
586 vleft = table->maxlen / sizeof(*i); in __do_proc_dointvec()
596 if (left > PAGE_SIZE - 1) in __do_proc_dointvec()
597 left = PAGE_SIZE - 1; in __do_proc_dointvec()
601 for (; left && vleft--; i++, first=0) { in __do_proc_dointvec()
606 left -= proc_skip_spaces(&p); in __do_proc_dointvec()
616 err = -EINVAL; in __do_proc_dointvec()
621 err = -EINVAL; in __do_proc_dointvec()
633 left -= proc_skip_spaces(&p); in __do_proc_dointvec()
635 return err ? : -EINVAL; in __do_proc_dointvec()
636 *lenp -= left; in __do_proc_dointvec()
648 return __do_proc_dointvec(table->data, table, write, in do_proc_dointvec()
672 if (left > PAGE_SIZE - 1) in do_proc_douintvec_w()
673 left = PAGE_SIZE - 1; in do_proc_douintvec_w()
675 left -= proc_skip_spaces(&p); in do_proc_douintvec_w()
677 err = -EINVAL; in do_proc_douintvec_w()
685 err = -EINVAL; in do_proc_douintvec_w()
690 err = -EINVAL; in do_proc_douintvec_w()
695 left -= proc_skip_spaces(&p); in do_proc_douintvec_w()
699 return -EINVAL; in do_proc_douintvec_w()
723 err = -EINVAL; in do_proc_douintvec_r()
734 *lenp -= left; in do_proc_douintvec_r()
750 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_douintvec()
756 vleft = table->maxlen / sizeof(*i); in __do_proc_douintvec()
764 return -EINVAL; in __do_proc_douintvec()
783 return __do_proc_douintvec(table->data, table, write, in do_proc_douintvec()
788 * proc_dointvec - read a vector of integers
791 * @buffer: the user buffer
792 * @lenp: the size of the user buffer
795 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
796 * values from/to the user buffer, treated as an ASCII string.
815 old = *(int *)table->data; in proc_dointvec_minmax_warn_RT_change()
819 if (old != *(int *)table->data) in proc_dointvec_minmax_warn_RT_change()
821 table->procname, current->comm, in proc_dointvec_minmax_warn_RT_change()
828 * proc_douintvec - read a vector of unsigned integers
831 * @buffer: the user buffer
832 * @lenp: the size of the user buffer
835 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
836 * values from/to the user buffer, treated as an ASCII string.
859 return -EPERM; in proc_taint()
876 return -EINVAL; in proc_taint()
895 return -EPERM; in proc_dointvec_minmax_sysadmin()
902 * struct do_proc_dointvec_minmax_conv_param - proc_dointvec_minmax() range checking structure
923 * bounds-check it before touching *valp. in do_proc_dointvec_minmax_conv()
932 if ((param->min && *param->min > tmp) || in do_proc_dointvec_minmax_conv()
933 (param->max && *param->max < tmp)) in do_proc_dointvec_minmax_conv()
934 return -EINVAL; in do_proc_dointvec_minmax_conv()
942 * proc_dointvec_minmax - read a vector of integers with min/max values
945 * @buffer: the user buffer
946 * @lenp: the size of the user buffer
949 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
950 * values from/to the user buffer, treated as an ASCII string.
953 * table->extra1 (min) and table->extra2 (max).
955 * Returns 0 on success or -EINVAL on write when the range check fails.
961 .min = (int *) table->extra1, in proc_dointvec_minmax()
962 .max = (int *) table->extra2, in proc_dointvec_minmax()
969 * struct do_proc_douintvec_minmax_conv_param - proc_douintvec_minmax() range checking structure
989 /* write via temporary local uint for bounds-checking */ in do_proc_douintvec_minmax_conv()
997 if ((param->min && *param->min > tmp) || in do_proc_douintvec_minmax_conv()
998 (param->max && *param->max < tmp)) in do_proc_douintvec_minmax_conv()
999 return -ERANGE; in do_proc_douintvec_minmax_conv()
1008 * proc_douintvec_minmax - read a vector of unsigned ints with min/max values
1011 * @buffer: the user buffer
1012 * @lenp: the size of the user buffer
1015 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
1016 * values from/to the user buffer, treated as an ASCII string. Negative
1020 * table->extra1 (min) and table->extra2 (max). There is a final sanity
1024 * Returns 0 on success or -ERANGE on write when the range check fails.
1030 .min = (unsigned int *) table->extra1, in proc_douintvec_minmax()
1031 .max = (unsigned int *) table->extra2, in proc_douintvec_minmax()
1046 return -EINVAL; in do_proc_dopipe_max_size_conv()
1127 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) { in __do_proc_doulongvec_minmax()
1133 min = (unsigned long *) table->extra1; in __do_proc_doulongvec_minmax()
1134 max = (unsigned long *) table->extra2; in __do_proc_doulongvec_minmax()
1135 vleft = table->maxlen / sizeof(unsigned long); in __do_proc_doulongvec_minmax()
1142 if (left > PAGE_SIZE - 1) in __do_proc_doulongvec_minmax()
1143 left = PAGE_SIZE - 1; in __do_proc_doulongvec_minmax()
1147 for (; left && vleft--; i++, first = 0) { in __do_proc_doulongvec_minmax()
1153 left -= proc_skip_spaces(&p); in __do_proc_doulongvec_minmax()
1166 err = -EINVAL; in __do_proc_doulongvec_minmax()
1181 left -= proc_skip_spaces(&p); in __do_proc_doulongvec_minmax()
1183 return err ? : -EINVAL; in __do_proc_doulongvec_minmax()
1184 *lenp -= left; in __do_proc_doulongvec_minmax()
1194 return __do_proc_doulongvec_minmax(table->data, table, write, in do_proc_doulongvec_minmax()
1199 * proc_doulongvec_minmax - read a vector of long integers with min/max values
1202 * @buffer: the user buffer
1203 * @lenp: the size of the user buffer
1206 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
1207 * values from/to the user buffer, treated as an ASCII string.
1210 * table->extra1 (min) and table->extra2 (max).
1221 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
1224 * @buffer: the user buffer
1225 * @lenp: the size of the user buffer
1228 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
1229 * values from/to the user buffer, treated as an ASCII string. The values
1233 * table->extra1 (min) and table->extra2 (max).
1252 *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ); in do_proc_dointvec_jiffies_conv()
1258 lval = -(unsigned long)val; in do_proc_dointvec_jiffies_conv()
1275 *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp); in do_proc_dointvec_userhz_jiffies_conv()
1281 lval = -(unsigned long)val; in do_proc_dointvec_userhz_jiffies_conv()
1296 unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); in do_proc_dointvec_ms_jiffies_conv()
1306 lval = -(unsigned long)val; in do_proc_dointvec_ms_jiffies_conv()
1317 * proc_dointvec_jiffies - read a vector of integers as seconds
1320 * @buffer: the user buffer
1321 * @lenp: the size of the user buffer
1324 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1325 * values from/to the user buffer, treated as an ASCII string.
1339 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
1342 * @buffer: the user buffer
1343 * @lenp: the size of the user buffer
1346 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1347 * values from/to the user buffer, treated as an ASCII string.
1361 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
1364 * @buffer: the user buffer
1365 * @lenp: the size of the user buffer
1369 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1370 * values from/to the user buffer, treated as an ASCII string.
1399 return -ESRCH; in proc_do_cad_pid()
1406 * proc_do_large_bitmap - read/write from/to a large bitmap
1409 * @buffer: the user buffer
1410 * @lenp: the size of the user buffer
1413 * The bitmap is stored at table->data and the bitmap length (in bits)
1414 * in table->maxlen.
1416 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
1428 unsigned long bitmap_len = table->maxlen; in proc_do_large_bitmap()
1429 unsigned long *bitmap = *(unsigned long **) table->data; in proc_do_large_bitmap()
1431 char tr_a[] = { '-', ',', '\n' }, tr_b[] = { ',', '\n', 0 }, c; in proc_do_large_bitmap()
1442 if (left > PAGE_SIZE - 1) { in proc_do_large_bitmap()
1443 left = PAGE_SIZE - 1; in proc_do_large_bitmap()
1445 skipped = *lenp - left; in proc_do_large_bitmap()
1450 return -ENOMEM; in proc_do_large_bitmap()
1457 /* In case we stop parsing mid-number, we can reset */ in proc_do_large_bitmap()
1463 * only one char is left (may be a "-"), then stop here, in proc_do_large_bitmap()
1474 err = -EINVAL; in proc_do_large_bitmap()
1481 left--; in proc_do_large_bitmap()
1484 if (c == '-') { in proc_do_large_bitmap()
1501 err = -EINVAL; in proc_do_large_bitmap()
1506 left--; in proc_do_large_bitmap()
1510 bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1); in proc_do_large_bitmap()
1523 bit_a + 1) - 1; in proc_do_large_bitmap()
1529 proc_put_char(&buffer, &left, '-'); in proc_do_large_bitmap()
1545 *lenp -= left; in proc_do_large_bitmap()
1558 return -ENOSYS; in proc_dostring()
1564 return -ENOSYS; in proc_dointvec()
1570 return -ENOSYS; in proc_douintvec()
1576 return -ENOSYS; in proc_dointvec_minmax()
1582 return -ENOSYS; in proc_douintvec_minmax()
1588 return -ENOSYS; in proc_dointvec_jiffies()
1594 return -ENOSYS; in proc_dointvec_userhz_jiffies()
1600 return -ENOSYS; in proc_dointvec_ms_jiffies()
1606 return -ENOSYS; in proc_doulongvec_minmax()
1612 return -ENOSYS; in proc_doulongvec_ms_jiffies_minmax()
1618 return -ENOSYS; in proc_do_large_bitmap()
1623 #if defined(CONFIG_SYSCTL)
1627 struct static_key *key = (struct static_key *)table->data; in proc_do_static_key()
1633 .mode = table->mode, in proc_do_static_key()
1639 return -EPERM; in proc_do_static_key()
1846 #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
1933 .procname = "real-root-dev",
1941 .procname = "print-fatal-signals",
1949 .procname = "reboot-cmd",
1956 .procname = "stop-a",
1963 .procname = "scons-poweroff",
1972 .procname = "tsb-ratio",
1981 .procname = "soft-power",
1990 .procname = "unaligned-trap",
1998 .procname = "ctrl-alt-del",
2087 .procname = "sg-big-buff",
2122 .procname = "threads-max",
2206 #if defined CONFIG_PRINTK
2277 #if defined(CONFIG_LOCKUP_DETECTOR)
2367 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
2377 #if (defined(CONFIG_X86_32) || defined(CONFIG_PARISC)) && \
2378 defined(CONFIG_DEBUG_STACKOVERFLOW)
2387 #if defined(CONFIG_X86)
2424 #if defined(CONFIG_MMU)
2433 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
2442 #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
2453 .procname = "ignore-unaligned-usertrap",
2462 .procname = "unaligned-dump-stack",
2548 * User-space scripts rely on the existence of this file
2612 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
2642 #if defined(CONFIG_TREE_RCU)
2715 .procname = "page-cluster",
2965 #if defined(HAVE_ARCH_PICK_MMAP_LAYOUT) || \
2966 defined(CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT)
3038 #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
3039 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
3137 .procname = "inode-nr",
3144 .procname = "inode-state",
3151 .procname = "file-nr",
3158 .procname = "file-max",
3176 .procname = "dentry-state",
3202 .procname = "leases-enable",
3211 .procname = "dir-notify-enable",
3221 .procname = "lease-break-time",
3230 .procname = "aio-nr",
3237 .procname = "aio-max-nr",
3304 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
3312 .procname = "pipe-max-size",
3319 .procname = "pipe-user-pages-hard",
3326 .procname = "pipe-user-pages-soft",
3333 .procname = "mount-max",
3346 .procname = "exception-trace",
3353 #if defined(CONFIG_OPTPROBES)
3355 .procname = "kprobes-optimization",
3411 * exception granted :-)