Message ID | 20220221084917.876437921@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D1BEC433EF for <stable@archiver.kernel.org>; Mon, 21 Feb 2022 09:08:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347748AbiBUJJO (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 21 Feb 2022 04:09:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347800AbiBUJIz (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 21 Feb 2022 04:08:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F56A24BE0; Mon, 21 Feb 2022 01:00:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF73761132; Mon, 21 Feb 2022 09:00:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D36AEC340E9; Mon, 21 Feb 2022 09:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434035; bh=0x6i4OlwnfiUrwgKFWTgJ7ebyVDAj1Ju/6rNnIfShrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KPtNI3+wF+VboUD0Y72V+UyuES9/dj46TfO4NhT/ugSIxq8yb/YPMDKAtqCVNTJW2 9IvvlDF0sB8CZxwWrLPKVhoPGE5/WnLgIbFsXZoC0KJqcb05LkzD5Ulf8/ZoH7Mrdc FJKf+ULFHY3g2IzeNM6ShJ9qelVtAKac3y0TZmuU= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Florian Westphal <fw@strlen.de>, Pablo Neira Ayuso <pablo@netfilter.org>, Sasha Levin <sashal@kernel.org>, Vivek Thrivikraman <vivek.thrivikraman@est.tech> Subject: [PATCH 5.4 70/80] netfilter: conntrack: dont refresh sctp entries in closed state Date: Mon, 21 Feb 2022 09:49:50 +0100 Message-Id: <20220221084917.876437921@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index 810cca24b3990..7626f3e1c70a7 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c @@ -489,6 +489,15 @@ int nf_conntrack_sctp_packet(struct nf_conn *ct, pr_debug("Setting vtag %x for dir %d\n", ih->init_tag, !dir); ct->proto.sctp.vtag[!dir] = ih->init_tag; + + /* don't renew timeout on init retransmit so + * port reuse by client or NAT middlebox cannot + * keep entry alive indefinitely (incl. nat info). + */ + if (new_state == SCTP_CONNTRACK_CLOSED && + old_state == SCTP_CONNTRACK_CLOSED && + nf_ct_is_confirmed(ct)) + ignore = true; } ct->proto.sctp.state = new_state;