Re: [PATCH] hv_netvsc: Add check for kvmalloc_array

From: Jiasheng Jiang <hidden>
Date: 2022-03-11 03:21:22
Also in: bpf, linux-hyperv, lkml

On Fri, 11 Mar 2022 11:00:24 +0800
Stephen Hemminger [off-list ref] wrote:
quoted
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help