kernel_samsung_a53x/tools/testing/selftests/vm
Donet Tom 9aafc43cd4 selftests/mm: fix incorrect buffer->mirror size in hmm2 double_map test
[ Upstream commit 76503e1fa1a53ef041a120825d5ce81c7fe7bdd7 ]

The hmm2 double_map test was failing due to an incorrect buffer->mirror
size.  The buffer->mirror size was 6, while buffer->ptr size was 6 *
PAGE_SIZE.  The test failed because the kernel's copy_to_user function was
attempting to copy a 6 * PAGE_SIZE buffer to buffer->mirror.  Since the
size of buffer->mirror was incorrect, copy_to_user failed.

This patch corrects the buffer->mirror size to 6 * PAGE_SIZE.

Test Result without this patch
==============================
 #  RUN           hmm2.hmm2_device_private.double_map ...
 # hmm-tests.c:1680:double_map:Expected ret (-14) == 0 (0)
 # double_map: Test terminated by assertion
 #          FAIL  hmm2.hmm2_device_private.double_map
 not ok 53 hmm2.hmm2_device_private.double_map

Test Result with this patch
===========================
 #  RUN           hmm2.hmm2_device_private.double_map ...
 #            OK  hmm2.hmm2_device_private.double_map
 ok 53 hmm2.hmm2_device_private.double_map

Link: https://lkml.kernel.org/r/20240927050752.51066-1-donettom@linux.ibm.com
Fixes: fee9f6d1b8df ("mm/hmm/test: add selftests for HMM")
Signed-off-by: Donet Tom <donettom@linux.ibm.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:02 +01:00
..
charge_reserved_hugetlb.sh selftests/mm: fix charge_reserved_hugetlb.sh test 2024-11-23 23:21:42 +01:00
compaction_test.c selftests/mm: compaction_test: fix bogus test success on Aarch64 2024-11-19 14:19:02 +01:00
config Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gup_benchmark.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hmm-tests.c selftests/mm: fix incorrect buffer->mirror size in hmm2 double_map test 2024-11-23 23:22:02 +01:00
hugepage-mmap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hugepage-shm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hugetlb_reparenting_test.sh selftests/mm: fix awk usage in charge_reserved_hugetlb.sh and hugetlb_reparenting_test.sh that may cause error 2024-11-08 11:26:12 +01:00
khugepaged.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
map_fixed_noreplace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
map_hugetlb.c Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems" 2024-11-19 12:26:38 +01:00
map_populate.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mlock-random-test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mlock2-tests.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mlock2.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mremap_dontunmap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
on-fault-limit.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pkey-helpers.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pkey-powerpc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pkey-x86.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
protection_keys.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
run_vmtests Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
test_hmm.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
test_vmalloc.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
thuge-gen.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
transhuge-stress.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
userfaultfd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
va_128TBswitch.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
virtual_address_range.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
write_hugetlb_memory.sh selftests/mm: switch to bash from sh 2024-11-18 23:19:35 +01:00
write_to_hugetlbfs.c selftests/mm: fix charge_reserved_hugetlb.sh test 2024-11-23 23:21:42 +01:00