lkml.org 
[lkml]   [2023]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next] net: ethtool: Fix out-of-bounds copy to user
From
On 2023/6/10 11:47, Ding Hui wrote:
> On 2023/6/10 1:59, Alexander Duyck wrote:
>> On Fri, Jun 9, 2023 at 10:13 AM Jakub Kicinski <kuba@kernel.org> wrote:
>>>
>>> On Fri, 9 Jun 2023 23:25:34 +0800 Ding Hui wrote:
>>>> drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c: .get_sset_count         = nfp_net_get_sset_count,
>>>> drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c: .get_sset_count         = nfp_port_get_sset_count,
>>>
>>> Not sure if your research is accurate, NFP does not change the number
>>> of stats. The number depends on the device and the FW loaded, but those
>>> are constant during a lifetime of a netdevice.
>
> Sorry, my research is rough indeed.
>
>>
>> Yeah, the value doesn't need to be a constant, it just need to be constant.
>>
>> So for example in the ixgbe driver I believe we were using the upper
>> limits on the Tx and Rx queues which last I recall are stored in the
>> netdev itself.
>>
> Thanks to point that, the examples NFP and ixgbe do help me.

The commit f8ba7db85035 ("ice: Report stats for allocated queues via ethtool stats")
also helps a lot.

--
Thanks,
-dinghui

\
 
 \ /
  Last update: 2023-06-10 06:02    [W:2.057 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site