From cef553009b5181ae3c9f465c0e300ec8c8b37fbd Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Fri, 1 Jun 2018 20:59:14 +0200 Subject: Limit max timeout value to (UINT_MAX >> 1)/MSEC_PER_SEC Due to the negative value condition in msecs_to_jiffies(), the real max possible timeout value must be set to (UINT_MAX >> 1)/MSEC_PER_SEC. Neutron Soutmun proposed the proper fix, but an insufficient one was applied, see https://patchwork.ozlabs.org/patch/400405/. --- lib/parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/parse.c') diff --git a/lib/parse.c b/lib/parse.c index 7cd6436..9a79ccd 100644 --- a/lib/parse.c +++ b/lib/parse.c @@ -1334,7 +1334,7 @@ ipset_parse_timeout(struct ipset_session *session, assert(opt == IPSET_OPT_TIMEOUT); assert(str); - err = string_to_number_ll(session, str, 0, UINT_MAX/1000, &llnum); + err = string_to_number_ll(session, str, 0, (UINT_MAX>>1)/1000, &llnum); if (err == 0) { /* Timeout is expected to be 32bits wide, so we have to convert it here */ -- cgit v1.2.3