Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp496848pxb; Fri, 15 Jan 2021 20:33:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTIDz6Jin8+b9qhs3A4GEStmmtZLS0WN+SdYiz//99XECEmZhuPLQERmEprDN4IWHwkYF9 X-Received: by 2002:a17:906:85cd:: with SMTP id i13mr11214748ejy.553.1610771622320; Fri, 15 Jan 2021 20:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610771622; cv=none; d=google.com; s=arc-20160816; b=pX70gTdCcWfotegZlahA5TGgqmWxpRI7gmwOVmedPeFAEahiOvwY+wu8cCBgyp0SNp l3JANtaStmHTmZV2vTeS+qK1EWZhevW5ZiN1Ti0dLJy09EmsyWpKxvuMGExnU3XxqYwi 6++rl2sZ0/sasuHRfRV3vFEjVNd9VXJQB/S7wZOd12YPAd+ebuftSIFy28iJY6J+GSAB f53xNzQSIThTXV2eanmlp5sY+AcMoKtidKHsTGUFFLOuygN4ZNUmIpV63yDLwKEmkOSw 7wIvkx0i6bDv3q15UPobgK0OvY/ycff6Ya+UIGSWpim06iDuwHYBqI7Jo4WT9361klA7 MTzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=VvBEYz2mtbQhbNDn2J7HRyq80ov9V0cH7OdpgF10mXc=; b=QwQDkiSfs9hL3Zn+VeBSRq4TJkpp4Vz/KjMBZ65+c1FrZWtzzMKJoj80vS2QJ2cvk1 wv9aU8tvXnR/oSDBiwkusvwjvHZf9XnHIB1SFb+dvFtMlhmHd0QKs3AtBcs1LbPzq3WF YLzTorSLF1rRSPU08Naavwfl5NsaALQeFu6l6pbD3h77U8r/W7WHyuPPi46X9p3r+9cF t3+goRhTgsXwTyWnDKaFVdbYllBehUqtOe+CxNmZIasnSbSR2N+PfItFZXttXC/w/fsV tW9l+Ii9dMwWASCEWUBqTXEvgqugStpjFJaRpdvljlywB/g2u29lmdYgIufiRzODuwx0 TZqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U+aAm1w9; 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 n4si4538067ejr.508.2021.01.15.20.33.19; Fri, 15 Jan 2021 20:33:42 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U+aAm1w9; 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 S1729594AbhAPEbF (ORCPT + 99 others); Fri, 15 Jan 2021 23:31:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:54036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbhAPEbF (ORCPT ); Fri, 15 Jan 2021 23:31:05 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C5DC523A5E; Sat, 16 Jan 2021 04:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610771424; bh=qMDRWToLQ/4TptwuZSmDQQfMwSt3KS2cw2D//FPEt/Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U+aAm1w9JU3pIsHh2sb7hGSuu9wVQm6okaSscvSxYfKm0mWeHJhWFJRY7HZwM+vVq QplIQ0PKtWiPdU8PsItkoNpy16j2+1tgz9hJXdRrjIgU43XvyjaberM+5TDVhK/ONu Hea+t3YU0cKLvliJegB2vjqSOr5ycVFk8A6HJOv6Q5owov2QLSyb+MUlSYCxmOdyNp 9LLJdqyMxMPxBb7gAXFXgizA/uWqe3OkC+y+mds80mjerWMk2roYiy4hj9nUCKofgm 2Xl7mn3c4Puve9F70YczTBXl+7+UVLLC5WZgjZo8deUGCpZEu6GxIBL7dKTsaGtz8N 4E2dUMRr4FOWQ== Date: Fri, 15 Jan 2021 20:30:22 -0800 From: Jakub Kicinski To: "Andrea Parri (Microsoft)" Cc: linux-kernel@vger.kernel.org, "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Michael Kelley , Saruhan Karademir , Juan Vazquez , linux-hyperv@vger.kernel.org, "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH v2] hv_netvsc: Add (more) validation for untrusted Hyper-V values Message-ID: <20210115203022.7005e66a@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210114202628.119541-1-parri.andrea@gmail.com> References: <20210114202628.119541-1-parri.andrea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Jan 2021 21:26:28 +0100 Andrea Parri (Microsoft) wrote: > For additional robustness in the face of Hyper-V errors or malicious > behavior, validate all values that originate from packets that Hyper-V > has sent to the guest. Ensure that invalid values cannot cause indexing > off the end of an array, or subvert an existing validation via integer > overflow. Ensure that outgoing packets do not have any leftover guest > memory that has not been zeroed out. > > Reported-by: Juan Vazquez > Signed-off-by: Andrea Parri (Microsoft) > Cc: "David S. Miller" > Cc: Jakub Kicinski > Cc: Alexei Starovoitov > Cc: Daniel Borkmann > Cc: Andrii Nakryiko > Cc: Martin KaFai Lau > Cc: Song Liu > Cc: Yonghong Song > Cc: John Fastabend > Cc: KP Singh > Cc: netdev@vger.kernel.org > Cc: bpf@vger.kernel.org > --- > Applies to 5.11-rc3 (and hyperv-next). So this is for hyperv-next or should we take it via netdev trees? > Changes since v1 (Juan Vazquez): > - Improve validation in rndis_set_link_state() and rndis_get_ppi() > - Remove memory/skb leak in netvsc_alloc_recv_skb()