linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] proc/sysctl: fix return error for proc_doulongvec_minmax
@ 2018-11-30  6:35 Cheng Lin
  2018-11-30 19:14 ` Luis Chamberlain
  0 siblings, 1 reply; 5+ messages in thread
From: Cheng Lin @ 2018-11-30  6:35 UTC (permalink / raw)
  To: mcgrof
  Cc: keescook, linux-kernel, linux-fsdevel, zhong.weidong, wang.yi59,
	Cheng Lin

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 <cheng.lin130@zte.com.cn>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-05 23:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-30  6:35 [PATCH] proc/sysctl: fix return error for proc_doulongvec_minmax Cheng Lin
2018-11-30 19:14 ` Luis Chamberlain
     [not found]   ` <201812031312398404610@zte.com.cn>
2018-12-03 20:14     ` Luis Chamberlain
     [not found]       ` <201812051510071985717@zte.com.cn>
2018-12-05 18:08         ` Re: Re: [PATCH] proc/sysctl: fix return error forproc_doulongvec_minmax Luis Chamberlain
2018-12-05 23:30       ` Re: [PATCH] proc/sysctl: fix return error for proc_doulongvec_minmax Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).