]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
sysctl: fix proc_doulongvec_ms_jiffies_minmax()
authorEric Dumazet <edumazet@google.com>
Thu, 26 Jan 2017 02:20:55 +0000 (18:20 -0800)
committerJiri Slaby <jslaby@suse.cz>
Wed, 15 Feb 2017 10:56:07 +0000 (11:56 +0100)
commit ff9f8a7cf935468a94d9927c68b00daae701667e upstream.

We perform the conversion between kernel jiffies and ms only when
exporting kernel value to user space.

We need to do the opposite operation when value is written by user.

Only matters when HZ != 1000

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
kernel/sysctl.c

index 37b95a2982afcbfa3ba214a0e835142737160269..2488148a66d712e2ae51470c30341e975be8f2e3 100644 (file)
@@ -2229,6 +2229,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
                                break;
                        if (neg)
                                continue;
+                       val = convmul * val / convdiv;
                        if ((min && val < *min) || (max && val > *max))
                                continue;
                        *i = val;