Re: [PATCH] EDAC/mc: Fix use-after-free and memleaks during device removal

From: Robert Richter
Date: Sun Dec 22 2019 - 12:23:56 EST


On 22.12.19 13:15:00, Borislav Petkov wrote:
> On Wed, Dec 18, 2019 at 06:22:08AM +0000, Robert Richter wrote:

> > 1) Use-after-free:
> >
> > On 27.11.19 17:07:33, John Garry wrote:
> > > [ 22.104498] BUG: KASAN: use-after-free in
> > > edac_remove_sysfs_mci_device+0x148/0x180
> >
> > The use-after-free is triggered in edac_remove_sysfs_mci_device(). It
> > became an issue with commit c498afaf7df8 ("EDAC: Introduce an
> > mci_for_each_dimm() iterator").
>
> ... which means:
>
> Fixes: c498afaf7df8 ("EDAC: Introduce an mci_for_each_dimm() iterator")
>
> ?

Wouldn't say c498afaf7df8 is broken, it is the release code itself.
This patch reveals it. But for patch logistics use the above tag.

-Robert