Re: [PATCH net-next] net: ethtool: Fix out-of-bounds copy to user

From: Andrew Lunn
Date: Fri Jun 02 2023 - 12:37:24 EST


> What this change is essentially doing is clamping the copied data to
> the lesser of the current value versus the value when the userspace
> was allocated. However I am wondering now if we shouldn't just update
> the size value and return that as some sort of error for the userspace
> to potentially reallocate and repeat until it has the right size.

I'm not sure we should be putting any effort into the IOCTL
interface. It is deprecated. We should fix overrun problems, but i
would not change the API. Netlink handles this atomically, and that is
the interface tools should be using, not this IOCTL.

Andrew