Re: [PATCH net-next] ethtool: copy reglen to userspace

From: David Miller
Date: Thu May 30 2019 - 01:21:21 EST


From: Vivien Didelot <vivien.didelot@xxxxxxxxx>
Date: Tue, 28 May 2019 16:58:48 -0400

> ethtool_get_regs() allocates a buffer of size reglen obtained from
> ops->get_regs_len(), thus only this value must be used when copying
> the buffer back to userspace. Also no need to check regbuf twice.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@xxxxxxxxx>

Hmmm, can't regs.len be modified by the driver potentially?