Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp414096rwr; Wed, 19 Apr 2023 08:08:51 -0700 (PDT) X-Google-Smtp-Source: AKy350bZnDQvu893/7t423KUxnmM+u5qrbbUoxbJhVEqYAOM7CFf+CXTcuraFxDevFbwIWnsIAd7 X-Received: by 2002:a17:902:bcc3:b0:1a6:7b92:15ec with SMTP id o3-20020a170902bcc300b001a67b9215ecmr5654953pls.41.1681916931390; Wed, 19 Apr 2023 08:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681916931; cv=none; d=google.com; s=arc-20160816; b=wv+SokQqE9ZuQG/poi6CUCCWaGUdE62ULpw+CHzTqeg0ljMv2lvBpkpEoH7Y5KnYGs YM7r6BD4u0ALEHLcEHqTB66iqhmJ8/v1q9+JNrOzd5ZoP7Q7LMKmFybKOizwxR5gOUSt etzpHLFw2+tDWDTWgZVSzScIP+HEMgsTwX2kh2qq1Xe6PiAlGWZtbDZBF6UehIsrDZ8p ltO+jDNyhHOHns5PKXlBywvjWvpCJrPhMm1ZMPUtZOLnC7pAr9WtNjgw0NfhEzpx0X3h su3uIwXvYKOTl2y7HLy7MR3VLJMvdAkdnBmBaVkcql5j/FEZNvjeveTRG3d9EIeYzgDN MMOw== 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=gKu45RK/zrUJ0wwDunTdLronJyArdGpkhCQyHe15dGrbxSFqH7tHS9xmaZPIwgOSZ2 nId/6Bmz5HhGzTwTtK0htMdgX3U5YY7NVH/zOh5pngHVXnadieZoE9Lf7RiQS9sUNYIb Bh0FcX+6Rrxh0NdmmqyObeCHyMPAlcLTbsA8HWttr26oZZhy4GzZgINcskUk/rTeZAaO 6dmZIcaSnnBF805pVl9QgyYIqzEjXorur63gbVpmev903dj4BQUGHulkO9p/WzjQxfIX mBwtDVFYugAkkmbGi7y0qxljQNkJmvvcAYIILcSe/QO76Ry0vdtPbDelBa93pt5Sk1ik vkYA== 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 i4-20020a170902c94400b0019fe6800ed2si12429768pla.428.2023.04.19.08.08.31; Wed, 19 Apr 2023 08:08:51 -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 S232626AbjDSPIF (ORCPT + 99 others); Wed, 19 Apr 2023 11:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjDSPIB (ORCPT ); Wed, 19 Apr 2023 11:08:01 -0400 Received: from mail-m11875.qiye.163.com (mail-m11875.qiye.163.com [115.236.118.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A7B3C2B; Wed, 19 Apr 2023 08:07:56 -0700 (PDT) Received: from localhost.localdomain (unknown [113.92.156.116]) by mail-m11875.qiye.163.com (Hmail) with ESMTPA id A87DE280259; Wed, 19 Apr 2023 23:07:52 +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, 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 v2 0/2] iavf: Fix issues when setting channels concurrency with removing Date: Wed, 19 Apr 2023 23:07:07 +0800 Message-Id: <20230419150709.24810-1-dinghui@sangfor.com.cn> X-Mailer: git-send-email 2.17.1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlCTR4aVkIfTExLTU4ZHktNSlUTARMWGhIXJBQOD1 lXWRgSC1lBWUpKSFVCSVVKTk1VSkpNWVdZFhoPEhUdFFlBWU9LSFVKSktISkxVSktLVUtZBg++ X-HM-Tid: 0a879a0eca282eb1kusna87de280259 X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6ORg6Eio5OD0JQxdKUVFMS0MS ECJPCj9VSlVKTUNKQkpNQ0xITU1NVTMWGhIXVR8SFRwTDhI7CBoVHB0UCVUYFBZVGBVFWVdZEgtZ QVlKSkhVQklVSk5NVUpKTVlXWQgBWUFJQkJINwY+ 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