Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1588191pxy; Thu, 6 May 2021 10:54:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws0saqA0pld4FNL8Nqd83y09+unPxHS9/pp3zKyJn+QWCIgMDJ3H4IBJdwmLT8RvVXx304 X-Received: by 2002:a17:906:6ad0:: with SMTP id q16mr5930565ejs.286.1620323653985; Thu, 06 May 2021 10:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620323653; cv=none; d=google.com; s=arc-20160816; b=WZO1Yxquf7FrdIAwAuav8NCzzYCzLo41xj+yAf8DVa7+Xqr7e+wIrsO7JAXSnNg30g UqRd4rX9qL0akIoPNydGSZ1yBUitCvW+fInhKvsZsmOx2+QSs45TW+J3ZaBGnFnyN0g+ +5H9pdk7uI/dZdVMI7aryEV7715hQ2i4t12V+nWvV/Vvxotepx0gCCNyUM33Ku2Ywf34 E0tlzBJLdaVr+2si0L7Al1EDTJQWRJK/qG3PrVTajsPKcIK7oWaxXEvG0Y+6DOqk0AZo 28vCxD9lML6Q+p1W9nVQO924hgbI6Wjq2sILGijW/yn2ogK9Z5WrkuEIh//g5hww6pYl f5NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=jZ25V5gFIEZP6ukMOMeThXYzSrrigmzcHYTAxDcrK/U=; b=fztcY/sPXcJSlBirDTWAPYkAkKlin/Js1ZGJ/1FxGkVlWgu9m5iaiqoK3Z0ei7EDuG xoGRez640rhAcbaIXcDbcspBnsDcxFyQtCPwqn23HWqIzn7HteS0s/ewCKyoiwCpYN71 GGdxgyIpD/mbf07jcrCey4PtpTTwcTZKRhzGLr+ebGkctmVLs4vD07S3LNtYZi0eHRLl 7r22flOnSSjiZrWXVaTlQpZ53B5D/tSN/2qmcZK5ooW1bqPqZBlCesHRNgvWDUGa9lvx Ha3LcNDzrjRQtAizHJYGRRXsiQlchUj+ILcySe8nJj2WaOXIoiF0m9gBhZ8r5vHjALwZ VnDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p2si2791958edy.345.2021.05.06.10.53.48; Thu, 06 May 2021 10:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236323AbhEFRus (ORCPT + 99 others); Thu, 6 May 2021 13:50:48 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:42923 "EHLO mail-wr1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236042AbhEFRuq (ORCPT ); Thu, 6 May 2021 13:50:46 -0400 Received: by mail-wr1-f47.google.com with SMTP id l2so6514715wrm.9; Thu, 06 May 2021 10:49:47 -0700 (PDT) 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:in-reply-to; bh=jZ25V5gFIEZP6ukMOMeThXYzSrrigmzcHYTAxDcrK/U=; b=I1EK5mDmaGnPJvraVOO4uFF9dQq9tIL8q4OVfm0aAaFGRa4tmDA6HnVwZlUAYdWy/6 WcL7+2luZAQrYOCOsABrqJUYRZcwg720obSCly2ENPdJ8rsFT9cCOR3yYiXJ7EF2xN5R jrlJqOLFK3Eo7D9lymwXWX+HnXrXZaf6GmpiY0jpQb4cl8OCEnKcxCglCyXSBaH+4p8h +NMYwfM6m+fc3FFFN9E4VhXmk9sC2zXfpx9ez1QUcbTbMHYjayrYJcbfTqNkKwQqLKtQ WSozBJQuXnxkkAmGnzPl0pQrT9dxG8Z+8q/n5JY4JNQpHjPfN/sj8Jl3NFRKYgHsmvuV s4Lw== X-Gm-Message-State: AOAM531qzRlFDwlYmSAlqmQutJaWOz8hbn8UR6ika7rt5Aaqih3oNd31 Hh2giWhFGgBfzqJeubiAAus= X-Received: by 2002:adf:d0cd:: with SMTP id z13mr6883154wrh.373.1620323387206; Thu, 06 May 2021 10:49:47 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id u2sm5530127wmm.5.2021.05.06.10.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 10:49:46 -0700 (PDT) Date: Thu, 6 May 2021 17:49:45 +0000 From: Wei Liu To: "Andrea Parri (Microsoft)" Cc: linux-kernel@vger.kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, davem@davemloft.net, kuba@kernel.org, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-scsi@vger.kernel.org, mikelley@microsoft.com, Andres Beltran Subject: Re: [PATCH hyperv-next] Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer Message-ID: <20210506174945.5vp72zn44uu7xkd5@liuwe-devbox-debian-v2> References: <20210408161439.341988-1-parri.andrea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210408161439.341988-1-parri.andrea@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 06:14:39PM +0200, Andrea Parri (Microsoft) wrote: > From: Andres Beltran > > Pointers to ring-buffer packets sent by Hyper-V are used within the > guest VM. Hyper-V can send packets with erroneous values or modify > packet fields after they are processed by the guest. To defend > against these scenarios, return a copy of the incoming VMBus packet > after validating its length and offset fields in hv_pkt_iter_first(). > In this way, the packet can no longer be modified by the host. > > Signed-off-by: Andres Beltran > Co-developed-by: Andrea Parri (Microsoft) > Signed-off-by: Andrea Parri (Microsoft) > --- > drivers/hv/channel.c | 9 ++-- > drivers/hv/hv_fcopy.c | 1 + > drivers/hv/hv_kvp.c | 1 + > drivers/hv/hyperv_vmbus.h | 2 +- > drivers/hv/ring_buffer.c | 82 ++++++++++++++++++++++++++----- > drivers/net/hyperv/hyperv_net.h | 7 +++ > drivers/net/hyperv/netvsc.c | 2 + > drivers/net/hyperv/rndis_filter.c | 2 + > drivers/scsi/storvsc_drv.c | 10 ++++ > include/linux/hyperv.h | 48 +++++++++++++++--- > net/vmw_vsock/hyperv_transport.c | 4 +- > 11 files changed, 143 insertions(+), 25 deletions(-) In theory this patch needs acks from network and scsi maintainers, but the changes are so small and specific to Hyper-V drivers. In the interest of making progress, I will be picking up this patch shortly unless I hear objections. Wei.