From patchwork Thu Jan 20 13:04:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1582131 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NOQFL8ln; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JfjQz0x8nz9sXM for ; Fri, 21 Jan 2022 00:04:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D575460F1D; Thu, 20 Jan 2022 13:04:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ouUe5kPA8oVi; Thu, 20 Jan 2022 13:04:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2425660597; Thu, 20 Jan 2022 13:04:55 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E7EE6C0039; Thu, 20 Jan 2022 13:04:54 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 14DDFC002F for ; Thu, 20 Jan 2022 13:04:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E8CAA8302F for ; Thu, 20 Jan 2022 13:04:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zzLccUlzcvqD for ; Thu, 20 Jan 2022 13:04:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 57C1582F84 for ; Thu, 20 Jan 2022 13:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642683892; 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: content-transfer-encoding:content-transfer-encoding; bh=h8do8kBxz/VPvq9VP4IjhuWq2POWpqYvhzPlO9lPXZw=; b=NOQFL8lnaZYM0EDcN8apwrItR/cFFqX8oBuTnFU1BExekx8XpWSCXhK5/3m6ZPSb+I9OEu MJIRexAI6jDzPfAp6ItcecbQJEoOv3dpMmCGqJ+vhjurVmeStRFqBkZ/5R5JoKf10PICVD 452CiYDpq3TIB6FFhYuqmgEBzuFDowE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-342-Y3tDVa7UMn6dey0MmOmbgw-1; Thu, 20 Jan 2022 08:04:49 -0500 X-MC-Unique: Y3tDVa7UMn6dey0MmOmbgw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4C1B86A8A0; Thu, 20 Jan 2022 13:04:47 +0000 (UTC) Received: from dceara.remote.csb (unknown [10.39.192.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3728170386; Thu, 20 Jan 2022 13:04:47 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Thu, 20 Jan 2022 14:04:40 +0100 Message-Id: <20220120130440.32653-1-dceara@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH] ovsdb-idl: ovsdb_idl_loop_destroy must also destroy the committing txn. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Found by AddressSanitizer when running OVN tests: Direct leak of 64 byte(s) in 1 object(s) allocated from: #0 0x498fb2 in calloc (/home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/ic/ovn-ic+0x498fb2) #1 0x5f681e in xcalloc__ /home/runner/work/ovn/ovn/ovs/lib/util.c:121:31 #2 0x5f681e in xzalloc__ /home/runner/work/ovn/ovn/ovs/lib/util.c:131:12 #3 0x5f681e in xzalloc /home/runner/work/ovn/ovn/ovs/lib/util.c:165:12 #4 0x5e3697 in ovsdb_idl_txn_add_map_op /home/runner/work/ovn/ovn/ovs/lib/ovsdb-idl.c:4057:29 #5 0x4d3f25 in update_isb_pb_external_ids /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:576:5 #6 0x4cc4cc in create_isb_pb /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:716:5 #7 0x4cc4cc in port_binding_run /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:803:21 #8 0x4cc4cc in ovn_db_run /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:1700:5 #9 0x4c9c1c in main /home/runner/work/ovn/ovn/ovn-21.12.90/_build/sub/../../ic/ovn-ic.c:1984:17 #10 0x7f9ad9f4a0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) Signed-off-by: Dumitru Ceara --- lib/ovsdb-idl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index b7ba25eca6b5..46f51a527356 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -4242,6 +4242,10 @@ void ovsdb_idl_loop_destroy(struct ovsdb_idl_loop *loop) { if (loop) { + if (loop->committing_txn) { + ovsdb_idl_txn_abort(loop->committing_txn); + ovsdb_idl_txn_destroy(loop->committing_txn); + } ovsdb_idl_destroy(loop->idl); } }