]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm, hwpoison: fix possible use-after-free in mf_dax_kill_procs()
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 23 Aug 2022 03:23:44 +0000 (11:23 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Aug 2022 05:03:06 +0000 (22:03 -0700)
commit56d93ca6da59015b3401a75cfc78aa2b866aa81e
tree0d49502c60014c6bb51749de782b16a9d1a3e411
parentff51890ba73f40599b81353a7742e1713a9b395c
mm, hwpoison: fix possible use-after-free in mf_dax_kill_procs()

After kill_procs(), tk will be freed without being removed from the
to_kill list.  In the next iteration, the freed list entry in the to_kill
list will be accessed, thus leading to use-after-free issue.  Adding
list_del() in kill_procs() to fix the issue.

Link: https://lkml.kernel.org/r/20220823032346.4260-5-linmiaohe@huawei.com
Fixes: c36e20249571 ("mm: introduce mf_dax_kill_procs() for fsdax case")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c