Re: [PATCH] hv_netvsc: Add check for kvmalloc_array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 11 Mar 2022 11:00:24 +0800
Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx> 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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux