From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 19B8B208CD; Mon, 31 Jul 2017 09:27:31 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 31 Jul 2017 09:27:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=+NLNQxY4O3j/Aob n07m2VgjTSSUyxZiZM15qgTxh3Xg=; b=H//NavnExkzdyMoTun67G8S54TgXHXS AdIHyiZjlQJwMf/L6AWQPdoTYtwpalXTWGm2BGB7ltFxF6suMZYij7zZdo48b4fX 3AV0sMlghRlwTZ/6+3EGpMEBwqFWaqJ4/VvfnQAZiWarT7fiKFTBdhOrcq8tZ54f U53XDzw1+tt4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=+NLNQxY4O3j/Aobn07m2VgjTSSUyxZiZM15qgTxh3Xg=; b=phfkXYyt lMzPHSWygo/JfXskLeVlzRkD6V/rskjrrZnU+uC6RESPbQZvGIqaCdcpo6e7Yniv qfDwGQUXRvCy+3UE1AYbAQJNl8JlSMQDzeKTCrSib8kC9kzWjwDVKJ8HAyXeFtIA lyLqithLzB78mFRJZ5O5ZwucR1DoW7AXHDJ1Z0iK46x2SXpDVmfJP07z1Y8ED4w8 +jQ373WwglD/jEnbwICshxnbpuAfwTHtrU74VubvkYNr+0Uaoji+f1CC6GbskfFx BA8+L0c40shLqVdBtM5iBQgF7iHM8FtWnYf+6XB8ZD9tHjdlGehq99dsNRHOog1c KQK8ZCK6df3pwQ== X-ME-Sender: X-Sasl-enc: IxZYmn/Gej9k1ZnBlPOUXQzvbfyJog3f0zzTbk/ObGDn 1501507650 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 779582478D; Mon, 31 Jul 2017 09:27:30 -0400 (EDT) From: Thomas Monjalon To: Gaetan Rivet Cc: dev@dpdk.org, Ferruh Yigit Date: Mon, 31 Jul 2017 15:27:29 +0200 Message-ID: <3370483.kKZ7asuQTK@xps> In-Reply-To: <1757afd2673591a59ebd69cef7b569d344f20e7c.1501496827.git.gaetan.rivet@6wind.com> References: <1757afd2673591a59ebd69cef7b569d344f20e7c.1501496827.git.gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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:27:31 -0000 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?