RE: [PATCH net 1/3] octeontx2-af: Fix mcs string buffer size

From: Jagielski, Jedrzej

Date: Wed Jul 29 2026 - 07:03:20 EST


From: Subrat Pandey <subratp@xxxxxxxxxxx>
Sent: Wednesday, July 29, 2026 9:24 AM

>From: Stefan Wiehler <stefan.wiehler@xxxxxxxxx>
>
>The "mcs%d" name is built with the unbounded sprintf(), which writes
>without any regard for the size of the destination buffer and can
>overrun it. Switch to snprintf() with sizeof() so the formatted write
>is always clamped to the buffer. The buffer is also enlarged to
>24 bytes to comfortably hold the string for any MCS block index.

Hi Subrat

Is this something that can actually occur during any real scenario?

>
>Fixes: d06c2aba5163 ("octeontx2-af: cn10k: mcs: Add debugfs support").
>Signed-off-by: Stefan Wiehler <stefan.wiehler@xxxxxxxxx>
>Signed-off-by: Subrat Pandey <subratp@xxxxxxxxxxx>