]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm-kasan-kmsan-copy_from-to_kernel_nofault-fix
authorAndrew Morton <akpm@linux-foundation.org>
Tue, 15 Oct 2024 23:53:38 +0000 (16:53 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:29:10 +0000 (21:29 -0700)
fix comment layout, per checkpatch

Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kasan/kasan_test_c.c

index e52c6ab803e80faa581bc5e433659046699bb98e..fe132ce3c2b34ea5137c1ba373a5d98e61a86de8 100644 (file)
@@ -1934,8 +1934,10 @@ static void copy_to_kernel_nofault_oob(struct kunit *test)
        char buf[128];
        size_t size = sizeof(buf);
 
-       /* This test currently fails with the HW_TAGS mode.
-        * The reason is unknown and needs to be investigated. */
+       /*
+        * This test currently fails with the HW_TAGS mode. The reason is
+        * unknown and needs to be investigated.
+        */
        KASAN_TEST_NEEDS_CONFIG_OFF(test, CONFIG_KASAN_HW_TAGS);
 
        ptr = kmalloc(size - KASAN_GRANULE_SIZE, GFP_KERNEL);
@@ -1943,16 +1945,16 @@ static void copy_to_kernel_nofault_oob(struct kunit *test)
        OPTIMIZER_HIDE_VAR(ptr);
 
        /*
-       * We test copy_to_kernel_nofault() to detect corrupted memory that is
-       * being written into the kernel. In contrast, copy_from_kernel_nofault()
-       * is primarily used in kernel helper functions where the source address
-       * might be random or uninitialized. Applying KASAN instrumentation to
-       * copy_from_kernel_nofault() could lead to false positives.
-       * By focusing KASAN checks only on copy_to_kernel_nofault(),
-       * we ensure that only valid memory is written to the kernel,
-       * minimizing the risk of kernel corruption while avoiding
-       * false positives in the reverse case.
-       */
+        * We test copy_to_kernel_nofault() to detect corrupted memory that is
+        * being written into the kernel. In contrast,
+        * copy_from_kernel_nofault() is primarily used in kernel helper
+        * functions where the source address might be random or uninitialized.
+        * Applying KASAN instrumentation to copy_from_kernel_nofault() could
+        * lead to false positives.  By focusing KASAN checks only on
+        * copy_to_kernel_nofault(), we ensure that only valid memory is
+        * written to the kernel, minimizing the risk of kernel corruption
+        * while avoiding false positives in the reverse case.
+        */
        KUNIT_EXPECT_KASAN_FAIL(test,
                copy_to_kernel_nofault(&buf[0], ptr, size));
        KUNIT_EXPECT_KASAN_FAIL(test,