Lines Matching full:size2
284 size_t size1, size_t size2) in krealloc_more_oob_helper() argument
289 KUNIT_ASSERT_LT(test, size1, size2); in krealloc_more_oob_helper()
290 middle = size1 + (size2 - size1) / 2; in krealloc_more_oob_helper()
295 ptr2 = krealloc(ptr1, size2, GFP_KERNEL); in krealloc_more_oob_helper()
301 /* All offsets up to size2 must be accessible. */ in krealloc_more_oob_helper()
305 ptr2[size2 - 1] = 'x'; in krealloc_more_oob_helper()
307 /* Generic mode is precise, so unaligned size2 must be inaccessible. */ in krealloc_more_oob_helper()
309 KUNIT_EXPECT_KASAN_FAIL(test, ptr2[size2] = 'x'); in krealloc_more_oob_helper()
311 /* For all modes first aligned offset after size2 must be inaccessible. */ in krealloc_more_oob_helper()
313 ptr2[round_up(size2, KASAN_GRANULE_SIZE)] = 'x'); in krealloc_more_oob_helper()
319 size_t size1, size_t size2) in krealloc_less_oob_helper() argument
324 KUNIT_ASSERT_LT(test, size2, size1); in krealloc_less_oob_helper()
325 middle = size2 + (size1 - size2) / 2; in krealloc_less_oob_helper()
330 ptr2 = krealloc(ptr1, size2, GFP_KERNEL); in krealloc_less_oob_helper()
337 ptr2[size2 - 1] = 'x'; in krealloc_less_oob_helper()
339 /* Generic mode is precise, so unaligned size2 must be inaccessible. */ in krealloc_less_oob_helper()
341 KUNIT_EXPECT_KASAN_FAIL(test, ptr2[size2] = 'x'); in krealloc_less_oob_helper()
343 /* For all modes first aligned offset after size2 must be inaccessible. */ in krealloc_less_oob_helper()
345 ptr2[round_up(size2, KASAN_GRANULE_SIZE)] = 'x'); in krealloc_less_oob_helper()
348 * For all modes all size2, middle, and size1 should land in separate in krealloc_less_oob_helper()
351 KUNIT_EXPECT_LE(test, round_up(size2, KASAN_GRANULE_SIZE), in krealloc_less_oob_helper()
398 int size2 = 235; in krealloc_uaf() local
404 KUNIT_EXPECT_KASAN_FAIL(test, ptr2 = krealloc(ptr1, size2, GFP_KERNEL)); in krealloc_uaf()