diff options
author | Waiman Long <longman@redhat.com> | 2018-04-10 19:35:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-11 13:28:38 -0400 |
commit | 24704f36196ce79b48dd3921e782d15fd9c87959 (patch) | |
tree | bb270889b77b6e1886285108326520fccc4af77a | |
parent | 64a11f3dc20b45fdc8c058296b4f6449e4b9f24c (diff) |
kernel/sysctl.c: add kdoc comments to do_proc_do{u}intvec_minmax_conv_param
Kdoc comments are added to the do_proc_dointvec_minmax_conv_param and
do_proc_douintvec_minmax_conv_param structures thare are used internally
for range checking.
The error codes returned by proc_dointvec_minmax() and
proc_douintvec_minmax() are also documented.
Link: http://lkml.kernel.org/r/1519926220-7453-3-git-send-email-longman@redhat.com
Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Kees Cook <keescook@chromium.org>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/sysctl.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index a2854f6e0743..6a78cf70761d 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -2511,6 +2511,15 @@ static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, | |||
2511 | } | 2511 | } |
2512 | #endif | 2512 | #endif |
2513 | 2513 | ||
2514 | /** | ||
2515 | * struct do_proc_dointvec_minmax_conv_param - proc_dointvec_minmax() range checking structure | ||
2516 | * @min: pointer to minimum allowable value | ||
2517 | * @max: pointer to maximum allowable value | ||
2518 | * | ||
2519 | * The do_proc_dointvec_minmax_conv_param structure provides the | ||
2520 | * minimum and maximum values for doing range checking for those sysctl | ||
2521 | * parameters that use the proc_dointvec_minmax() handler. | ||
2522 | */ | ||
2514 | struct do_proc_dointvec_minmax_conv_param { | 2523 | struct do_proc_dointvec_minmax_conv_param { |
2515 | int *min; | 2524 | int *min; |
2516 | int *max; | 2525 | int *max; |
@@ -2554,7 +2563,7 @@ static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp, | |||
2554 | * This routine will ensure the values are within the range specified by | 2563 | * This routine will ensure the values are within the range specified by |
2555 | * table->extra1 (min) and table->extra2 (max). | 2564 | * table->extra1 (min) and table->extra2 (max). |
2556 | * | 2565 | * |
2557 | * Returns 0 on success. | 2566 | * Returns 0 on success or -EINVAL on write when the range check fails. |
2558 | */ | 2567 | */ |
2559 | int proc_dointvec_minmax(struct ctl_table *table, int write, | 2568 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
2560 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2569 | void __user *buffer, size_t *lenp, loff_t *ppos) |
@@ -2567,6 +2576,15 @@ int proc_dointvec_minmax(struct ctl_table *table, int write, | |||
2567 | do_proc_dointvec_minmax_conv, ¶m); | 2576 | do_proc_dointvec_minmax_conv, ¶m); |
2568 | } | 2577 | } |
2569 | 2578 | ||
2579 | /** | ||
2580 | * struct do_proc_douintvec_minmax_conv_param - proc_douintvec_minmax() range checking structure | ||
2581 | * @min: pointer to minimum allowable value | ||
2582 | * @max: pointer to maximum allowable value | ||
2583 | * | ||
2584 | * The do_proc_douintvec_minmax_conv_param structure provides the | ||
2585 | * minimum and maximum values for doing range checking for those sysctl | ||
2586 | * parameters that use the proc_douintvec_minmax() handler. | ||
2587 | */ | ||
2570 | struct do_proc_douintvec_minmax_conv_param { | 2588 | struct do_proc_douintvec_minmax_conv_param { |
2571 | unsigned int *min; | 2589 | unsigned int *min; |
2572 | unsigned int *max; | 2590 | unsigned int *max; |
@@ -2614,7 +2632,7 @@ static int do_proc_douintvec_minmax_conv(unsigned long *lvalp, | |||
2614 | * check for UINT_MAX to avoid having to support wrap around uses from | 2632 | * check for UINT_MAX to avoid having to support wrap around uses from |
2615 | * userspace. | 2633 | * userspace. |
2616 | * | 2634 | * |
2617 | * Returns 0 on success. | 2635 | * Returns 0 on success or -ERANGE on write when the range check fails. |
2618 | */ | 2636 | */ |
2619 | int proc_douintvec_minmax(struct ctl_table *table, int write, | 2637 | int proc_douintvec_minmax(struct ctl_table *table, int write, |
2620 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2638 | void __user *buffer, size_t *lenp, loff_t *ppos) |