Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937622AbdCJNjV (ORCPT ); Fri, 10 Mar 2017 08:39:21 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:43462 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934323AbdCJLw0 (ORCPT ); Fri, 10 Mar 2017 06:52:26 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Linus Torvalds" , "Eric Dumazet" Date: Fri, 10 Mar 2017 11:46:23 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 261/370] sysctl: fix proc_doulongvec_ms_jiffies_minmax() In-Reply-To: X-SA-Exim-Connect-IP: 82.70.136.246 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 889 Lines: 32 3.16.42-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet 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 Signed-off-by: Linus Torvalds Signed-off-by: Ben Hutchings --- kernel/sysctl.c | 1 + 1 file changed, 1 insertion(+) --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2317,6 +2317,7 @@ static int __do_proc_doulongvec_minmax(v break; if (neg) continue; + val = convmul * val / convdiv; if ((min && val < *min) || (max && val > *max)) continue; *i = val;