Subject: Re: [PATCH net v2] net: atm: Fix use-after-free bug in atm_dev_register()

From: Leon Romanovsky <[email-masked]>
Date: Wed, 14 Dec 2022 21:17:10 +0200

On Wed, Dec 14, 2022 at 08:43:58AM -0800, Jakub Kicinski wrote:
> On Wed, 14 Dec 2022 09:51:09 +0200 Leon Romanovsky wrote:
> > > Also atm_dev_register() still frees the dev on atm_register_sysfs()
> > > failure, is that okay?  
> > 
> > Yes, the kernel panic points that class_dev (not dev) had use-after-free.
> 
> How is that possible? "class_dev" is embedded in dev (struct atm_dev).

Right, the more I think about this call trace, the less I'm sure.

Thanks