Patch "selftests/mm: fix incorrect buffer->mirror size in hmm2 double_map test" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests/mm: fix incorrect buffer->mirror size in hmm2 double_map test

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-mm-fix-incorrect-buffer-mirror-size-in-hmm.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit df1320a5a6d8564e0aba032b210d9f28cb42dbd9
Author: Donet Tom <donettom@xxxxxxxxxxxxx>
Date:   Fri Sep 27 00:07:52 2024 -0500

    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@xxxxxxxxxxxxx
    Fixes: fee9f6d1b8df ("mm/hmm/test: add selftests for HMM")
    Signed-off-by: Donet Tom <donettom@xxxxxxxxxxxxx>
    Reviewed-by: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx>
    Cc: Jérôme Glisse <jglisse@xxxxxxxxxx>
    Cc: Kees Cook <keescook@xxxxxxxxxxxx>
    Cc: Mark Brown <broonie@xxxxxxxxxx>
    Cc: Przemek Kitszel <przemyslaw.kitszel@xxxxxxxxx>
    Cc: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
    Cc: Shuah Khan <shuah@xxxxxxxxxx>
    Cc: Ralph Campbell <rcampbell@xxxxxxxxxx>
    Cc: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
    Cc: <stable@xxxxxxxxxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/vm/hmm-tests.c b/tools/testing/selftests/vm/hmm-tests.c
index 4adaad1b822f0..95af1a73f505f 100644
--- a/tools/testing/selftests/vm/hmm-tests.c
+++ b/tools/testing/selftests/vm/hmm-tests.c
@@ -1652,7 +1652,7 @@ TEST_F(hmm2, double_map)
 
 	buffer->fd = -1;
 	buffer->size = size;
-	buffer->mirror = malloc(npages);
+	buffer->mirror = malloc(size);
 	ASSERT_NE(buffer->mirror, NULL);
 
 	/* Reserve a range of addresses. */




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux