Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4118305imu; Fri, 30 Nov 2018 11:17:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/UFR+YYhu4zs5XGq7N86pA94IHC8R6iGcYOUAhXg1r/J3HrbRqMJl82bhaihkSBuCu26S/W X-Received: by 2002:a17:902:e20b:: with SMTP id ce11mr2113682plb.251.1543605455386; Fri, 30 Nov 2018 11:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543605455; cv=none; d=google.com; s=arc-20160816; b=St4izGHPb6gOjPOtPsStD/s1+cjOXhEn0qv42OIMqAQ1b/1I/K/UGZUEU5xSsh7aum muAj6gA+03fQCxOH6Tk1rT7pXGhlKiC4AGin18AW2TxpFxwft6q3EE0AQWuqLjzA9Opr 0meNBNSuDfa7xAxX+d+eXxKQIQGRQcDp5aWhcmQzZcLhUvAoD41z5MFAeFU1pgrBBsDI u/nBRwlN+qwVEvFuRlbyPXtOL+QLMw2AqtkRsNKaDmoOiLafvLStfApp4s7J8lCiLOp7 CS+c30hR86zPeow45wQ6ooOOz2WWTkc881jmqfGhKgGl4f5hy9VbSuS4bp956pCMTr5p TCEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vYb92S/GcmfL6XS+gSva3HzX8uaPNAM/HRbC270QUzw=; b=pS/t4cg4vhDnIGdQL0s3mhHHk3HHuAmsB6gGZxQzV+Iy7QHbSepw+D5693T2zLf7ap 0N2QyOZ4ROFRaty69L1k9Dire1LeN6QI7z6/7iiQIB0qE6xwjJPn3vI4RBYuEP5jv/Db 8pP+mX0LR5yqyNh/26QiyxzQe2VuIaMxfu/jrrUyk7pfcArYnR8OB6S0IcmmUQ9rcRLI dxmYB/QcIcLjNw08G/i6vap7HdC1ovQo34bEvhIJWgb4STvYLM84WjI7ruUG+0M9PWMJ Ti9ujcodrscBwThO6o8oUEaEwj2rdBI3KKVaMbiv6VUE73Bwc2+G+6LFPynUOPY9vvOk aCRA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si6450606ple.281.2018.11.30.11.17.20; Fri, 30 Nov 2018 11:17:35 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726633AbeLAGZS (ORCPT + 99 others); Sat, 1 Dec 2018 01:25:18 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38785 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbeLAGZS (ORCPT ); Sat, 1 Dec 2018 01:25:18 -0500 Received: by mail-pf1-f194.google.com with SMTP id q1so3265599pfi.5; Fri, 30 Nov 2018 11:15:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vYb92S/GcmfL6XS+gSva3HzX8uaPNAM/HRbC270QUzw=; b=BkDOytqWiu/sNHpuUTtJfZXdrh5thCAFBCrf0fTy2s2rM6Xpuq4jCo6PSvpl5DuXER hnyjutHEBrW/L8Z85sy+Vkey8zjDuCaRYp2BrYC4c+EOHropHWFVoG+VxBM7nXwkUGgh iLF2cGL8FbstMGHWcWkCRODA82cNoi+cFEpZWlnuKFmX2rj4lL/UmwYe4u1yATCGYAEv OnIe1VujCTHSsRF8WBy4waWNg8jz282tWlnyGxk824BcatOc1mW2WdHhHHW4hI8dadof nO8cWb4Ou9TZ4DW0YrHbPM1loIBi64gjntJALijOKSbnah/E0BnEu2INnswkR7o5MX+9 i4Aw== X-Gm-Message-State: AA+aEWaJsGlKy+tx5ZCoR0XJq6NHc4hk6PG5YLwJUDqGy5vksRbub9G7 mIO+P+vq3+KYkZ8JT21adGPyc79l X-Received: by 2002:a62:5884:: with SMTP id m126mr6757099pfb.177.1543605300922; Fri, 30 Nov 2018 11:15:00 -0800 (PST) Received: from garbanzo.do-not-panic.com (c-73-71-40-85.hsd1.ca.comcast.net. [73.71.40.85]) by smtp.gmail.com with ESMTPSA id w80-v6sm8824597pfk.11.2018.11.30.11.14.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Nov 2018 11:14:59 -0800 (PST) Received: by garbanzo.do-not-panic.com (sSMTP sendmail emulation); Fri, 30 Nov 2018 11:14:56 -0800 Date: Fri, 30 Nov 2018 11:14:56 -0800 From: Luis Chamberlain To: Cheng Lin Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, zhong.weidong@zte.com.cn, wang.yi59@zte.com.cn Subject: Re: [PATCH] proc/sysctl: fix return error for proc_doulongvec_minmax Message-ID: <20181130191456.GX18410@garbanzo.do-not-panic.com> References: <1543559717-27534-1-git-send-email-cheng.lin130@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1543559717-27534-1-git-send-email-cheng.lin130@zte.com.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cheng, thanks for the patch! On Fri, Nov 30, 2018 at 02:35:17PM +0800, Cheng Lin wrote: > If the number of input parameters is less than the total > parameters, an INVAL error will be returned. Do you mean EINVAL? > This patch ensure no error returned in this condition, just > like other interfaces do. Have an actual example to reproduce? Luis > 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 >