From patchwork Wed May 3 03:15:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Hui X-Patchwork-Id: 8857 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1050587vqo; Tue, 2 May 2023 20:31:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Xv1d4DJQzzrBclbhNLYnLcCfclr1qXgk7u91h3DGiYPDMS3061EJjtNlV+FA66ZkQPlH2 X-Received: by 2002:a17:902:b106:b0:1a9:8769:36bd with SMTP id q6-20020a170902b10600b001a9876936bdmr735118plr.36.1683084685878; Tue, 02 May 2023 20:31:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683084685; cv=none; d=google.com; s=arc-20160816; b=OqdtAiSBtd8b5QIc9cE88Fqa3j6gn/URO4QjJMjBVC726V1d1HHjp1Kl/NhgCnuHMk swO2jFoHMyrMqTZ1u680U665cwcJnEEaQ2uM8CWp6FDpZkukFq6FOyviZ23oky9cfQ3s yV248x4yaqJQC81Kw0aIZVu+y0k+zHXhBZMkEz53RPl5eOQbXfi5Sw6cyojehLxvPLwm xsGHC8nr6ohIRLywXRnmX9EIrjNvJYDcirR+AmuC2dC5f4Mrn9XQUtjxesyg0TK7ve3I mTTo1NLCrQN7aKM33kBlQ4Zph6t0ncJgfKrsOvFbp4PIVkDvlxk3gL5LN7IseYVx4JIz MSfg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c18-20020a170902b69200b001aae1eefc9bsi8277536pls.238.2023.05.02.20.31.08; Tue, 02 May 2023 20:31:25 -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 S229673AbjECDQ0 (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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764842207945712173?= X-GMAIL-MSGID: =?utf-8?q?1764842207945712173?= 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(-)