[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <54c0af4f.28cff.18c487cab21.Coremail.alexious@zju.edu.cn>
Date: Fri, 8 Dec 2023 16:12:59 +0800 (GMT+08:00)
From: alexious@....edu.cn
To: "Suman Ghosh" <sumang@...vell.com>
Cc: "Jakub Kicinski" <kuba@...nel.org>,
"Chris Snook" <chris.snook@...il.com>,
"David S. Miller" <davem@...emloft.net>,
"Eric Dumazet" <edumazet@...gle.com>,
"Paolo Abeni" <pabeni@...hat.com>, "Simon Horman" <horms@...nel.org>,
"Yuanjun Gong" <ruc_gongyuanjun@....com>,
"Jie Yang" <jie.yang@...eros.com>,
"Jeff Garzik" <jgarzik@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: RE: [EXT] [PATCH] ethernet: atheros: fix a memleak in
atl1e_setup_ring_resources
> >On Thu, 7 Dec 2023 17:08:15 +0000 Suman Ghosh wrote:
> >> >+ kfree(tx_ring->tx_buffer);
> >>
> >> [Suman] I think we should do tx_ring->tx_buffer = NULL also, to avoid
> >use after free?
> >
> >It's up to the driver. Some may call that defensive programming.
> [Suman] Agree. I pointed it out since this driver is using this approach at other places. But sure, it is up to Zhipeng.
[Zhipeng] I think Suman's suggestion is valuable, it prevents potiential use-after-free and is consistent with other free operations in the same module.
Powered by blists - more mailing lists