From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] ethdev: fix invalid length write on dev detach Date: Mon, 31 Jul 2017 15:27:29 +0200 Message-ID: <3370483.kKZ7asuQTK@xps> References: <1757afd2673591a59ebd69cef7b569d344f20e7c.1501496827.git.gaetan.rivet@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Ferruh Yigit To: Gaetan Rivet Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 94EE9235 for ; Mon, 31 Jul 2017 15:27:31 +0200 (CEST) In-Reply-To: <1757afd2673591a59ebd69cef7b569d344f20e7c.1501496827.git.gaetan.rivet@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 31/07/2017 12:29, Gaetan Rivet: > The name of a device is copied in a provided buffer within > rte_eth_dev_detach(). The current sizeof is done on a pointer instead of > the intended array usually pointed to. > > The name field of an rte_device is not assured however to point an > rte_devargs name field. The almost correct length to base this copy over > is thus RTE_DEV_NAME_MAX_LEN. > > Almost correct, because unfortunately this function does not allow the > user to pass down a size parameter for the buffer it is meant to write. > This API should be fixed, it is broken by design. Yes we must discuss the future of this API function. In the meantime, this limitation (size expectation) should be documented in the doxygen comment. v2 please?