Lines Matching full:size2
380 size_t size1, size_t size2) in krealloc_more_oob_helper() argument
385 KUNIT_ASSERT_LT(test, size1, size2); in krealloc_more_oob_helper()
386 middle = size1 + (size2 - size1) / 2; in krealloc_more_oob_helper()
391 ptr2 = krealloc(ptr1, size2, GFP_KERNEL); in krealloc_more_oob_helper()
397 /* All offsets up to size2 must be accessible. */ in krealloc_more_oob_helper()
401 ptr2[size2 - 1] = 'x'; in krealloc_more_oob_helper()
403 /* Generic mode is precise, so unaligned size2 must be inaccessible. */ in krealloc_more_oob_helper()
405 KUNIT_EXPECT_KASAN_FAIL(test, ptr2[size2] = 'x'); in krealloc_more_oob_helper()
407 /* For all modes first aligned offset after size2 must be inaccessible. */ in krealloc_more_oob_helper()
409 ptr2[round_up(size2, KASAN_GRANULE_SIZE)] = 'x'); in krealloc_more_oob_helper()
415 size_t size1, size_t size2) in krealloc_less_oob_helper() argument
420 KUNIT_ASSERT_LT(test, size2, size1); in krealloc_less_oob_helper()
421 middle = size2 + (size1 - size2) / 2; in krealloc_less_oob_helper()
426 ptr2 = krealloc(ptr1, size2, GFP_KERNEL); in krealloc_less_oob_helper()
433 ptr2[size2 - 1] = 'x'; in krealloc_less_oob_helper()
435 /* Generic mode is precise, so unaligned size2 must be inaccessible. */ in krealloc_less_oob_helper()
437 KUNIT_EXPECT_KASAN_FAIL(test, ptr2[size2] = 'x'); in krealloc_less_oob_helper()
439 /* For all modes first aligned offset after size2 must be inaccessible. */ in krealloc_less_oob_helper()
441 ptr2[round_up(size2, KASAN_GRANULE_SIZE)] = 'x'); in krealloc_less_oob_helper()
444 * For all modes all size2, middle, and size1 should land in separate in krealloc_less_oob_helper()
447 KUNIT_EXPECT_LE(test, round_up(size2, KASAN_GRANULE_SIZE), in krealloc_less_oob_helper()
488 int size2 = 235; in krealloc_uaf() local
494 KUNIT_EXPECT_KASAN_FAIL(test, ptr2 = krealloc(ptr1, size2, GFP_KERNEL)); in krealloc_uaf()