Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp57245lfe; Fri, 15 Apr 2022 19:19:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnv50mkis4A2Dr9pdKUM9u4fxra3t5j/HUvzuUFHyenWBRZ6grTstUw59jrgMaGfAPeOKe X-Received: by 2002:a65:604b:0:b0:398:ebeb:ad8f with SMTP id a11-20020a65604b000000b00398ebebad8fmr1411436pgp.89.1650075591863; Fri, 15 Apr 2022 19:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650075591; cv=none; d=google.com; s=arc-20160816; b=l2mciv8HYsrt604XOHBVC4Mg7M0FEfVqIdb6S+wUk3WqBYJuw2JDFJjmh/hA/D9hHD H5zSzkK8uvQCEiWJ/9wACcbiRdnGaCNIUi9gevZrko5MqBuxIBSQSqJR9/cEkSdIAFe9 HIGDyHD/loElnTRnRJS0lhHs9WLOoCsEECf1gP5iZCECKEX0whZ3Ft/d4GjcqLoCZHx2 /Gph5Jc2sIME9oSgc3JkpcZCGbXSneakoIVAxRvZmmoT+7bmRPlBEMsHtYb1gPPWkFbY e09cCZy7ELcOpfmH6m/1cu9w0dkbLJbg9aEMTmVSEOhI5iQf6YbE3/RW6OZWSdw0RlZ9 L7vw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=CAAnlEczhzmwiiUomiVlc0ZiocMImLzsGeEoBJQeHzQ=; b=U3B7obbbynki5QBFVJlSgrFlf/3qqU99jdyLAeeGqIAK1S/nhwNcokNrX6SeZQow8/ gjpe91SWp73ckBk5USKiCaOUbspTLn1r9NnOktZ6tyRR35j4Y2Dr5Hlf1cYQCVFOilxg TagHrJSIvfa9noINgy/VGD2y/ynItXshY3W+D4a3eRfWvE4ViG5h1CSCF2o7l0lqdWz5 rBPxmG6zfGuNaFxJsoVuYZbsAbvaHFxAzr6F38cBHeNMjvDY0C6gI0uqmUiYxnRreja+ PuZHkfLAg34HAbnQUIDC97UFpDmVXYukA/3qCwn6Pi7XCL7BnoKvOTPJNfojaduI6ltw e6Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c3nT3xD7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d13-20020a170903230d00b001585910d6a4si72984plh.235.2022.04.15.19.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:19:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c3nT3xD7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 775311563E5; Fri, 15 Apr 2022 18:34:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236251AbiDMUuW (ORCPT + 99 others); Wed, 13 Apr 2022 16:50:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232532AbiDMUuU (ORCPT ); Wed, 13 Apr 2022 16:50:20 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35A4350470; Wed, 13 Apr 2022 13:47:57 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id l7so6387843ejn.2; Wed, 13 Apr 2022 13:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CAAnlEczhzmwiiUomiVlc0ZiocMImLzsGeEoBJQeHzQ=; b=c3nT3xD7XU0MWgpY86pi4lDdID4ySVqTE/1C98vzR0kJiHPonHeBH0GU1HuChqUGyE UpBag1pr//pEDDgun7N9oygVdwEPe/QHh7AhwZJ7E29hnK02IHlPW3qjiPjdrNMUKjUB m/ACRO66qRVpY1HeV58JF45hOWiJua00SMUqpJ3TdWTm2R3vX9oAv1q4WVhqcog0URfB 3dO3944uavA6O6mgkfhFzXP/09jyvz7VRUJY2qFUdhrFfWkOKsMmWBpNCSgWi2XAcCV/ VRcgD97YhYV8sK0NlvmIDpaU0JqTMmafIjyi8hrqKy9AYmwgKBe0EYwHVr34YZ/F5Lw8 YTCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CAAnlEczhzmwiiUomiVlc0ZiocMImLzsGeEoBJQeHzQ=; b=uGiCN/sm3ZShroWH4ut+uELjpxzs9rDcKkb7XO69VkZyddm/Ms5uMFJc2jidzdOE2B YTML8O8ZEaS8/WAi8b4C3u7V2/lm5x5ohkIgyNxYDh4Jk5hJgukXJbr0pIFJljf6S9k2 LigHBxpwV1myyu/DXC0px/4P+MHJzGo2t9vms7PcC4vlxdUfc5FlnuMWdUb9YAQ0HDot tfcebIxADg2hPA5zzopxLXa8e7ELUAWlg6gYgKxUZWALq2jky0PzwjG8J4BCva69efR/ wPlrYJqPcyWtm3wYxQE/9KVcGIzSGC2n+YcW5DPLCrnM6G+4qKTBon5Q4YfyWo6Tt+4E XFAg== X-Gm-Message-State: AOAM530zC+Hzi3ilYrPo0ijdlhAs03tVWrZIPVQIJ+egYan8FcF70O1H GsiTok+tWb9RcOCy+rgxivc= X-Received: by 2002:a17:907:7296:b0:6e8:97c1:a7ef with SMTP id dt22-20020a170907729600b006e897c1a7efmr13352185ejc.262.1649882875639; Wed, 13 Apr 2022 13:47:55 -0700 (PDT) Received: from anparri.mshome.net (host-79-52-64-69.retail.telecomitalia.it. [79.52.64.69]) by smtp.gmail.com with ESMTPSA id u6-20020a170906408600b006e87d654270sm5021ejj.44.2022.04.13.13.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 13:47:54 -0700 (PDT) From: "Andrea Parri (Microsoft)" To: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Michael Kelley , Stefano Garzarella , David Miller , Jakub Kicinski , Paolo Abeni Cc: linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Andrea Parri (Microsoft)" Subject: [RFC PATCH 0/6] hv_sock: Hardening changes Date: Wed, 13 Apr 2022 22:47:36 +0200 Message-Id: <20220413204742.5539-1-parri.andrea@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Miscellaneous changes to "harden" the hv_sock driver and enable it in isolated guests. The diff in ring_buffer.c, hyperv.h is due to a consequent refactoring/code elimination (patch #6). Applies to v5.18-rc2. Thanks, Andrea Andrea Parri (Microsoft) (6): hv_sock: Check hv_pkt_iter_first_raw()'s return value hv_sock: Copy packets sent by Hyper-V out of the ring buffer hv_sock: Add validation for untrusted Hyper-V values hv_sock: Initialize send_buf in hvs_stream_enqueue() Drivers: hv: vmbus: Accept hv_sock offers in isolated guests Drivers: hv: vmbus: Refactor the ring-buffer iterator functions drivers/hv/channel_mgmt.c | 9 ++++-- drivers/hv/ring_buffer.c | 11 ++++---- include/linux/hyperv.h | 48 ++++++++++---------------------- net/vmw_vsock/hyperv_transport.c | 24 ++++++++++++---- 4 files changed, 46 insertions(+), 46 deletions(-) -- 2.25.1