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

From: Jakub Kicinski
Date: Sun Jun 04 2023 - 13:47:27 EST


On Sat, 3 Jun 2023 15:11:29 +0800 Ding Hui wrote:
> Yes.
>
> I checked the others ioctl (e.g. ethtool_get_eeprom(), ethtool_get_features()),
> and searched the git log of ethtool utility, so I think that is an implicit
> rule and the check is missed in kernel where the patch involves.
>
> Without this rule, we cannot guarantee the safety of copy to user.
>
> Should we keep to be compatible with that incorrect userspace usage?

If such incorrect user space exists we do, if it doesn't we don't.
Problem is that we don't know what exists out there.

Maybe we can add a pr_err_once() complaining about bad usage for now
and see if anyone reports back that they are hitting it?