Lines Matching full:size2
345 size_t size1, size_t size2) in krealloc_more_oob_helper() argument
350 KUNIT_ASSERT_LT(test, size1, size2); in krealloc_more_oob_helper()
351 middle = size1 + (size2 - size1) / 2; in krealloc_more_oob_helper()
356 ptr2 = krealloc(ptr1, size2, GFP_KERNEL); in krealloc_more_oob_helper()
362 /* All offsets up to size2 must be accessible. */ in krealloc_more_oob_helper()
366 ptr2[size2 - 1] = 'x'; in krealloc_more_oob_helper()
368 /* Generic mode is precise, so unaligned size2 must be inaccessible. */ in krealloc_more_oob_helper()
370 KUNIT_EXPECT_KASAN_FAIL(test, ptr2[size2] = 'x'); in krealloc_more_oob_helper()
372 /* For all modes first aligned offset after size2 must be inaccessible. */ in krealloc_more_oob_helper()
374 ptr2[round_up(size2, KASAN_GRANULE_SIZE)] = 'x'); in krealloc_more_oob_helper()
380 size_t size1, size_t size2) in krealloc_less_oob_helper() argument
385 KUNIT_ASSERT_LT(test, size2, size1); in krealloc_less_oob_helper()
386 middle = size2 + (size1 - size2) / 2; in krealloc_less_oob_helper()
391 ptr2 = krealloc(ptr1, size2, GFP_KERNEL); in krealloc_less_oob_helper()
398 ptr2[size2 - 1] = 'x'; in krealloc_less_oob_helper()
400 /* Generic mode is precise, so unaligned size2 must be inaccessible. */ in krealloc_less_oob_helper()
402 KUNIT_EXPECT_KASAN_FAIL(test, ptr2[size2] = 'x'); in krealloc_less_oob_helper()
404 /* For all modes first aligned offset after size2 must be inaccessible. */ in krealloc_less_oob_helper()
406 ptr2[round_up(size2, KASAN_GRANULE_SIZE)] = 'x'); in krealloc_less_oob_helper()
409 * For all modes all size2, middle, and size1 should land in separate in krealloc_less_oob_helper()
412 KUNIT_EXPECT_LE(test, round_up(size2, KASAN_GRANULE_SIZE), in krealloc_less_oob_helper()
453 int size2 = 235; in krealloc_uaf() local
459 KUNIT_EXPECT_KASAN_FAIL(test, ptr2 = krealloc(ptr1, size2, GFP_KERNEL)); in krealloc_uaf()