[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1610fb1f-9fec-44ff-9a95-9bbb69e5b6a2@nvidia.com>
Date: Thu, 25 Sep 2025 23:54:08 -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 04/11] virtio_net: Query and set flow filter
caps
On 9/25/25 4:16 PM, Michael S. Tsirkin wrote:
> On Tue, Sep 23, 2025 at 09:19:13AM -0500, Daniel Jurgens wrote:
>> When probing a virtnet device, attempt to read the flow filter
>> capabilities. In order to use the feature the caps must also
>> be set. For now setting what was read is sufficient.
>> + ff_mask_size = sizeof(struct virtio_net_ff_cap_mask_data);
>> + sel = &ff->ff_mask->selectors[0];
>> +
>> + for (int i = 0; i < ff->ff_mask->count; i++) {
>
> i think kernel prefers variables at beginning of the block
i was already declared. Removed this.
>
>> + ff_mask_size += sizeof(struct virtio_net_ff_selector) + sel->length;
>
> do we know this will not overflow?
length is u8, ff_mask_size is size_t, so probably not, but I added a
check of length against the max length we expect.
>
>
>
Powered by blists - more mailing lists