diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2020-09-07 17:11:36 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2020-09-14 11:38:34 +0200 |
commit | 36c2733c439caa424fe2b7dded870913dcb868ac (patch) | |
tree | 8846d2fa2c940d00b92e1bbc08681951c57317d1 /arch/s390/mm | |
parent | 9d719d39aab41d3b8b6f259574dc29a27f60e66c (diff) |
s390/mm,ptdump: hold memory hotplug lock while walking for kernel page table dump
This is the s390 variant of commit bf2b59f60ee1 ("arm64/mm: Hold
memory hotplug lock while walking for kernel page table dump").
Right now this doesn't fix any real bug, however as soon as kvm
patches get merged which make use of memory remove we might end up
dereferencing/accessing freed page tables.
Therefore fix this potential bug already now.
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r-- | arch/s390/mm/dump_pagetables.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/mm/dump_pagetables.c b/arch/s390/mm/dump_pagetables.c index 93a29e2f13d4..3c5e4055a3d2 100644 --- a/arch/s390/mm/dump_pagetables.c +++ b/arch/s390/mm/dump_pagetables.c @@ -129,7 +129,9 @@ static int ptdump_show(struct seq_file *m, void *v) .marker = address_markers, }; + get_online_mems(); ptdump_walk_pgd(&st.ptdump, &init_mm, NULL); + put_online_mems(); return 0; } DEFINE_SHOW_ATTRIBUTE(ptdump); |