]> git.hungrycats.org Git - linux/commitdiff
sysctl: fix proc_doulongvec_ms_jiffies_minmax()
authorEric Dumazet <edumazet@google.com>
Thu, 26 Jan 2017 02:20:55 +0000 (18:20 -0800)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 6 Mar 2017 22:31:11 +0000 (17:31 -0500)
[ Upstream commit ff9f8a7cf935468a94d9927c68b00daae701667e ]

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>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
kernel/sysctl.c

index cebbff5f34fee907980903740459bd766d24180c..1431089b8a67c01be0b7f656daaad8dd77ef1ce1 100644 (file)
@@ -2349,6 +2349,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;