// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2020 Francis Laniel <[email protected]> * * Add tests related to fortified functions in this file. */ #include "lkdtm.h" #include <linux/string.h> #include <linux/slab.h> static volatile int fortify_scratch_space; static void lkdtm_FORTIFY_STR_OBJECT(void) { … } static void lkdtm_FORTIFY_STR_MEMBER(void) { … } static void lkdtm_FORTIFY_MEM_OBJECT(void) { … } static void lkdtm_FORTIFY_MEM_MEMBER(void) { … } /* * Calls fortified strscpy to test that it returns the same result as vanilla * strscpy and generate a panic because there is a write overflow (i.e. src * length is greater than dst length). */ static void lkdtm_FORTIFY_STRSCPY(void) { … } static struct crashtype crashtypes[] = …; struct crashtype_category fortify_crashtypes = …;