Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kunit/usercopy: Disable testing on !CONFIG_MMU

Since arch_pick_mmap_layout() is an inline for non-MMU systems, disable
this test there.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406160505.uBge6TMY-lkp@intel.com/
Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Kees Cook and committed by
Shuah Khan
4d6cf248 cf6219ee

+11
+4
lib/kunit/user_alloc.c
··· 30 30 if (current->mm) 31 31 return 0; 32 32 33 + /* arch_pick_mmap_layout() is only sane with MMU systems. */ 34 + if (!IS_ENABLED(CONFIG_MMU)) 35 + return -EINVAL; 36 + 33 37 mm = mm_alloc(); 34 38 if (!mm) 35 39 return -ENOMEM;
+5
lib/usercopy_kunit.c
··· 290 290 struct usercopy_test_priv *priv; 291 291 unsigned long user_addr; 292 292 293 + if (!IS_ENABLED(CONFIG_MMU)) { 294 + kunit_skip(test, "Userspace allocation testing not available on non-MMU systems"); 295 + return 0; 296 + } 297 + 293 298 priv = kunit_kzalloc(test, sizeof(*priv), GFP_KERNEL); 294 299 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv); 295 300 test->priv = priv;
+2
mm/util.c
··· 484 484 clear_bit(MMF_TOPDOWN, &mm->flags); 485 485 } 486 486 #endif 487 + #ifdef CONFIG_MMU 487 488 EXPORT_SYMBOL_IF_KUNIT(arch_pick_mmap_layout); 489 + #endif 488 490 489 491 /** 490 492 * __account_locked_vm - account locked pages to an mm's locked_vm