From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 758E6A0503 for ; Thu, 19 May 2022 14:22:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 680B541156; Thu, 19 May 2022 14:22:06 +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 A97D140DF7 for ; Thu, 19 May 2022 14:22:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652962924; 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=FpAL3m3uehIUFeXEzGoPH8lCDlcL2PLZn6dgYIgg0fQ73qXnGgpQZEcN1iky+xBO40CQKM FSIOhHPkO82Dmp8W68Fj/PlVNCDC/xOxVEkhVSHKDgH4yicxYEdRZexcYUerdi3gs8Ri8Z qHE3gCRi03EkNdQQkM9DxNAo0NwnjBY= 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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; -- 2.36.1