Re: [PATCH net 3/3] net: fealnx: allocate the card index from an IDA
From: Andrew Lunn
Date: Thu Sep 24 2026 - 13:06:50 EST
On Thu, Sep 24, 2026 at 10:44:25AM +0000, Жамбакиев Радий Рикардинович wrote:
> From: Radiy Zhambakiev <r.zhambakiev@xxxxxxxxxxxxxxxxx>
>
> card_idx is a static counter that is incremented on every probe.
> It can overflow and wrap to a negative value, which then indexes
> options[] and full_duplex[] out of bounds. Large values also no
> longer fit in the 12-byte boardname[] buffer.
Seems very theoretical. For something which is never going to happen,
please keep it KISS:
if (card_idx > 100000) {
dev_error(..., "Please stop doing that!");
return -ENODEV;
}
Andrew
---
pw-bot: cr