Lines Matching +full:use +full:- +full:case

1 // SPDX-License-Identifier: GPL-2.0
4 * For each test case checks the presence (or absence) of generated reports.
8 * Copyright (C) 2021-2022, Google LLC.
52 * The provided @buf is not NUL-terminated; copy no more than in probe_console()
53 * @len bytes and let strscpy() add the missing NUL-terminator. in probe_console()
88 /* Doubled-checked locking. */ in report_matches()
89 if (!report_available() || !r->symbol) in report_matches()
90 return (!report_available() && !r->symbol); in report_matches()
96 end = &expected_header[sizeof(expected_header) - 1]; in report_matches()
98 cur += scnprintf(cur, end - cur, "BUG: KMSAN: %s", r->error_type); in report_matches()
100 scnprintf(cur, end - cur, " in %s", r->symbol); in report_matches()
131 #define USE(x) \ macro
147 EXPECTATION_ETYPE_FN(e, "uninit-value", fn)
150 EXPECTATION_ETYPE_FN(e, "use-after-free", __func__)
152 /* Test case: ensure that kmalloc() returns uninitialized memory. */
160 USE(*ptr); in test_uninit_kmalloc()
165 * Test case: ensure that kmalloc'ed memory becomes initialized after memset().
175 USE(*ptr); in test_init_kmalloc()
179 /* Test case: ensure that kzalloc() returns initialized memory. */
187 USE(*ptr); in test_init_kzalloc()
191 /* Test case: ensure that local variables are uninitialized by default. */
198 USE(cond); in test_uninit_stack_var()
202 /* Test case: ensure that local variables with initializers are initialized. */
209 USE(cond); in test_init_stack_var()
215 USE(arg1); in two_param_fn_2()
216 USE(arg2); in two_param_fn_2()
222 USE(arg); in one_param_fn()
230 USE(arg1); in two_param_fn()
231 USE(arg2); in two_param_fn()
259 * Test case: ensure that uninitialized values are tracked through function
269 USE(signed_sum3(a, b, c)); in test_uninit_multiple_params()
283 * Test case: ensure kmsan_check_memory() reports an error when checking
301 * Test case: check that a virtual memory range created with vmap() from
332 * Test case: ensure that memset() can initialize a buffer allocated via
345 USE(buf[0]); in test_init_vmalloc()
352 /* Test case: ensure that use-after-free reporting works. */
359 kunit_info(test, "use-after-free in kmalloc-ed buffer (UMR report)\n"); in test_uaf()
365 USE(value); in test_uaf()
370 * Test case: ensure that uninitialized values are propagated through per-CPU
383 USE(check); in test_percpu_propagate()
388 * Test case: ensure that passing uninitialized values to printk() leads to an
410 * Test case: ensure that memcpy() correctly copies uninitialized values between
428 * Test case: ensure that memcpy() correctly copies uninitialized values between
431 * Copying aligned 4-byte value to an unaligned one leads to touching two
432 * aligned 4-byte values. This test case checks that KMSAN correctly reports an
450 * Test case: ensure that memcpy() correctly copies uninitialized values between
453 * Copying aligned 4-byte value to an unaligned one leads to touching two
454 * aligned 4-byte values. This test case checks that KMSAN correctly reports an
466 "memcpy()ing aligned uninit src to unaligned dst - part 2 (UMR report)\n"); in test_memcpy_aligned_to_unaligned2()
475 array[start] = array[start - 1] + array[start - 2]; in fibonacci()
485 int last = ARRAY_SIZE(accum) - 1; in test_long_origin_chain()
543 if (!strcmp(tp->name, "console")) in register_tracepoints()
549 if (!strcmp(tp->name, "console")) in unregister_tracepoints()