From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f171.google.com (mail-wr0-f171.google.com [209.85.128.171]) by dpdk.org (Postfix) with ESMTP id 45D905598 for ; Mon, 31 Jul 2017 15:29:22 +0200 (CEST) Received: by mail-wr0-f171.google.com with SMTP id f21so122819184wrf.5 for ; Mon, 31 Jul 2017 06:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sb9/wL0eHHz4G/bm4T9aD3nlGNIHdeWb0Ni8lPDtIzg=; b=AdLsxc0M+C9wLAjbxTl91jNxgqjczBQGVjIsifo0e2AXCSqv1JqU8Je7BLeUTVoTmx /Ll+fnTug3aFyka3B9UnOV+YqqSyxP7xL4lIy7wenO+GlJc871JRWAMY0Pjt4xTRmbqG MPjjziJPTQvNtYuLVaorBX3ZCpRuuUqJn1K20NGcg2foVRLD2GP5rOpfy9EfjMyYM/QY 67QVBakhCZo/EwSD7XZZ1t1uVVra+oCiZeEOhLJ8RewnIdOysZE916dXH79QBjM0EToR vl3q3gBky55wiMCoBeBpNZ36J88P2ARFgpXXQHajN084XOC4uNZ7saysgpBAu7U6KICl h3Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=sb9/wL0eHHz4G/bm4T9aD3nlGNIHdeWb0Ni8lPDtIzg=; b=RBfa35KUcrX7adOtmRChrPlXY2muum9nC9a+nk9/1J9RYaatLBZF+DW7pMdkZYAPUP 0x3LS2Iuh394O71+UcopGbTAukOM6J1aCntwG4Pv9wAdCGbTqSGmThyYJl1JWOAWPkTe 5cfHtU7xO5GvjhsyLTmCButPpOZ84JpwcYuhqoFUTlZy1q8ht44uuthjhLk9nAtib0BO B2qZ15YRhENmAaArdPm6HuV4YYG3rD/0O8KqSXXjzPIl8Ua2vBVUHw7d34Op5Bjm7U6d KeXeJ77oRONiFV596hkdYj1tnDsckNFixQOBvs+9PlWs8teDobaCNOsCLx6/dIB1kFJk R3VQ== X-Gm-Message-State: AIVw112eBsuEHHQ/HPLwqGQnMykRZhj9MRaZFgq73u5fH5GCQkfe69EL 1gvmOTDfx6PzBH6kgOs= X-Received: by 10.223.183.12 with SMTP id l12mr11612471wre.103.1501507761850; Mon, 31 Jul 2017 06:29:21 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id i7sm26453872wrb.19.2017.07.31.06.29.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 06:29:21 -0700 (PDT) Date: Mon, 31 Jul 2017 15:29:12 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit Message-ID: <20170731132911.GK11154@bidouze.vm.6wind.com> References: <1757afd2673591a59ebd69cef7b569d344f20e7c.1501496827.git.gaetan.rivet@6wind.com> <3370483.kKZ7asuQTK@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3370483.kKZ7asuQTK@xps> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] ethdev: fix invalid length write on dev detach X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2017 13:29:22 -0000 On Mon, Jul 31, 2017 at 03:27:29PM +0200, Thomas Monjalon wrote: > 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? > Sure -- Gaëtan Rivet 6WIND