Re: [PATCH] char: pcmcia: scr24x_cs: Fix use-after-free in scr24x_fops

From: Hyunwoo Kim
Date: Fri Sep 16 2022 - 04:11:33 EST


On Fri, Sep 16, 2022 at 08:59:44AM +0200, Arnd Bergmann wrote:
> This appears to introduce a new use-after-free, when the kref_put()
> frees the 'dev' structure and you unlock the mutex in that structure
> afterwards.

yes. Every patch I've submitted has this issue.
I'll replace the mutex with a global variable and submit a v2 patch that fixes other issues.