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.
>
>
>