Re: [PATCH] hv_netvsc: Add check for kvmalloc_array
From: Stephen Hemminger
Date: Thu Mar 10 2022 - 22:00:39 EST
On Fri, 11 Mar 2022 10:43:44 +0800
Jiasheng Jiang <jiasheng@xxxxxxxxxxx> wrote:
> + if (!pcpu_sum) {
> + for (j = 0; j < i; j++)
> + data[j] = 0;
> + return
Why is unrolled zero (memset) needed? The data area comes from
ethtool_get_stats and is already zeroed (vzalloc).
There does look like at TOCTOU error here with on the number of stats.
Code doesn't look hotplug safe.
Not sure, but that issue might have been raised during review.