Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp449363pxb; Wed, 24 Feb 2021 06:33:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiMdlFrpVcG2UREUMS9uhzA0p1IO5NgJoOChzDVd7MWHyFUnKeYB7AqnzpiDsLAl2b3m7J X-Received: by 2002:aa7:c944:: with SMTP id h4mr33407368edt.233.1614177215709; Wed, 24 Feb 2021 06:33:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614177215; cv=none; d=google.com; s=arc-20160816; b=FHTkGPixeKq3NaoeoZJg+BcoNQR0cx50t0uWzF3XVMsD/DzyCwlD77ad/RkUO1Y6X5 FGSchTn+mgBBqHTXI31lp8Suez+VfJD1mUK6Iy2gLqAt5P13wmE2X65J/FtyNu6YBLCv EtEc3D4P8nERl5Brv8+XrJeAsDlDE/y9jStQ2nRnEajNPoAUWnNh8wM5L6xccJGMjmZ7 geJ1e0BCrNZUrudHJfy0v9vTTPLeOFzRvrR28cPdcVy27lWqWTaULyrUldwAPUKX5E7B YxPHe5OnP5cjtnqzfg7AUQjpERTzmmA9gjL+tQJLKFnltnm3b1tgay/n2U0YMGdVXA2M 5iww== 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:dkim-signature; bh=Ybq7RMjn9hsdU3yUVvJeduTNiXaxFp9VeeC1XcARtv8=; b=RsU5Wb0rIiAKo9oX98TRNfRRaugD/i9iJdvO220Xo8j6p7rSsGJDPdG8E8EYO1v+Xg opwj8+CGDBW5suBC+Exu8e+OhhpEncsVfjPyN84iuvGHDhNFGC4cjXAOx+Wxsejue8cX ZflZo7Uwjh2+fdUvF4A/XLRSRCRxY8DT1Y6ngR/3x+9q9T344j9+xAwLxYl0udfTtDWY k3RC4YiwsiPvM74jpB7MskHka9iXIA+OEGhjQdNDNgeiUu0IrqCvCvheT6IxMtRkxEvF k9JDWfwxEsEu8VhB/zylVquUHlRCEjRazgDp4+ZEwcq2fmzYHNXJe3+1r38x70Mm1MWv yo+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kK6Ceh9V; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si1224234edq.109.2021.02.24.06.32.40; Wed, 24 Feb 2021 06:33:35 -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=@gmail.com header.s=20161025 header.b=kK6Ceh9V; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235173AbhBXO1K (ORCPT + 99 others); Wed, 24 Feb 2021 09:27:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233489AbhBXNSk (ORCPT ); Wed, 24 Feb 2021 08:18:40 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8964C06178B; Wed, 24 Feb 2021 05:16:09 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id j9so2470614edp.1; Wed, 24 Feb 2021 05:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ybq7RMjn9hsdU3yUVvJeduTNiXaxFp9VeeC1XcARtv8=; b=kK6Ceh9V43eJSJbZIYNJyliPkn06F05XmgT9o2Ly6bCeiWTU2vbOcaocEF6JDRj2va msZZIjz6DAvd5tEbkFUaty74DUhxQzrSmErn0lIc+ioLi8pz4GXnSotGpDrNg5dUbgTH 5d27wwMxsPFxFYDgIUXOmyHxZz5oDEBIkv5A9s6uZqoVNRG4AR8LDZHMSM+QegJqQNv3 feQGIHdK124gMqU5LdXW+p+YPqLhT8vMfOhnYNeYuaq5Kh9vIoDc2ZM3otMC5gRbMt6D xvQUzG+uKuPRJfzKKUm2AOCZw1Bjf0zZBjZ1pBETs7gDve2a/dqJ7kCdqZsWMCYgXupX adhQ== 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=Ybq7RMjn9hsdU3yUVvJeduTNiXaxFp9VeeC1XcARtv8=; b=kzfMQeoW6PM6DUTduhL9q5hGIRgDUYI6rpUeb+Q8yjpMrHINC7Ruo2vTWEDTJbv+DI jR+enK12MuA3JJJyqKWE2yNF7jfgz11JTDjpfhujfMyzF2VEX1ipCp0+VPfpSNF0sF8X 2ztnH/3iX+UMMMUMZpTk3uSpXA2oP8ZOEhGeurjGiEOzPrJCr2WTIKXNPqUN8djzIT3I HaJkw/U4LYGl8u1KAP3pIJAFatLEe9tAX3xqX4NfQ3dx0G2OqeTrV0s0hERHBtphTWrP eJkhyBikX8RZ14V/fT1u2S0RY6OfKjqYMIZeYgx6kNY2q43cSP+DHqL0exJ0Z1zuS9Lt 8RxQ== X-Gm-Message-State: AOAM532WyDpaeB732976gn+anl+Q3fhtgnZmXpd1P/+5L1QBVvDJa+2R rk3BPXs+KNwt+B1/zL7KyLM= X-Received: by 2002:a50:bf47:: with SMTP id g7mr32569077edk.323.1614172568363; Wed, 24 Feb 2021 05:16:08 -0800 (PST) Received: from anparri (host-82-59-6-76.retail.telecomitalia.it. [82.59.6.76]) by smtp.gmail.com with ESMTPSA id a26sm1638418edm.15.2021.02.24.05.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 05:16:08 -0800 (PST) Date: Wed, 24 Feb 2021 14:16:00 +0100 From: Andrea Parri To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Juan Vazquez , Michael Kelley , Wei Liu , linux-hyperv@vger.kernel.org Subject: Re: [PATCH AUTOSEL 5.11 50/67] Drivers: hv: vmbus: Initialize memory to be sent to the host Message-ID: <20210224131457.GA1920@anparri> References: <20210224125026.481804-1-sashal@kernel.org> <20210224125026.481804-50-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210224125026.481804-50-sashal@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 24, 2021 at 07:50:08AM -0500, Sasha Levin wrote: > From: "Andrea Parri (Microsoft)" > > [ Upstream commit e99c4afbee07e9323e9191a20b24d74dbf815bdf ] > > __vmbus_open() and vmbus_teardown_gpadl() do not inizialite the memory > for the vmbus_channel_open_channel and the vmbus_channel_gpadl_teardown > objects they allocate respectively. These objects contain padding bytes > and fields that are left uninitialized and that are later sent to the > host, potentially leaking guest data. Zero initialize such fields to > avoid leaking sensitive information to the host. > > Reported-by: Juan Vazquez > Signed-off-by: Andrea Parri (Microsoft) > Reviewed-by: Michael Kelley > Link: https://lore.kernel.org/r/20201209070827.29335-2-parri.andrea@gmail.com > Signed-off-by: Wei Liu > Signed-off-by: Sasha Levin Sasha - This patch is one of a group of patches where a Linux guest running on Hyper-V will start assuming that hypervisor behavior might be malicious, and guards against such behavior. Because this is a new assumption, these patches are more properly treated as new functionality rather than as bug fixes. So I would propose that we *not* bring such patches back to stable branches. Thanks, Andrea > --- > drivers/hv/channel.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c > index 6fb0c76bfbf81..0bd202de79600 100644 > --- a/drivers/hv/channel.c > +++ b/drivers/hv/channel.c > @@ -618,7 +618,7 @@ static int __vmbus_open(struct vmbus_channel *newchannel, > goto error_clean_ring; > > /* Create and init the channel open message */ > - open_info = kmalloc(sizeof(*open_info) + > + open_info = kzalloc(sizeof(*open_info) + > sizeof(struct vmbus_channel_open_channel), > GFP_KERNEL); > if (!open_info) { > @@ -745,7 +745,7 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle) > unsigned long flags; > int ret; > > - info = kmalloc(sizeof(*info) + > + info = kzalloc(sizeof(*info) + > sizeof(struct vmbus_channel_gpadl_teardown), GFP_KERNEL); > if (!info) > return -ENOMEM; > -- > 2.27.0 >