From patchwork Thu May 19 12:21:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111412 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1BF4AA0503; Thu, 19 May 2022 14:22:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFDA340222; Thu, 19 May 2022 14:22:03 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C046440156 for ; Thu, 19 May 2022 14:22:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652962921; 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=/AbzLy4aXm9JqxM8b3J3cyrwGpekD3z+91t7FtQOt0A=; b=BIEkT7GboraIV5Xm6glx0ssIph9H+36nEjRx01vwJtq2auZZLE/yMEUnJizD2ujNw2RzZ5 FyVhLKchy9R6wPdwES3+xJ+FbocN2rxlD2uyd6ok89MwXPSY3u1A+6O16Rz1sGuTUe9rpu seldc9RdZeGzf+CfbTinx44jUlYKyM8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-qJ0iTt3-Ow2gKakqUuxpww-1; Thu, 19 May 2022 08:21:57 -0400 X-MC-Unique: qJ0iTt3-Ow2gKakqUuxpww-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B387395AFEF; Thu, 19 May 2022 12:21:57 +0000 (UTC) Received: from fchome.home (unknown [10.40.194.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id 95B4A40CF8ED; Thu, 19 May 2022 12:21:54 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Ankur Dwivedi , Jerin Jacob Subject: [PATCH] net/cnxk: fix crash in IPsec telemetry Date: Thu, 19 May 2022 14:21:51 +0200 Message-Id: <20220519122151.3119730-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Calling this telemetry callback with no argument caused a crash. Fixes: 41cc645c214f ("net/cnxk: add inline IPsec telemetry for CN9K") Cc: stable@dpdk.org Signed-off-by: David Marchand --- drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c index dfad5af8fe..bfdbd1ee5d 100644 --- a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c +++ b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c @@ -229,6 +229,9 @@ ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params, uint32_t i; int ret; + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -EINVAL; + port_id = strtoul(params, &end_p, 0); if (errno != 0) return -EINVAL;