From patchwork Tue Mar 3 20:20:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 11418751 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7644A14B4 for ; Tue, 3 Mar 2020 20:21:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4250120848 for ; Tue, 3 Mar 2020 20:21:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4250120848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6F2826B0008; Tue, 3 Mar 2020 15:21:01 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6C9846B000A; Tue, 3 Mar 2020 15:21:01 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 605BB6B000C; Tue, 3 Mar 2020 15:21:01 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0106.hostedemail.com [216.40.44.106]) by kanga.kvack.org (Postfix) with ESMTP id 493956B0008 for ; Tue, 3 Mar 2020 15:21:01 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B1B9E181AC9BF for ; Tue, 3 Mar 2020 20:21:00 +0000 (UTC) X-FDA: 76555169880.05.brick26_7d2f93c60e55a X-Spam-Summary: 10,1,0,d663b27792bc2505,d41d8cd98f00b204,bigeasy@linutronix.de,,RULES_HIT:41:46:150:152:355:379:800:960:973:988:989:1260:1277:1312:1313:1314:1345:1359:1437:1516:1518:1519:1534:1540:1593:1594:1595:1596:1711:1730:1747:1777:1792:2393:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3867:3868:4321:5007:6261:10004:10400:10471:11026:11638:11639:11658:11914:11984:12043:12160:12296:12297:12438:12555:12895:12986:13069:13161:13229:13255:13311:13357:13895:14181:14394:14721:21080:21451:21627:30054,0,RBL:193.142.43.55:@linutronix.de:.lbl8.mailshell.net-64.201.201.201 62.8.6.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: brick26_7d2f93c60e55a X-Filterd-Recvd-Size: 2396 Received: from Galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Tue, 3 Mar 2020 20:21:00 +0000 (UTC) Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1j9E2A-0005uZ-As; Tue, 03 Mar 2020 21:20:54 +0100 Date: Tue, 3 Mar 2020 21:20:54 +0100 From: Sebastian Andrzej Siewior To: Andrew Morton Cc: Vlastimil Babka , linux-mm@kvack.org, Thomas Gleixner , Luis Chamberlain , Kees Cook , Iurii Zaikin , Mel Gorman , Linux API Subject: [PATCH 1/2] =?utf-8?b?PT9VVEYtOD9xP21tL2NvbXBhY3Rpb246PTIwUmVhbGx5?= =?utf-8?b?PTIwbGltaXQ9MjBjb21wYWN0Pz0gPT9VVEYtOD9xPz01RnVuZXZpY3RhYmxlPTVG?= =?utf-8?b?YWxsb3dlZD0yMHRvPTIwMD1FMj04MD1BNjE/PQ==?= Message-ID: <20200303202054.gsosv7fsx2ma3cic@linutronix.de> References: <20200115161035.893221-1-bigeasy@linutronix.de> <4cf4507b-0632-34e6-5985-df933559af9f@suse.cz> <20200302173516.iysuejilava37psk@linutronix.de> <20200302132531.59a2c9dffe2515d78abaf909@linux-foundation.org> <20200303175910.ichnkjkgmz5y2ipb@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200303175910.ichnkjkgmz5y2ipb@linutronix.de> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The proc file `compact_unevictable_allowed' should allow 0 and 1 only, the `extra*' attribues have been set properly but without proc_dointvec_minmax() as the `proc_handler' the limit will not be enforced. Use proc_dointvec_minmax() as the `proc_handler' to enfoce the valid specified range. Signed-off-by: Sebastian Andrzej Siewior Acked-by: Vlastimil Babka --- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index ad5b88a53c5a8..982203101f961 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1484,7 +1484,7 @@ static struct ctl_table vm_table[] = { .data = &sysctl_compact_unevictable_allowed, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, },