Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1662748rwr; Wed, 3 May 2023 20:02:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ75Vuw8tOjVCHcmzfnmu+y4Z9gofkBIyTC4XBtfB93v31Le10/saKAL9MHN3ZZxj5vnuBsn X-Received: by 2002:a05:6a00:15cb:b0:638:7e00:3737 with SMTP id o11-20020a056a0015cb00b006387e003737mr902016pfu.23.1683169365635; Wed, 03 May 2023 20:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683169365; cv=none; d=google.com; s=arc-20160816; b=uaUTlV9DeNbICBv8SOlFA+6ibBeZC+dI8KM2TemtHAxvfkLt8oZPePQAgK4yENg1Jb 54ZQOvDpScsyVBBRp7wIcSMPBHLM6fONjldaP2q4S/GaGVBGXgvIZ3zWYzR6NNWB9vIF 7xS4jVhRMkJAqzRlDdVjoSBEl/93JH4WrHBnX4LQxFd0Zmdz3mBPrOzVVe9u37oyWqoS wAggck3b+/8cf7wyF1QgdWfnyjt7kvn9RNB2LURORYOfrUAtRq/39ncKWS1AC1TmIHio iA8u5jQALJuHGAJZ8KPORvRu6DZrGgBWVuP52eRiTvMFwK638xZ3bn7Gc3YiRHVwCb24 PCpg== 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=PjApOvePaC5rp7er1WV/+s7a1VVDlifBZ85aygiayYI=; b=TEFDlHMkhRg/pjFsl6lUbIutKbEqFAZRc2fTrszSaby1EYfpZ6c/5mE8w9JturO29k 1BX1rw7DVNdNqdgOTFmb3t9YMwBvpCfv1997dlr8U+2JUN3rXmOuPgwqTtcA/IwPIy5M irfBEsMILuuVeBg2e3R9ScSwKHxL9xj2lEXhn0mOxfMMitrqAQmXX9VYo1HGJsLk7jQp Ycp4WMOQdwFubJhoa27fMnPfffQQsedgPQOlylr4npWC56y5AqPfn6t95Zs4DmpO/gl2 xqWLhRqc/p3ECIIY9dkTolCqc8HNv2pA8XPzTdQvF/6o87IFI+s7TjI/BhrHW0Gm88/b jGow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HCGp2kka; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b66-20020a62cf45000000b0063b7bbeb33esi34087746pfg.137.2023.05.03.20.02.28; Wed, 03 May 2023 20:02:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HCGp2kka; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229717AbjEDC7z (ORCPT + 99 others); Wed, 3 May 2023 22:59:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjEDC7w (ORCPT ); Wed, 3 May 2023 22:59:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FBE1A4; Wed, 3 May 2023 19:59:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BE9BD61592; Thu, 4 May 2023 02:59:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C6E1C433EF; Thu, 4 May 2023 02:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683169190; bh=GireKYj/mRtD4dWjKfNVWI5ll+YC+Kxs5r5H9H/h/a4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HCGp2kkaojdjEulWXbQiUtQrMpHvGDhwhhEh1miZU4quCS9ah082GljeMizCrXz1S cLbyQEc1h+TOufJSL5jf+jhuPCGsi1uHpJW+QJ3te0ol0/gVdY/ipFgUKvKbGkoFj3 clhY2lPvEljWlKV+IOapxy59rZGPQvL12kyzk0LXsWWF5jxrylY0Kuu79MSpk2Vpr+ cjzzGm0XsQna2X5Jsjm7flHWhl7NuTNUSXqAeWXi8+QajNh5tbwurOPvNAPPiODtC8 eC7eY5GrLXUHPq+xBrTR7wi7pICQtAK2jXhLTXTLa8O4VBKg2bnl0wHmlQYp4RwgLQ WsZVGDKyRZpIA== Date: Wed, 3 May 2023 19:59:48 -0700 From: Jakub Kicinski To: Leon Romanovsky Cc: Ding Hui , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, keescook@chromium.org, grzegorzx.szczurek@intel.com, mateusz.palczewski@intel.com, mitch.a.williams@intel.com, gregory.v.rose@intel.com, jeffrey.t.kirsher@intel.com, michal.kubiak@intel.com, simon.horman@corigine.com, madhu.chittim@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, pengdonglin@sangfor.com.cn, huangcun@sangfor.com.cn Subject: Re: [PATCH net v4 2/2] iavf: Fix out-of-bounds when setting channels on remove Message-ID: <20230503195948.08e9ff1d@kernel.org> In-Reply-To: <20230503082458.GH525452@unreal> References: <20230503031541.27855-1-dinghui@sangfor.com.cn> <20230503031541.27855-3-dinghui@sangfor.com.cn> <20230503082458.GH525452@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 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,T_SCC_BODY_TEXT_LINE 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 On Wed, 3 May 2023 11:24:58 +0300 Leon Romanovsky wrote: > > + if (test_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section)) > > + return -EOPNOTSUPP; > > This makes no sense without locking as change to __IAVF_IN_REMOVE_TASK > can happen any time. +1, the changes look questionable to me as well.