Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp260375rwr; Tue, 2 May 2023 20:20:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VT7/rcRHRtFLOllAicl/mBqRwHHZmQgVmzfjFKmmpP0xtEF0U6kwuLzLONgfmcfcA6utG X-Received: by 2002:a05:6a20:12d2:b0:f0:4dbf:5f9f with SMTP id v18-20020a056a2012d200b000f04dbf5f9fmr25243770pzg.29.1683084024935; Tue, 02 May 2023 20:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683084024; cv=none; d=google.com; s=arc-20160816; b=BducBMfozl9OnAglutTzmLy4tW/y/2UWuAM8gB6jmPkJxDRf+zo6PLNUqD+cyDs2VY GWv25nPhezl2y4IsOqFwhikPhY/SnSjolBeBxbQq5faTUKNc7lW/kVJi+L50kJsMYs/K x2ibijcR8+loNfMsjUj8EOBEBQ/g4Z9C5CqAktXEMuud8VgmNx1l7CiU3s/2A2pmDqQS mRyWat0FovXuBnzbPkVqUP10YTrAGIzF88v/y7FFTWaMfSrK6UpO+anxYbsaKGEc12q0 brocAUzQMDZkMSdCEWiAkFE6kGLyZtAzj8ZQpPK4uZJnoBwA70AqPMvrBrGrBDypQkQK Iy9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=9Tc1ASznB8km9S9z19NLiMSSW0B+aIAneCfVuwJoqCg=; b=uCPhH7mbte77hLr1SnEnj8BisBXs2/ySOWD3KSNZpuqQRmrN/Iqu4xecSJIIGsuJNW aPmLYkuIT/UwVugVreL+gYgsm95x9GTqP1TrJe+KnD7GOsL236lg3RGgc7p9LqVOjtVM 4YYJskoXDfOZppUeNvI1beL9USUjXTuOyY/K1rzUltr0gNXAmw3MmrHMZvYH1yFtrz2i 73lb+oQDuhKbpEOxSyKzT4rBxfIztSiEcsOcD3c9in7uqMKyrWJ2rkJvO54C2h8MQD23 45+eiPf1h2aid2vWhBuwSdnY0L0fmdz4DRtxPrUM+HnakIc3DZO0jCST838x4bhRGG1D F3SQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sangfor.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t189-20020a6381c6000000b005288d3c34f7si16853697pgd.195.2023.05.02.20.20.12; Tue, 02 May 2023 20:20:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sangfor.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbjECDQ0 (ORCPT + 99 others); Tue, 2 May 2023 23:16:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbjECDQY (ORCPT ); Tue, 2 May 2023 23:16:24 -0400 Received: from mail-m11876.qiye.163.com (mail-m11876.qiye.163.com [115.236.118.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 877C6AD; Tue, 2 May 2023 20:16:22 -0700 (PDT) Received: from localhost.localdomain (unknown [IPV6:240e:3b7:327f:5c30:95e8:3d27:11c5:1ee8]) by mail-m11876.qiye.163.com (Hmail) with ESMTPA id 7D4DC3C0234; Wed, 3 May 2023 11:16:14 +0800 (CST) From: Ding Hui To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com Cc: 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, Ding Hui Subject: [PATCH net v4 0/2] iavf: Fix issues when setting channels concurrency with removing Date: Wed, 3 May 2023 11:15:39 +0800 Message-Id: <20230503031541.27855-1-dinghui@sangfor.com.cn> X-Mailer: git-send-email 2.17.1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlCHUlCVh1KHU9CTkpPSUpMHVUTARMWGhIXJBQOD1 lXWRgSC1lBWUlPSx5BSBlMQUhJTB1BThhIS0FCTh5DQUgfSUxBSkoYTkFKHh5DWVdZFhoPEhUdFF lBWU9LSFVKSktISkxVSktLVUtZBg++ X-HM-Tid: 0a87df9c4c802eb2kusn7d4dc3c0234 X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6N0k6Tgw6CD0OAToTMB8XQgIK DkoaFC1VSlVKTUNIS0NITExOTkpIVTMWGhIXVR8SFRwTDhI7CBoVHB0UCVUYFBZVGBVFWVdZEgtZ QVlJT0seQUgZTEFISUwdQU4YSEtBQk4eQ0FIH0lMQUpKGE5BSh4eQ1lXWQgBWUFIS09ONwY+ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 The patchset fix two issues which can be reproduced by the following script: [root@host ~]# cat repro.sh #!/bin/bash pf_dbsf="0000:41:00.0" vf0_dbsf="0000:41:02.0" g_pids=() function do_set_numvf() { echo 2 >/sys/bus/pci/devices/${pf_dbsf}/sriov_numvfs sleep $((RANDOM%3+1)) echo 0 >/sys/bus/pci/devices/${pf_dbsf}/sriov_numvfs sleep $((RANDOM%3+1)) } function do_set_channel() { local nic=$(ls -1 --indicator-style=none /sys/bus/pci/devices/${vf0_dbsf}/net/) [ -z "$nic" ] && { sleep $((RANDOM%3)) ; return 1; } ifconfig $nic 192.168.18.5 netmask 255.255.255.0 ifconfig $nic up ethtool -L $nic combined 1 ethtool -L $nic combined 4 sleep $((RANDOM%3)) } function on_exit() { local pid for pid in "${g_pids[@]}"; do kill -0 "$pid" &>/dev/null && kill "$pid" &>/dev/null done g_pids=() } trap "on_exit; exit" EXIT while :; do do_set_numvf ; done & g_pids+=($!) while :; do do_set_channel ; done & g_pids+=($!) wait Ding Hui (2): iavf: Fix use-after-free in free_netdev iavf: Fix out-of-bounds when setting channels on remove drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 4 +++- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) -- 2.17.1