RE: [EXTERNAL] Re: [PATCH 2/3] net: marvell: prestera: fix memory use after free

From: Elad Nachman
Date: Tue Mar 12 2024 - 12:51:34 EST




> -----Original Message-----
> From: Kory Maincent <kory.maincent@xxxxxxxxxxx>
> Sent: Tuesday, March 12, 2024 5:45 PM
> To: Elad Nachman <enachman@xxxxxxxxxxx>
> Cc: Taras Chornyi <taras.chornyi@xxxxxxxxxxx>; davem@xxxxxxxxxxxxx;
> edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx;
> andrew@xxxxxxx; thomas.petazzoni@xxxxxxxxxxx;
> miquel.raynal@xxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: [EXTERNAL] Re: [PATCH 2/3] net: marvell: prestera: fix memory use
> after free
>
> Prioritize security for external emails: Confirm sender and content safety
> before clicking links or opening attachments
>
> ----------------------------------------------------------------------
> On Mon, 11 Mar 2024 15:51:11 +0200
> Elad Nachman <enachman@xxxxxxxxxxx> wrote:
>
> > From: Elad Nachman <enachman@xxxxxxxxxxx>
> >
> > Prestera driver routing module cleanup process would release memory
> > and then reference it again, and eventually free it again.
> > Remove the redundant first memory free call.
> > All such double free calls were detected using KASAN.
>
> Not directly related to this patch but I am wondering if the call to
> prestera_port_sfp_unbind(port) is not missing in
> prestera_destroy_ports() function?

Yes, it is.

>
> Regards,
> --
> Köry Maincent, Bootlin
> Embedded Linux and kernel engineering
> https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__bootlin.com&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=eTeNTLEK5-
> TxXczjOcKPhANIFtlB9pP4lq9qhdlFrwQ&m=VnjwUBq4QS_Onl_07gp1OUp2XoG
> pT-
> bZ5snEOAg5gf3CM3l5GPgXQ1pb3GzEa6bb&s=GchzqI3lHyGuFKhepEFMFsXwp
> 5oMSH9iqwBZuTtzhjc&e=

Elad.