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

lkdtm/usercopy: Rename "heap" to "slab"

To more clearly distinguish between the various heap types, rename the
slab tests to "slab".

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>

+19 -19
+15 -15
drivers/misc/lkdtm/usercopy.c
··· 130 130 * This checks for whole-object size validation with hardened usercopy, 131 131 * with or without usercopy whitelisting. 132 132 */ 133 - static void do_usercopy_heap_size(bool to_user) 133 + static void do_usercopy_slab_size(bool to_user) 134 134 { 135 135 unsigned long user_addr; 136 136 unsigned char *one, *two; ··· 196 196 197 197 /* 198 198 * This checks for the specific whitelist window within an object. If this 199 - * test passes, then do_usercopy_heap_size() tests will pass too. 199 + * test passes, then do_usercopy_slab_size() tests will pass too. 200 200 */ 201 - static void do_usercopy_heap_whitelist(bool to_user) 201 + static void do_usercopy_slab_whitelist(bool to_user) 202 202 { 203 203 unsigned long user_alloc; 204 204 unsigned char *buf = NULL; ··· 272 272 } 273 273 274 274 /* Callable tests. */ 275 - static void lkdtm_USERCOPY_HEAP_SIZE_TO(void) 275 + static void lkdtm_USERCOPY_SLAB_SIZE_TO(void) 276 276 { 277 - do_usercopy_heap_size(true); 277 + do_usercopy_slab_size(true); 278 278 } 279 279 280 - static void lkdtm_USERCOPY_HEAP_SIZE_FROM(void) 280 + static void lkdtm_USERCOPY_SLAB_SIZE_FROM(void) 281 281 { 282 - do_usercopy_heap_size(false); 282 + do_usercopy_slab_size(false); 283 283 } 284 284 285 - static void lkdtm_USERCOPY_HEAP_WHITELIST_TO(void) 285 + static void lkdtm_USERCOPY_SLAB_WHITELIST_TO(void) 286 286 { 287 - do_usercopy_heap_whitelist(true); 287 + do_usercopy_slab_whitelist(true); 288 288 } 289 289 290 - static void lkdtm_USERCOPY_HEAP_WHITELIST_FROM(void) 290 + static void lkdtm_USERCOPY_SLAB_WHITELIST_FROM(void) 291 291 { 292 - do_usercopy_heap_whitelist(false); 292 + do_usercopy_slab_whitelist(false); 293 293 } 294 294 295 295 static void lkdtm_USERCOPY_STACK_FRAME_TO(void) ··· 358 358 } 359 359 360 360 static struct crashtype crashtypes[] = { 361 - CRASHTYPE(USERCOPY_HEAP_SIZE_TO), 362 - CRASHTYPE(USERCOPY_HEAP_SIZE_FROM), 363 - CRASHTYPE(USERCOPY_HEAP_WHITELIST_TO), 364 - CRASHTYPE(USERCOPY_HEAP_WHITELIST_FROM), 361 + CRASHTYPE(USERCOPY_SLAB_SIZE_TO), 362 + CRASHTYPE(USERCOPY_SLAB_SIZE_FROM), 363 + CRASHTYPE(USERCOPY_SLAB_WHITELIST_TO), 364 + CRASHTYPE(USERCOPY_SLAB_WHITELIST_FROM), 365 365 CRASHTYPE(USERCOPY_STACK_FRAME_TO), 366 366 CRASHTYPE(USERCOPY_STACK_FRAME_FROM), 367 367 CRASHTYPE(USERCOPY_STACK_BEYOND),
+4 -4
tools/testing/selftests/lkdtm/tests.txt
··· 64 64 REFCOUNT_SUB_AND_TEST_SATURATED Saturation detected: still saturated 65 65 #REFCOUNT_TIMING timing only 66 66 #ATOMIC_TIMING timing only 67 - USERCOPY_HEAP_SIZE_TO 68 - USERCOPY_HEAP_SIZE_FROM 69 - USERCOPY_HEAP_WHITELIST_TO 70 - USERCOPY_HEAP_WHITELIST_FROM 67 + USERCOPY_SLAB_SIZE_TO 68 + USERCOPY_SLAB_SIZE_FROM 69 + USERCOPY_SLAB_WHITELIST_TO 70 + USERCOPY_SLAB_WHITELIST_FROM 71 71 USERCOPY_STACK_FRAME_TO 72 72 USERCOPY_STACK_FRAME_FROM 73 73 USERCOPY_STACK_BEYOND