netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v5 0/2] iavf: Fix issues when setting channels concurrency with removing
@ 2023-05-09 11:11 Ding Hui
  2023-05-09 11:11 ` [PATCH net v5 1/2] iavf: Fix use-after-free in free_netdev Ding Hui
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ding Hui @ 2023-05-09 11:11 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, intel-wired-lan, jesse.brandeburg,
	anthony.l.nguyen
  Cc: keescook, grzegorzx.szczurek, mateusz.palczewski,
	mitch.a.williams, gregory.v.rose, jeffrey.t.kirsher,
	michal.kubiak, simon.horman, madhu.chittim, netdev, linux-kernel,
	linux-hardening, pengdonglin, huangcun, Ding Hui

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-17 13:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-09 11:11 [PATCH net v5 0/2] iavf: Fix issues when setting channels concurrency with removing Ding Hui
2023-05-09 11:11 ` [PATCH net v5 1/2] iavf: Fix use-after-free in free_netdev Ding Hui
2023-05-09 13:39   ` Leon Romanovsky
2023-07-17 13:25     ` [Intel-wired-lan] " Romanowski, Rafal
2023-05-09 11:11 ` [PATCH net v5 2/2] iavf: Fix out-of-bounds when setting channels on remove Ding Hui
2023-05-09 13:39   ` Leon Romanovsky
2023-07-17 13:26     ` [Intel-wired-lan] " Romanowski, Rafal
2023-05-10 12:16 ` [PATCH net v5 0/2] iavf: Fix issues when setting channels concurrency with removing Michal Kubiak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).