diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-23 14:16:56 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-02-23 14:16:56 -0800 |
commit | fcc77d7c8ef6478844547d50dd3d03270c86116c (patch) | |
tree | 57579e819aa9694dd85eaef3ad4e19d9c0432f67 /fs | |
parent | c538944d8efb14e9809b685608490b017bfc2d48 (diff) | |
parent | f1aa2eb5ea05ccd1fd92d235346e60e90a1ed949 (diff) |
Merge tag 'sysctl-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux
Pull sysctl update from Luis Chamberlain:
"Just one fix which just came in.
Sadly the eager beavers willing to help with the sysctl moves have
slowed"
* tag 'sysctl-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
sysctl: fix proc_dobool() usability
Diffstat (limited to 'fs')
-rw-r--r-- | fs/lockd/svc.c | 2 | ||||
-rw-r--r-- | fs/proc/proc_sysctl.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 1da00230860c..9a47303b2cba 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -496,7 +496,7 @@ static struct ctl_table nlm_sysctls[] = { { .procname = "nsm_use_hostnames", .data = &nsm_use_hostnames, - .maxlen = sizeof(int), + .maxlen = sizeof(bool), .mode = 0644, .proc_handler = proc_dobool, }, diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index e89bd8f1368b..5851eb5bc726 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1124,6 +1124,11 @@ static int sysctl_check_table_array(const char *path, struct ctl_table *table) err |= sysctl_err(path, table, "array not allowed"); } + if (table->proc_handler == proc_dobool) { + if (table->maxlen != sizeof(bool)) + err |= sysctl_err(path, table, "array not allowed"); + } + return err; } @@ -1136,6 +1141,7 @@ static int sysctl_check_table(const char *path, struct ctl_table *table) err |= sysctl_err(path, entry, "Not a file"); if ((entry->proc_handler == proc_dostring) || + (entry->proc_handler == proc_dobool) || (entry->proc_handler == proc_dointvec) || (entry->proc_handler == proc_douintvec) || (entry->proc_handler == proc_douintvec_minmax) || |