Re: [PATCH net-next] ethtool: Clarify len/n_stats fields in/out semantics
From: Gal Pressman <hidden>
Date: 2026-01-07 08:51:53
On 07/01/2026 3:48, Jakub Kicinski wrote:
On Mon, 5 Jan 2026 18:39:23 +0200 Gal Pressman wrote:quoted
- * @n_stats: On return, the number of statistics + * @n_stats: On entry, the number of stats requested. + On return, the number of stats returned. * @data: Array of statisticsMissing a '*'
Ah, missed it, thanks!
But stepping back we should rephrase the comment to cover both directions instead of mechanically adding the corresponding "On entry"
What do you mean? How would you phrase it?
FTR my recollection was that we never validated these field on entry and if that's the case 7b07be1ff1cb6 is quite questionable, uAPI-breakage wise.
Can you describe the breakage please? The kernel didn't look at this field on entry, but AFAICT, it was passed from userspace since the beginning of time. As a precaution, the cited patch only looks at the input values if they're different than zero, so theoretical apps that didn't fill them shouldn't be affected. Maybe if the app deliberately put a wrong length value on the input buffer?