Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6270851imu; Mon, 21 Jan 2019 06:09:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN5PfK3VVArW1aEbUF9beNSirmOzdxYRfAsTAr0kBYCWyAXnfRo41SuvUW+AKhlr6be8GmzU X-Received: by 2002:a63:5c41:: with SMTP id n1mr27225742pgm.1.1548079786155; Mon, 21 Jan 2019 06:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548079786; cv=none; d=google.com; s=arc-20160816; b=g02nOtAaA1JOBpfdpaFVWXo6sSJCGw4i5RlUMx6p9V9oK4Oskmxza0w3uzzGpzlySH UJJIeTLmyE4z63axBPxtfNIfRdEBwarvwOQG7wHeYtSVp/hklL42SkCt8p4RhOxDTa19 s6FcdrPHtzlEW/yDmcyHYKRZCtZwyvWAi3Jr+ZQ+ah2YlwOIQEpiBmTSQsaSkXzHN8/j Z2mAM0gPrOo4Ax124jHfqmKWsv5d9N8DZvq01kaPTOjRzCfSQswQaKC75lpAi7tD+MGc SlWbluckYwbkurcLa36iQR25+mULPKt73r7YEXnjcsKRuUsObrY5HovWcls8ooILHYxI PwpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8BxycS4uFCoUKRmLnHSrN9pu3HtLFQ78dGy++AFIVUQ=; b=XXtC1gcTZO0KbCPbnGCgGGpjmq/jKXTT+3OM7RUNbCLsnrRFONkP9tm1cJdikbT6Jf MlJbQQ9bGaD3LyCI+WaG3+ToiO0bwdx1JqGFCDZ/xPiwe4gpIvxKtpfhdJGlB4A/xqOF zR1qMN7PfZHbEvtMXd7zwS1d4tKp/yAQkliePmHcKdxDXzHRs86THdlpTty7ALWJtm6Y N2Tl2AZ/KNEXHNX9GoskUjVmJmE/zlqXixO51dthjzeAhUshEFaNgnvH68tlLdT1fAT4 vJVaYL7ilHqdCG0ZrJXK8OuFWR7vY4s0EQQHYVDBu33R1MzyZ7/an3xC3cRn0AaiA72M YDBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JXitIIj7; 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 u8si13295612plh.385.2019.01.21.06.09.31; Mon, 21 Jan 2019 06:09:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=JXitIIj7; 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 S1731293AbfAUOHG (ORCPT + 99 others); Mon, 21 Jan 2019 09:07:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:46190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730769AbfAUN75 (ORCPT ); Mon, 21 Jan 2019 08:59:57 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 17C9220879; Mon, 21 Jan 2019 13:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548079196; bh=I1Wn7MxKNmvkodZTr1XLq3G0DQ2JfO0w1QH4KNGb4+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JXitIIj7q/QBVQHUdp9qtl7ectLHcUC4a/KBWZr+CRkj172xDDJrrv7qjsyPl8a5o OM7zONrGA6J7BP334AwBWzUeLghPigpIOO2ZUmWrLgqarSucs7ZOBOmrQrUHmqf9Ym Pc5iSXCLxZj5MvIrQkL8SVGSwwJsBvB3+8L4+EX0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shawn Bohrer , Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 4.19 07/99] netfilter: nf_conncount: dont skip eviction when age is negative Date: Mon, 21 Jan 2019 14:47:59 +0100 Message-Id: <20190121134914.197421271@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121134913.924726465@linuxfoundation.org> References: <20190121134913.924726465@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Westphal commit 4cd273bb91b3001f623f516ec726c49754571b1a upstream. age is signed integer, so result can be negative when the timestamps have a large delta. In this case we want to discard the entry. Instead of using age >= 2 || age < 0, just make it unsigned. Fixes: b36e4523d4d56 ("netfilter: nf_conncount: fix garbage collection confirm race") Reviewed-by: Shawn Bohrer Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_conncount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/nf_conncount.c +++ b/net/netfilter/nf_conncount.c @@ -155,7 +155,7 @@ find_or_evict(struct net *net, struct nf const struct nf_conntrack_tuple_hash *found; unsigned long a, b; int cpu = raw_smp_processor_id(); - __s32 age; + u32 age; found = nf_conntrack_find_get(net, &conn->zone, &conn->tuple); if (found)