From patchwork Thu Feb 3 12:41:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Westphal X-Patchwork-Id: 539856 Return-Path: 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 EFC77C433F5 for ; Thu, 3 Feb 2022 12:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235578AbiBCMmF (ORCPT ); Thu, 3 Feb 2022 07:42:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbiBCMmF (ORCPT ); Thu, 3 Feb 2022 07:42:05 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D6CFC061714; Thu, 3 Feb 2022 04:42:05 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1nFbR5-0000XM-Ky; Thu, 03 Feb 2022 13:42:03 +0100 From: Florian Westphal To: Cc: , Florian Westphal Subject: [PATCH 4.14.y 0/2] netfilter: nat: fix soft lockup when most ports are used Date: Thu, 3 Feb 2022 13:41:53 +0100 Message-Id: <20220203124155.16693-1-fw@strlen.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org First patch removes old rovers, they are inherently racy and cause packet drops/delays. Second patch avoids iterating entire range of ports: It takes way too long when most tuples are in use. First patch is slightly mangled; nf_nat_proto_common.c needs minor adjustment in context. Florian Westphal (2): netfilter: nat: remove l4 protocol port rovers netfilter: nat: limit port clash resolution attempts include/net/netfilter/nf_nat_l4proto.h | 2 +- net/netfilter/nf_nat_proto_common.c | 36 ++++++++++++++++++-------- net/netfilter/nf_nat_proto_dccp.c | 5 +--- net/netfilter/nf_nat_proto_sctp.c | 5 +--- net/netfilter/nf_nat_proto_tcp.c | 5 +--- net/netfilter/nf_nat_proto_udp.c | 10 ++----- 6 files changed, 31 insertions(+), 32 deletions(-)