Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5627440rwr; Tue, 9 May 2023 04:21:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5voLR2A3TJgKAuvOm7UDaZUjNYJ2w3cerslKByyyAQAumnBH37391anCf6Xq1J/fCF8rJG X-Received: by 2002:a05:6a20:840e:b0:fa:b283:f081 with SMTP id c14-20020a056a20840e00b000fab283f081mr17573568pzd.41.1683631262835; Tue, 09 May 2023 04:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683631262; cv=none; d=google.com; s=arc-20160816; b=XVMNMb2qiLuxfLeuLmyl+bUkREI5dFT/ZAIGO7w0001CeVlPU5GlcMrz4x5ESu1J9U 9DeTGy0HpX8YwTr8b4vJFljdCUt1h5TxEPoH/ZJcq6cAOLE0R7CukLLMJqb4KngWqb1f 3x2UOZHPwrwRK68wASFgdP09kjGTfamo5o46Sp88Tw2c/gWl4HdrIhwVF2znEAbNfFLF AwljtokOKpCd/kQvglhc/jW+ObjgMkZl5OrwTDfbXC9/8J5GUvEgvPYwEuSIEfuJB0wm Y4aNyjJQQ/gyGQCjCKsvaEgk5LF302trRVsi/h6OsT5EMffWIJW+UajBO/jOqBuarhli HFvg== 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=nZQZYq9ttBXaD7xMASS9T9z9a634uQj3HaOALrnNKXC1NSpJWVrCi1dnKU9sQ/81AY MF95EfTN/5x3ORehCVc5iMGxWM/R0pKvzwQLt481voSe4AflarXlLUxJX9wxgnagjSwk ArxzyG390kXd1FLUNfXolTQEYCTt0PTWK1D9RrRM8aJpQZcu/344WRKSOLefzvbPdJZG aRUo1l8rH4+EpKKUQRVDVjOJblkYdIgioqZWWPJk3bTHBbNBBe84F967qzpirdGhUB/A 1b90gZe+wphUkO4b4rhfnWmT4y7kWBuWRZplQuCE5f9CdOBjFUOkywZird48gDKRvPag CxNw== 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 c129-20020a633587000000b0051384f6edeasi879422pga.537.2023.05.09.04.20.44; Tue, 09 May 2023 04:21:02 -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 S234584AbjEILMG (ORCPT + 99 others); Tue, 9 May 2023 07:12:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjEILMF (ORCPT ); Tue, 9 May 2023 07:12:05 -0400 Received: from mail-m127104.qiye.163.com (mail-m127104.qiye.163.com [115.236.127.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C304C40FD; Tue, 9 May 2023 04:12:01 -0700 (PDT) Received: from localhost.localdomain (unknown [IPV6:240e:3b7:3277:3e50:6cb9:7ae9:9442:26ad]) by mail-m127104.qiye.163.com (Hmail) with ESMTPA id 1CF0CA402FD; Tue, 9 May 2023 19:11:53 +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 v5 0/2] iavf: Fix issues when setting channels concurrency with removing Date: Tue, 9 May 2023 19:11:46 +0800 Message-Id: <20230509111148.4608-1-dinghui@sangfor.com.cn> X-Mailer: git-send-email 2.17.1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlDGE8YVk9JS04eShlMHU0eGVUTARMWGhIXJBQOD1 lXWRgSC1lBWUlPSx5BSBlMQUhJTExBSB5OS0FNGBlCQUwaHkJBQk9PSUFJTRofWVdZFhoPEhUdFF lBWU9LSFVKSktISkxVSktLVUtZBg++ X-HM-Tid: 0a880035ec10b282kuuu1cf0ca402fd X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MAg6Nzo5HD0KIyszEVEjNAw6 MRYwCwlVSlVKTUNITUhLTEpPSEpMVTMWGhIXVR8SFRwTDhI7CBoVHB0UCVUYFBZVGBVFWVdZEgtZ QVlJT0seQUgZTEFISUxMQUgeTktBTRgZQkFMGh5CQUJPT0lBSU0aH1lXWQgBWUFIS09INwY+ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, 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