[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220311032059.2038014-1-jiasheng@iscas.ac.cn>
Date: Fri, 11 Mar 2022 11:20:59 +0800
From: Jiasheng Jiang <jiasheng@...as.ac.cn>
To: stephen@...workplumber.org
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
wei.liu@...nel.org, decui@...rosoft.com, davem@...emloft.net,
kuba@...nel.org, ast@...nel.org, daniel@...earbox.net,
hawk@...nel.org, john.fastabend@...il.com, andrii@...nel.org,
kafai@...com, songliubraving@...com, yhs@...com,
kpsingh@...nel.org, linux-hyperv@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org, Jiasheng Jiang <jiasheng@...as.ac.cn>
Subject: Re: [PATCH] hv_netvsc: Add check for kvmalloc_array
On Fri, 11 Mar 2022 11:00:24 +0800
Stephen Hemminger <stephen@...workplumber.org> 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.
I unrolled the 'data area' since the three 'for loops' before
have already assigned the value to the data area.
And I have not found any review about it.
Thanks,
Jiang
Powered by blists - more mailing lists