Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3325067rwa; Tue, 23 Aug 2022 02:52:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR6QTsUA+qHAtRMDTEuOoXCodMTnU+I13z++t6ipiww4WZJZv65R6Cy3iLjiEP/JME2JEkLU X-Received: by 2002:a17:90b:1b11:b0:1fb:65ea:59a2 with SMTP id nu17-20020a17090b1b1100b001fb65ea59a2mr1764143pjb.79.1661248372357; Tue, 23 Aug 2022 02:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248372; cv=none; d=google.com; s=arc-20160816; b=mry1i4TDrqrjCVb2tAxiYjCma8L+mmGRD9s9IJvuy3ETLnpMMeZFzBX8xWb95NeMs/ S1Fz0EM2XxNUywQIUisHfY197XnnW3r1IB9wc1lFduFjqrlHn79TivoNWYw/obxyDPR5 XMfND2oEkToDY+2Dep1MmbtwAICr+1IRfT6ilbxl7Dv4k4gyQqwUuSfyAPwbF21fFT1L /IUkqgQ+8/phLUTQbrXZFmMYt1vQBhiDp19a90kUSzShWUxxAdCBcskpmXtwQUjXLDLT of1+0Z4JygqrXM7X9ScaFKIenkdX2Qk0B9k3xrDtWn1SxrfUX3veSCr80UiRHeoajJx1 fL8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lzn9UNb3ZX9a+SjwUbXnaTUREfP0OjO6ym/DDNum4DU=; b=U3u2vlUHWogDyeriAK43BENmkDTT1YqhLC5MQ7kNZFHbiYpzN23yuEUDHRcn+CmteH 0AYlXD0rtD3dt+3kkbC2wWtpyNDX4qWfbckU6oIzp4R6LnRrapXqTQBzXkgRUmvMwMvp 2RRZJAoE9RvNTSqv8RQ9F+wGfkK64wUW9TyuPA1zsLbdbDBeWZm/fy/Kf6i4jSvaSr8Q oXSq+R3/hbfhQwH2mIaHw2dH3xShcUcnDNebO6Gh9A4thV1Yuq/xw+WjdCAKAiu4L8xl gXQaPrSeSgQSnsSqL6Vm5kI3SxT1JVEQgAeWZuNk+SKpS3G1Kv0P3QjJ+350Isz6A/Ee Oxag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JdpqhKms; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w14-20020a637b0e000000b0041bf27ac6e2si15612460pgc.730.2022.08.23.02.52.42; Tue, 23 Aug 2022 02:52:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JdpqhKms; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241515AbiHWJD0 (ORCPT + 99 others); Tue, 23 Aug 2022 05:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347592AbiHWJCZ (ORCPT ); Tue, 23 Aug 2022 05:02:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A99261401E; Tue, 23 Aug 2022 01:28:38 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id CDB63B81C50; Tue, 23 Aug 2022 08:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 307CEC433D6; Tue, 23 Aug 2022 08:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243316; bh=fqNDSaCK4HPU8qg6GanO+klTFgDMUje6BBch7RkMJSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JdpqhKmse9y0sJz1R8E9+aweaS83y9IhaxgeTp7/yPz0e8R8cA5QE1AdtnhEbUj99 r+qU04GUwJ3bXhu4EfSy+sgMYdvnG39TGEy8XvL5m/uufpCUmMe3acMvvSNFEYRvOD 4QOf1OMptsvTiNuYAZ21jWBKrc6K1tA/KVtOEDf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 5.19 198/365] netfilter: nf_tables: fix scheduling-while-atomic splat Date: Tue, 23 Aug 2022 10:01:39 +0200 Message-Id: <20220823080126.512557000@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Westphal commit 2024439bd5ceb145eeeb428b2a59e9b905153ac3 upstream. nf_tables_check_loops() can be called from rhashtable list walk so cond_resched() cannot be used here. Fixes: 81ea01066741 ("netfilter: nf_tables: add rescheduling points during loop detection walks") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_tables_api.c | 4 ---- 1 file changed, 4 deletions(-) --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -9372,13 +9372,9 @@ static int nf_tables_check_loops(const s break; } } - - cond_resched(); } list_for_each_entry(set, &ctx->table->sets, list) { - cond_resched(); - if (!nft_is_active_next(ctx->net, set)) continue; if (!(set->flags & NFT_SET_MAP) ||