From patchwork Thu Aug 24 20:09:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Darrell Ball X-Patchwork-Id: 805653 X-Patchwork-Delegate: dlu998@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=onevmw.onmicrosoft.com header.i=@onevmw.onmicrosoft.com header.b="CRGZsBua"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xdb9N0yZpz9sRq for ; Fri, 25 Aug 2017 06:14:15 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 34C2C927; Thu, 24 Aug 2017 20:14:11 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 101277A4 for ; Thu, 24 Aug 2017 20:14:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0089.outbound.protection.outlook.com [104.47.40.89]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A1FD2D4 for ; Thu, 24 Aug 2017 20:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bzts5fzeJm30Pn8sHERpWhAjOBugcNub4+7R8ezPk0k=; b=CRGZsBua/Vs5erR1YW0bLzaubkgiOSjmtE/qHiB3w2kZJeSZDE1l7pBlyMaDT5HPDwbhLd6Z9JG1BSp9GWmqoXFDJ1iaJbj2BMig+93YUAb6DF9+Y0QNZuqqh7sV80DxLnIXX/MzYRmlToA1d2Pxfn56BZc9PLMT7JC3+5nVpU8= Received: from BLUPR05MB611.namprd05.prod.outlook.com (10.141.204.27) by BLUPR05MB248.namprd05.prod.outlook.com (10.255.191.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.4; Thu, 24 Aug 2017 20:09:07 +0000 Received: from BLUPR05MB611.namprd05.prod.outlook.com ([10.141.204.27]) by BLUPR05MB611.namprd05.prod.outlook.com ([10.141.204.27]) with mapi id 15.20.0013.001; Thu, 24 Aug 2017 20:09:07 +0000 From: Darrell Ball To: huanglili , "dev@openvswitch.org" Thread-Topic: [ovs-dev] [PATCH] conntrack: Fix ct-clean thread crash bug Thread-Index: AQHTHMVbbWpw26YFNU6zWTaOnU6AYqKTV42AgAAjPYA= Date: Thu, 24 Aug 2017 20:09:07 +0000 Message-ID: <1EA5CE28-AA96-4E44-8FBA-B3564653F507@vmware.com> References: <1503570974-2456-1-git-send-email-huanglili.huang@huawei.com> <22366B12-B3BD-433F-AB69-62C3AA461784@vmware.com> In-Reply-To: <22366B12-B3BD-433F-AB69-62C3AA461784@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/f.23.0.170610 authentication-results: spf=none (sender IP is ) smtp.mailfrom=dball@vmware.com; x-originating-ip: [73.162.236.45] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BLUPR05MB248; 20:bvj164kO+lI0+n3uCJoMAmCag9pcW/Q7DKa4C7IBKAok7Q/ROuLNktukHGT6iYyHwEADekUIWpDXKZAuSLHCenpZfaBlZw1+k/rXpES1LX8OGwPtjShCO2HxrKpKUVoP/Z0lZZnNS/jSwYK9MEhMIqH7TLSzNDe2aYluWo35rmQ= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: ffea867e-bd63-43c1-c78e-08d4eb2bfa0a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BLUPR05MB248; x-ms-traffictypediagnostic: BLUPR05MB248: x-exchange-antispam-report-test: UriScan:(61668805478150)(10436049006162)(216315784871565)(50582790962513); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR05MB248; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR05MB248; x-forefront-prvs: 04097B7F7F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(24454002)(189002)(199003)(377454003)(189998001)(83506001)(2950100002)(82746002)(2906002)(33656002)(4001350100001)(6246003)(305945005)(2501003)(4326008)(25786009)(7736002)(97736004)(3660700001)(83716003)(2900100001)(36756003)(66066001)(3280700002)(81156014)(81166006)(76176999)(54356999)(8676002)(50986999)(478600001)(6306002)(53936002)(8936002)(105586002)(101416001)(106356001)(5660300001)(229853002)(86362001)(68736007)(3846002)(99286003)(53546010)(6486002)(6506006)(575784001)(6116002)(102836003)(14454004)(966005)(6512007)(77096006)(6436002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB248; H:BLUPR05MB611.namprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <5BDD6F64D6763F49B1E92582A5D49E71@namprd05.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Aug 2017 20:09:07.5964 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB248 Cc: "blp@nicira.com" Subject: Re: [ovs-dev] [PATCH] conntrack: Fix ct-clean thread crash bug X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org On 8/24/17, 11:03 AM, "Darrell Ball" wrote: Thanks for testing. I’ll look at in detail and get back to you today. Darrell On 8/24/17, 3:36 AM, "ovs-dev-bounces@openvswitch.org on behalf of huanglili" wrote: From: Lili Huang Conn should be removed from the list before freed. This crash will be triggered when a established flow do ct(nat) again, like "ip,actions=ct(table=1) table=1,in_port=1,ip,actions=ct(commit,nat(dst=5.5.5.5)),2 table=1,in_port=2,ip,ct_state=+est,actions=1 table=1,in_port=1,ip,ct_state=+est,actions=2" Signed-off-by: Lili Huang --- lib/conntrack.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/conntrack.c b/lib/conntrack.c index 1c0e023..dd73e1a 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -779,6 +779,8 @@ conn_not_found(struct conntrack *ct, struct dp_packet *pkt, ct, nc, conn_for_un_nat_copy); if (!nat_res) { + ovs_list_remove(&nc->exp_node); + ctx->conn = NULL; goto nat_res_exhaustion; } Hi Lily Does the below alternative work for you ? Thank you Darrell -- 1.8.3.1 _______________________________________________ dev mailing list dev@openvswitch.org https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.org_mailman_listinfo_ovs-2Ddev&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=BVhFA09CGX7JQ5Ih-uZnsw&m=SFTrBlBXqEC4qsGMh3ikI8j9tYy0Wbb5Vt9FXlMqNDI&s=d9q2ZnEz8iZ2cJuZ5tAFpEMdeP45pFBeL_FmBSjyCv4&e= diff --git a/lib/conntrack.c b/lib/conntrack.c index 1c0e023..4918aaf 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -805,6 +805,7 @@ conn_not_found(struct conntrack *ct, struct dp_packet *pkt, * against with firewall rules or a separate firewall. * Also using zone partitioning can limit DoS impact. */ nat_res_exhaustion: + ovs_list_remove(&nc->exp_node); delete_conn(nc); /* conn_for_un_nat_copy is a local variable in process_one; this * memset() serves to document that conn_for_un_nat_copy is from