From mboxrd@z Thu Jan 1 00:00:00 1970 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 8D508C433FE for ; Wed, 12 Oct 2022 12:15:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229757AbiJLMPw (ORCPT ); Wed, 12 Oct 2022 08:15:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbiJLMPu (ORCPT ); Wed, 12 Oct 2022 08:15:50 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45842B40CC for ; Wed, 12 Oct 2022 05:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665576948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HWppM9e4/cjX3NwOAsXMCO6iSIiQ/EeeKOofhtTvcjI=; b=VnYhqaOxwZQH7ugyJuU+LudNUjhlY457bOHq7HKGDbtkZDMyWHbsGKXPz21x2Ws4IRwNv5 mv0sf62kcdllhYg7l+7dhkuGtpF1Q0mrnGXoSz7QXq7bXTqLQthUq5k6CWZRCln2e8LtgK wXMsd56rIp7f456UsLUDbgmqTjvK9x0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-164-J2YdFhuJM1KrTg9zS1vCWw-1; Wed, 12 Oct 2022 08:15:44 -0400 X-MC-Unique: J2YdFhuJM1KrTg9zS1vCWw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE3C1185A7A3; Wed, 12 Oct 2022 12:15:43 +0000 (UTC) Received: from RHTPC1VM0NT (unknown [10.22.32.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 185DF111DCE0; Wed, 12 Oct 2022 12:15:42 +0000 (UTC) From: Aaron Conole To: Xin Long Cc: network dev , dev@openvswitch.org, Florian Westphal , Ilya Maximets , Eric Dumazet , kuba@kernel.org, Paolo Abeni , davem@davemloft.net, Pablo Neira Ayuso Subject: Re: [ovs-dev] [PATCH net] openvswitch: add nf_ct_is_confirmed check before assigning the helper References: Date: Wed, 12 Oct 2022 08:15:42 -0400 In-Reply-To: (Xin Long's message of "Thu, 6 Oct 2022 15:45:02 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Xin Long writes: > A WARN_ON call trace would be triggered when 'ct(commit, alg=helper)' > applies on a confirmed connection: > > WARNING: CPU: 0 PID: 1251 at net/netfilter/nf_conntrack_extend.c:98 > RIP: 0010:nf_ct_ext_add+0x12d/0x150 [nf_conntrack] > Call Trace: > > nf_ct_helper_ext_add+0x12/0x60 [nf_conntrack] > __nf_ct_try_assign_helper+0xc4/0x160 [nf_conntrack] > __ovs_ct_lookup+0x72e/0x780 [openvswitch] > ovs_ct_execute+0x1d8/0x920 [openvswitch] > do_execute_actions+0x4e6/0xb60 [openvswitch] > ovs_execute_actions+0x60/0x140 [openvswitch] > ovs_packet_cmd_execute+0x2ad/0x310 [openvswitch] > genl_family_rcv_msg_doit.isra.15+0x113/0x150 > genl_rcv_msg+0xef/0x1f0 > > which can be reproduced with these OVS flows: > > table=0, in_port=veth1,tcp,tcp_dst=2121,ct_state=-trk > actions=ct(commit, table=1) > table=1, in_port=veth1,tcp,tcp_dst=2121,ct_state=+trk+new > actions=ct(commit, alg=ftp),normal > > The issue was introduced by commit 248d45f1e193 ("openvswitch: Allow > attaching helper in later commit") where it somehow removed the check > of nf_ct_is_confirmed before asigning the helper. This patch is to fix > it by bringing it back. > > Fixes: 248d45f1e193 ("openvswitch: Allow attaching helper in later commit") > Reported-by: Pablo Neira Ayuso > Signed-off-by: Xin Long > --- Thanks for all the help, I was able to reproduce the warning. Looking at it, I'm not sure why the check for confirmed was removed. I did some additional testing with common scenarios, some testing with bare DP flows, and I think it is good to apply. Acked-by: Aaron Conole Tested-by: Aaron Conole