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 9A41BA0548; Thu, 1 Apr 2021 14:04:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2643514110E; Thu, 1 Apr 2021 14:04:27 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id E049A14110D for ; Thu, 1 Apr 2021 14:04:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617278665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n4vnIz/Ophvmw/yJLnoqfX/DlNtiChrFxFlNmlTJE8o=; b=Hvd+1dIu/+xuwnYunMeVFZBPgQrLebA0u78QbSL4G12Rw5jtCHpWRMXueuvAlJRyoW/0Su mYYStYAMflfQh6qzWUVMYG5+Nfck5W66492qrfJ+cHpCxZBgiz3Sh2yQxhcH/W9EePYgMw 0NbJZW03ehHSVpIFEl4R34jsb8e8TBQ= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-454-jgPZFJiPNuOfDnY5d5c0Aw-1; Thu, 01 Apr 2021 08:04:23 -0400 X-MC-Unique: jgPZFJiPNuOfDnY5d5c0Aw-1 Received: by mail-vk1-f200.google.com with SMTP id k198so1696852vke.12 for ; Thu, 01 Apr 2021 05:04:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n4vnIz/Ophvmw/yJLnoqfX/DlNtiChrFxFlNmlTJE8o=; b=kyR3xt66x+vnfoA47ywLDZll0yjmEHpjof15eaih8edmzVvUBQqpYA/QFYH60EHYSA 9iXy4xJARwNw3GLGZJYogW2P+Mhywv7ynPHvYsP2vWYIe54+fOpeRQAcmdx+c3JuNGiZ dg+AlB685etkyILMMGNIVnn2qGWcMGoeEAGatEsrLsblJXTw+BM0eu+LBYnt447swI3P QDwfVdRsPU/+7MS/ff2ZRfLzZxYpCj+ligx8LdWdsC/kjMOyW7kCWq14IgRNAicVhd7p aYunW9Lu0bl5NgqS3XMJ4JsPDqlRrOUMrsFAKNp5k0tCx0fm0NTJK0Bs9B3Ibu8waxq/ ucnQ== X-Gm-Message-State: AOAM531dYFfWVdkqic6uaAq3BXCdcYwBD0P5NXRRyNBF2PzI9uQyhSvw qveRFjlqHoOOORSBsW29VDCCezhnPKv404jsUBGM//dDzSAVpgTqyXEIvohX+3d/NEmn+HEAHFa ZAUGRMRLoSMCHwX4pbJ0= X-Received: by 2002:a05:6102:3594:: with SMTP id h20mr4594387vsu.10.1617278662921; Thu, 01 Apr 2021 05:04:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkHbAitG/AB/fQStVUqRMTCqmCafZVVy251VVLrKDB8JHxjTOztJMagX5spGeMnn1XDhn4rqtCF+xDl88NqQs= X-Received: by 2002:a05:6102:3594:: with SMTP id h20mr4594338vsu.10.1617278662584; Thu, 01 Apr 2021 05:04:22 -0700 (PDT) MIME-Version: 1.0 References: <20210311063827.55394-1-xiao.w.wang@intel.com> <20210317063109.135662-1-xiao.w.wang@intel.com> In-Reply-To: <20210317063109.135662-1-xiao.w.wang@intel.com> From: David Marchand Date: Thu, 1 Apr 2021 14:04:10 +0200 Message-ID: To: Xiao Wang Cc: "Xia, Chenbo" , Maxime Coquelin , Marvin Liu , dev , "Ananyev, Konstantin" , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3] vhost: add header check in dequeue offload 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 Sender: "dev" On Wed, Mar 17, 2021 at 7:50 AM Xiao Wang wrote: > > When parsing the virtio net header and packet header for dequeue offload, > we need to perform sanity check on the packet header to ensure: > - No out-of-boundary memory access. > - The packet header and virtio_net header are valid and aligned. > > Fixes: d0cf91303d73 ("vhost: add Tx offload capabilities") > Cc: stable@dpdk.org > > Signed-off-by: Xiao Wang I spent some time digging on this topic. Afaiu the offload API, vhost is not supposed to populate tx offloads. I would drop this whole parse_ethernet function and replace vhost_dequeue_offload with what virtio does on the rx side. Please have a look at this series (especially the last patch): http://patchwork.dpdk.org/project/dpdk/list/?series=16052 Thanks. -- David Marchand