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 29CCDA0545; Tue, 21 Jun 2022 16:37:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B573F4069C; Tue, 21 Jun 2022 16:37:09 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id D2B5D40151 for ; Tue, 21 Jun 2022 16:37:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655822228; x=1687358228; h=from:to:cc:subject:date:message-id; bh=LuhB50OiwBjKtXFEBoU9niyBCLbI6tKFPGuvzayL9NQ=; b=lEzncMZ03/2j0hMOAZ5Ecq4l3sgb0oRpRvSs3Dnw6RMOg3YQ9ctfeveZ NNbAQiegAmU4fcs9RlfzD2jOKB6t/QFLXZuZu5FXVfsC61GVmHS5t1BXg ThTXFX5tXBvnV35OB9AYa46XKdxxncMM3o49pjjMqKt5Uwu6tbpz6Vgpm v8uK6jd0x1PEbhX2i7WVKAC6XiM98FMjgHFXfdoW6XHKxNNKLdY4C5BH2 QF7A06DkAvcEzGcvITDNIdqYw2m1iRS0m8nBPHbMbCxipiL87mh6rV53c wYCH++U8RXn7WwiZfQzd9kKRK79mlTEbwQiCfKm4Zga5Y6a+Hnjig84NJ A==; X-IronPort-AV: E=McAfee;i="6400,9594,10384"; a="366457041" X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="366457041" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2022 07:37:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,209,1650956400"; d="scan'208";a="689965474" Received: from dpdk-dipei.sh.intel.com ([10.67.110.238]) by fmsmga002.fm.intel.com with ESMTP; 21 Jun 2022 07:37:05 -0700 From: Andy Pei To: dev@dpdk.org Cc: chenbo.xia@intel.com, maxime.coquelin@redhat.com, rosen.xu@intel.com, qimaix.xiao@intel.com Subject: [PATCH] vdpa/ifc: fix vhost message size check issue Date: Tue, 21 Jun 2022 21:46:31 +0800 Message-Id: <1655819191-124476-1-git-send-email-andy.pei@intel.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org For vhost message VHOST_USER_GET_CONFIG, we do not check payload size in vhost lib, we check payload size in driver specific ops. For ifc vdpa driver, we just need to make sure payload size is not smaller than sizeof(struct virtio_blk_config). Fixes: 856d03bcdc54 ("vdpa/ifc: add block operations") Signed-off-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 8bc971c..ac42de9 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -1400,7 +1400,7 @@ struct rte_vdpa_dev_info { uint64_t capacity = 0; uint8_t *byte; - if (size != sizeof(struct virtio_blk_config)) { + if (size < sizeof(struct virtio_blk_config)) { DRV_LOG(ERR, "Invalid len: %u, required: %u", size, (uint32_t)sizeof(struct virtio_blk_config)); return -1; -- 1.8.3.1