Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3388741imu; Thu, 29 Nov 2018 22:33:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/WDjetDau6qJSgrVoJMWb+jm+A2TgGaNb03VOmsNFpiN6/oKcX/GXEsUbfRivB1n2OmFQmG X-Received: by 2002:a63:2586:: with SMTP id l128mr3917916pgl.104.1543559616966; Thu, 29 Nov 2018 22:33:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543559616; cv=none; d=google.com; s=arc-20160816; b=HRcEap//c+aR3aCDzlUOPYq3+g43ntfKP2mnGUswPsGcObHuwrW2mstWscr+Ibpsq8 zLhBzY+9wdgfTZmE1FhEKQuvikaH+dy6GJyIvJLOIB8brcVpGFFitIxEBiUKANr4fS2K xu1F8G5HF5YarY+KwI+lV5yVWwWS04FbFHP51DzihZquUA23pe3lphgw8ig2knWgkSB5 99Ly9FkjGhJZTtF8RKHbCklxC1cO7wF5GS995JnEoiH9zAKt+MSIFPcZuIZBugj+LjNt wemxwOvPimp8dOIJRZPH9PEzFm8Dh0DNHmK8P0WcI5ciDFveBtK5TVdLslsnnJrwlmMj jv+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=kdiB4mA/h+Fxa7OcMsHXgmah678MYeJ7OUHhHUZ3MCM=; b=ugRGl+6S+nZijAR3KA8dVlNkY2LmJejqZRYhNlmg2KZuknfBAex0zmbptUCA6G5s/b DsU41Hy76fTs85X1ncTJEmBGOLMKcYmcEC9B8jqFUaGgBUHnzpQUSOgS+TKwXi/OhOUt DjbtEH49OS671FoUiPv2xpMgaSdT6sxK8S+kRlpDtj54e0PrPLyMReZGRMlu0Hz+YzWv A8oOUI/hwxBgVG6enRSlGaj0yzLdh9+JXPNDfO+0gYzHOiU85CoxnURpcU5Yr9NmJ2f1 ue8TkZVtrAvCyxsbst/XAUvRSSqNW29Ta+m30tML48EuMAhEo5M0zDom6YHZCLlF5AD5 fNjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si3632004pgh.224.2018.11.29.22.33.22; Thu, 29 Nov 2018 22:33:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726893AbeK3Rkx (ORCPT + 99 others); Fri, 30 Nov 2018 12:40:53 -0500 Received: from out1.zte.com.cn ([202.103.147.172]:53278 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbeK3Rkx (ORCPT ); Fri, 30 Nov 2018 12:40:53 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 320C628903D7A267F225; Fri, 30 Nov 2018 14:32:36 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id wAU6WVKr048891; Fri, 30 Nov 2018 14:32:31 +0800 (GMT-8) (envelope-from cheng.lin130@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018113014330853-13898659 ; Fri, 30 Nov 2018 14:33:08 +0800 From: Cheng Lin To: mcgrof@kernel.org Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, zhong.weidong@zte.com.cn, wang.yi59@zte.com.cn, Cheng Lin Subject: [PATCH] proc/sysctl: fix return error for proc_doulongvec_minmax Date: Fri, 30 Nov 2018 14:35:17 +0800 Message-Id: <1543559717-27534-1-git-send-email-cheng.lin130@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-11-30 14:33:08, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-11-30 14:32:15, Serialize complete at 2018-11-30 14:32:15 X-MAIL: mse01.zte.com.cn wAU6WVKr048891 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the number of input parameters is less than the total parameters, an INVAL error will be returned. This patch ensure no error returned in this condition, just like other interfaces do. Signed-off-by: Cheng Lin --- kernel/sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 5fc724e..9ee261f 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2779,6 +2779,8 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int bool neg; left -= proc_skip_spaces(&p); + if (!left) + break; err = proc_get_long(&p, &left, &val, &neg, proc_wspace_sep, -- 1.8.3.1