diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2022-06-09 15:08:35 +0200 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-06-17 04:48:30 +0200 |
commit | ed913b055a74b723976f8e885a3395162a0371e6 (patch) | |
tree | f072fe1621a6904e3e78a851f9fce5134d365f49 /mm/kmemleak.c | |
parent | mm/memremap: fix wrong function name above memremap_pages() (diff) | |
download | linux-ed913b055a74b723976f8e885a3395162a0371e6.tar.xz linux-ed913b055a74b723976f8e885a3395162a0371e6.zip |
lib/test_hmm: avoid accessing uninitialized pages
If make_device_exclusive_range() fails or returns pages marked for
exclusive access less than required, remaining fields of pages will left
uninitialized. So dmirror_atomic_map() will access those yet
uninitialized fields of pages. To fix it, do dmirror_atomic_map() iff all
pages are marked for exclusive access (we will break if mapped is less
than required anyway) so we won't access those uninitialized fields of
pages.
Link: https://lkml.kernel.org/r/20220609130835.35110-1-linmiaohe@huawei.com
Fixes: b659baea7546 ("mm: selftests for exclusive device memory")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions