lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4532bc48-ca59-4f04-a3f4-a66d4be4ac1b@nvidia.com>
Date: Sat, 27 Sep 2025 23:39:28 -0500
From: Dan Jurgens <danielj@...dia.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: netdev@...r.kernel.org, jasowang@...hat.com, alex.williamson@...hat.com,
 pabeni@...hat.com, virtualization@...ts.linux.dev, parav@...dia.com,
 shshitrit@...dia.com, yohadt@...dia.com, xuanzhuo@...ux.alibaba.com,
 eperezma@...hat.com, shameerali.kolothum.thodi@...wei.com, jgg@...pe.ca,
 kevin.tian@...el.com, kuba@...nel.org, andrew+netdev@...n.ch,
 edumazet@...gle.com
Subject: Re: [PATCH net-next v3 11/11] virtio_net: Add get ethtool flow rules
 ops

On 9/25/25 3:44 PM, Michael S. Tsirkin wrote:
> On Tue, Sep 23, 2025 at 09:19:20AM -0500, Daniel Jurgens wrote:
>> - Get total number of rules. There's no user interface for this. It is

>> +int virtnet_ethtool_get_flow_count(struct virtnet_ff *ff,
>> +				   struct ethtool_rxnfc *info)
>> +{
>> +	if (!ff->ff_supported)
>> +		return -EOPNOTSUPP;
>> +
>> +	info->rule_cnt = ff->ethtool.num_rules;
>> +	info->data = le32_to_cpu(ff->ff_caps->rules_limit) | RX_CLS_LOC_SPECIAL;
> 
> hmm. what if rules_limit has the high bit set?
> or matches any of
> #define RX_CLS_LOC_ANY          0xffffffff
> #define RX_CLS_LOC_FIRST        0xfffffffe
> #define RX_CLS_LOC_LAST         0xfffffffd
> by chance?
> 

FIRST, LAST, and ANY are only used in the insert rule flows (in the
userspace tool, not the kernel).

SPECIAL is used get flow count to advertise the capability that we
support ANY on insert.

Since we do support ANY on insert there's no harm if rules limit has the
high bit set.

As a practical matter I can't imagine a rules within 3 orders of
magnitude of 2B.

If you'd like I can mask off that bit setting the caps, but I don't
think it's needed.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ