Commit e969c860 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'edac_urgent_for_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull EDAC fix from Borislav Petkov:
 "Fix ghes_edac UAF case triggered by KASAN and DEBUG_TEST_DRIVER_REMOVE.

  Future pending rework of the ghes_edac instances registration will do
  away with the single memory controller per system model and that ugly
  hackery there.

  This is a minimal fix for stable@, courtesy of James Morse"

* tag 'edac_urgent_for_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/ghes: Fix Use after free in ghes_edac remove path
parents 54955e3b 1e72e673
...@@ -553,7 +553,11 @@ void ghes_edac_unregister(struct ghes *ghes) ...@@ -553,7 +553,11 @@ void ghes_edac_unregister(struct ghes *ghes)
if (!ghes_pvt) if (!ghes_pvt)
return; return;
if (atomic_dec_return(&ghes_init))
return;
mci = ghes_pvt->mci; mci = ghes_pvt->mci;
ghes_pvt = NULL;
edac_mc_del_mc(mci->pdev); edac_mc_del_mc(mci->pdev);
edac_mc_free(mci); edac_mc_free(mci);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment