proc_sysctl.c (05e6295f7b5e05f09e369a3eb2882ec5b40fff20) proc_sysctl.c (f1aa2eb5ea05ccd1fd92d235346e60e90a1ed949)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * /proc/sys support
4 */
5#include <linux/init.h>
6#include <linux/sysctl.h>
7#include <linux/poll.h>
8#include <linux/proc_fs.h>

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

1119 err |= sysctl_err(path, table, "array not allowed");
1120 }
1121
1122 if (table->proc_handler == proc_dou8vec_minmax) {
1123 if (table->maxlen != sizeof(u8))
1124 err |= sysctl_err(path, table, "array not allowed");
1125 }
1126
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * /proc/sys support
4 */
5#include <linux/init.h>
6#include <linux/sysctl.h>
7#include <linux/poll.h>
8#include <linux/proc_fs.h>

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

1119 err |= sysctl_err(path, table, "array not allowed");
1120 }
1121
1122 if (table->proc_handler == proc_dou8vec_minmax) {
1123 if (table->maxlen != sizeof(u8))
1124 err |= sysctl_err(path, table, "array not allowed");
1125 }
1126
1127 if (table->proc_handler == proc_dobool) {
1128 if (table->maxlen != sizeof(bool))
1129 err |= sysctl_err(path, table, "array not allowed");
1130 }
1131
1127 return err;
1128}
1129
1130static int sysctl_check_table(const char *path, struct ctl_table *table)
1131{
1132 struct ctl_table *entry;
1133 int err = 0;
1134 list_for_each_table_entry(entry, table) {
1135 if (entry->child)
1136 err |= sysctl_err(path, entry, "Not a file");
1137
1138 if ((entry->proc_handler == proc_dostring) ||
1132 return err;
1133}
1134
1135static int sysctl_check_table(const char *path, struct ctl_table *table)
1136{
1137 struct ctl_table *entry;
1138 int err = 0;
1139 list_for_each_table_entry(entry, table) {
1140 if (entry->child)
1141 err |= sysctl_err(path, entry, "Not a file");
1142
1143 if ((entry->proc_handler == proc_dostring) ||
1144 (entry->proc_handler == proc_dobool) ||
1139 (entry->proc_handler == proc_dointvec) ||
1140 (entry->proc_handler == proc_douintvec) ||
1141 (entry->proc_handler == proc_douintvec_minmax) ||
1142 (entry->proc_handler == proc_dointvec_minmax) ||
1143 (entry->proc_handler == proc_dou8vec_minmax) ||
1144 (entry->proc_handler == proc_dointvec_jiffies) ||
1145 (entry->proc_handler == proc_dointvec_userhz_jiffies) ||
1146 (entry->proc_handler == proc_dointvec_ms_jiffies) ||

--- 779 unchanged lines hidden ---
1145 (entry->proc_handler == proc_dointvec) ||
1146 (entry->proc_handler == proc_douintvec) ||
1147 (entry->proc_handler == proc_douintvec_minmax) ||
1148 (entry->proc_handler == proc_dointvec_minmax) ||
1149 (entry->proc_handler == proc_dou8vec_minmax) ||
1150 (entry->proc_handler == proc_dointvec_jiffies) ||
1151 (entry->proc_handler == proc_dointvec_userhz_jiffies) ||
1152 (entry->proc_handler == proc_dointvec_ms_jiffies) ||

--- 779 unchanged lines hidden ---