From patchwork Wed Jun 26 13:30:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1952633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=DjnmcZm6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W8MyY64C9z20X1 for ; Wed, 26 Jun 2024 23:30:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C9C2A40D97; Wed, 26 Jun 2024 13:30:27 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id qUa5BJSPfgfl; Wed, 26 Jun 2024 13:30:26 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A8B6640D57 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DjnmcZm6 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id A8B6640D57; Wed, 26 Jun 2024 13:30:25 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 46700C002B; Wed, 26 Jun 2024 13:30:25 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 66C71C0078 for ; Wed, 26 Jun 2024 13:30:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3AF8C81F95 for ; Wed, 26 Jun 2024 13:30:21 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ob_tlnvcOQ9Q for ; Wed, 26 Jun 2024 13:30:20 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=amusil@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 43DAF81D5F Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 43DAF81D5F Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DjnmcZm6 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 43DAF81D5F for ; Wed, 26 Jun 2024 13:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719408619; 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: in-reply-to:in-reply-to:references:references; bh=9XwXc95PBpj0MtVT8DBB+XZnzQPjM0U4xMmLOZZzCq4=; b=DjnmcZm6UMJdYssNInMoNy4HIXcO9LwMnfBoCp/XsgFAGTd6a9ROJHv+7dPaQvbFsgzrNI tLYnro/m3cFQAwX2vU9LZj9z9EKPHfFm057po4aD0lOmC+pUiXERPBXyTopfsgwHPxVsVQ 1XXQICJWbtd/mp0mNLQw9BhQKlAk7uE= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-686-opYbEFhsMTC9ZrCXF6qYPw-1; Wed, 26 Jun 2024 09:30:17 -0400 X-MC-Unique: opYbEFhsMTC9ZrCXF6qYPw-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D344719560B2 for ; Wed, 26 Jun 2024 13:30:16 +0000 (UTC) Received: from amusil.brq.redhat.com (unknown [10.43.17.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9489E3000225; Wed, 26 Jun 2024 13:30:15 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Wed, 26 Jun 2024 15:30:07 +0200 Message-ID: <20240626133007.694177-5-amusil@redhat.com> In-Reply-To: <20240626133007.694177-1-amusil@redhat.com> References: <20240626133007.694177-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 4/4] treewide: Prevent potential NULL ptr deref. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dceara@redhat.com Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Prevent potential NULL ptr deref that might have happened in corner case. Signed-off-by: Ales Musil --- northd/northd.c | 2 +- utilities/ovn-ic-nbctl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 7e474a7b8..b4d8e069b 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -16180,8 +16180,8 @@ build_lflows_thread(void *arg) &lsi->actions); } } + lsi->thread_lflow_counter = thread_lflow_counter; } - lsi->thread_lflow_counter = thread_lflow_counter; post_completed_work(control); } return NULL; diff --git a/utilities/ovn-ic-nbctl.c b/utilities/ovn-ic-nbctl.c index 4317c385a..77a69df0b 100644 --- a/utilities/ovn-ic-nbctl.c +++ b/utilities/ovn-ic-nbctl.c @@ -821,7 +821,7 @@ do_ic_nbctl(const char *args, struct ctl_command *commands, size_t n_commands, const struct icnbrec_ic_nb_global *inb = icnbrec_ic_nb_global_first(idl); if (!inb) { /* XXX add verification that table is empty */ - icnbrec_ic_nb_global_insert(txn); + inb = icnbrec_ic_nb_global_insert(txn); } if (wait_type != NBCTL_WAIT_NONE) {