Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp953432rdb; Sun, 1 Oct 2023 12:39:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnEo4LCnodld3uAETEemGbVm7nWofvuHNgJaAlCrpW/YzHYDa8XeD+E+Ao1/6zZGIfWq8M X-Received: by 2002:a9d:6a85:0:b0:6b9:5734:135f with SMTP id l5-20020a9d6a85000000b006b95734135fmr10117474otq.28.1696189188279; Sun, 01 Oct 2023 12:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696189188; cv=none; d=google.com; s=arc-20160816; b=iFkSlKdb5JRLNOnf28/Iwr5XiAw9YbcxS5Tu+IziAOJPDxepXR4Ods4JZinF0okJuo QydwwIIzbLzjHsrExUt0C+RgxT68C2zsi4b5yPobNbs94hDAidEbuPGLEvR4oqbRfNml +H/nkdsnq113uKXgY+7KHrwt5uJXH9A9Hrfokzco46Hq9wJ4jClcZocVhqS7W27GEtB/ Nw9yno/+qE0QkSipAlAA2Co+1NS/BUGuTKvogjwYSn8AdZEsONtpVgJ+HSRMSs4UAczs nOFhFdnkqWdJ/vowbc5CyZOicPwr5Tu0SBEfsqdndMx6MUTmCoMBFwcCbZ4z6K/MfvVg +LZA== 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=SN1KNqEAJF+8wLudcAV83AkBGqWd8JPS/KLuztzGf9Y=; fh=u/x+1mbe062EZqQN5EIahkv8D9IRFe67LTg+ODAuAS4=; b=ggJiEoIKoeQe+RzCx8pLcgNocH5jwvNFI82BslVYodPqqF0+EN6r8Hv5CbP1/MLFJ1 IyLKV8d08vaekB9EDR1cn7MBNbTG35yGc99TAPtQmg0P2QDsdsaIXXmYpAAQJiBABQSb ubNvsX31ycJwDH0V4BZWVqqu6bSUq4ZWFkF8lMNYpDKMBEa8gOeLrD50nlQUtShrMuAY aAr5DSKha2MzBiQBXYKmjUXEMuCa+zTtV7wlG3KOPPlqo9Weqf2uoOoLkwSNL2pWYOqp EhFiNbuqRg1690kq8NISClubwawQC+k1XzcXKR7NaUEvgb4uDDtTdwqbKaIBJLAh+s95 iTKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HNOARcbY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w14-20020a63474e000000b00578da80ac3dsi25452166pgk.80.2023.10.01.12.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 12:39:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HNOARcbY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 47D9680293FC; Sun, 1 Oct 2023 12:39:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235326AbjJATfc (ORCPT + 99 others); Sun, 1 Oct 2023 15:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235309AbjJATfb (ORCPT ); Sun, 1 Oct 2023 15:35:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54E75BF for ; Sun, 1 Oct 2023 12:35:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 909AFC433C8; Sun, 1 Oct 2023 19:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696188928; bh=2fAkwl7Bkul3eesFHp5NXfQdxux8bozgy2kPSkCSopE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HNOARcbYjlQr9J1v44b4w03Q78QjwiFErN/19dIHTWjJvTieOjhaSLih78RV4ezpq NFn1mOZV4aQDnOTCxsjz9TfXU68StlzPcMqrwdkg0XTFHw9CLke4TFwVr+mkxs8Lhv wI5CeQPMLfS2Mc3f8z5Ev1coO3+olABJB0LVmirI2w4kdEcPn5SNnxz8vf2Dr6/2pB bBJoWTlb95OvPpxyT+/Y6I0rLNTVJCQrUOO7rtAMgRV/5R4bjwwqjh1zRVPGy8TF6s 14lWfZXpnSmDpPrYbAtiIy1coTSr5IYW0H14o5uyIaoSpCWC0pEL3p/WT/imdl3ITS LYVufo6RBtdWg== Date: Sun, 1 Oct 2023 21:35:21 +0200 From: Simon Horman To: Sonia Sharma Cc: linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, sosha@microsoft.com, kys@microsoft.com, mikelley@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Subject: Re: [PATCH net-next v6] net: hv_netvsc: fix netvsc_send_completion to avoid multiple message length checks Message-ID: <20231001193521.GV92317@kernel.org> References: <1695849556-20746-1-git-send-email-sosha@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1695849556-20746-1-git-send-email-sosha@linux.microsoft.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 01 Oct 2023 12:39:47 -0700 (PDT) On Wed, Sep 27, 2023 at 02:19:16PM -0700, Sonia Sharma wrote: > From: Sonia Sharma > > The switch statement in netvsc_send_completion() is incorrectly validating > the length of incoming network packets by falling through to the next case. > Avoid the fallthrough. Instead break after a case match and then process > the complete() call. > The current code has not caused any known failures. But nonetheless, the > code should be corrected as a different ordering of the switch cases might > cause a length check to fail when it should not. > > Signed-off-by: Sonia Sharma Reviewed-by: Simon Horman