From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [dpdk-stable] [PATCH v2] ethdev: fix invalid length write on dev detach Date: Mon, 31 Jul 2017 16:18:11 +0200 Message-ID: <3471108.DBEpgv82Pf@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: stable@dpdk.org, dev@dpdk.org, Ferruh Yigit To: Gaetan Rivet Return-path: In-Reply-To: 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 15:40, 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. > > Fixes: a1e7c17555e8 ("ethdev: use device name from device structure") > Cc: stable@dpdk.org > Cc: Ferruh Yigit > > Signed-off-by: Gaetan Rivet Applied, thanks