Re: [PATCH 2/2] [v2] net/mlx5: fix possible stack overflows

From: Yevgeny Kliteynik
Date: Tue Feb 20 2024 - 03:22:24 EST


On 20-Feb-24 10:11, Arnd Bergmann wrote:
External email: Use caution opening links or attachments


On Tue, Feb 20, 2024, at 09:06, Simon Horman wrote:
On Mon, Feb 19, 2024 at 11:04:56AM +0100, Arnd Bergmann wrote:

Hi Arnd,

With patch 1/2 in place this code goes on as:

switch (action->action_type) {
case DR_ACTION_TYP_DROP:
memset(buff, 0, sizeof(buff));

buff is now a char * rather than an array of char.
siceof(buff) doesn't seem right here anymore.

Flagged by Coccinelle.

Rihgt, that would be bad. It sounds like we won't use patch 1/2
after all though, so I think it's going to be fine after all.
If the mlx5 maintainers still want both patches, I'll rework
it to use the fixed size.

No need for the first patch, so only the stack frame limit
fix is needed.

Thanks,

-- YK

Arnd