Thread (12 messages) 12 messages, 4 authors, 3d ago

Re: [PATCH net 3/3] net: fealnx: allocate the card index from an IDA

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-09-24 16:50:55
Also in: lkml, stable

On Thu, Sep 24, 2026 at 10:44:25AM +0000, Жамбакиев Радий Рикардинович wrote:
From: Radiy Zhambakiev <redacted>

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help