diff options
author | Kees Cook <keescook@chromium.org> | 2016-02-22 14:09:29 -0800 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2016-06-10 15:57:50 -0700 |
commit | 9a49a528dcf3c2022ff89f700d5d0345b9abf288 (patch) | |
tree | 946dc7b2e73cf54e9b349f881970d47755060c42 /drivers/misc/lkdtm_rodata.c | |
parent | 426f3a53d4a1ffbe228f268e5c4af148686b7346 (diff) | |
download | linux-9a49a528dcf3c2022ff89f700d5d0345b9abf288.tar.gz |
lkdtm: add function for testing .rodata section
This adds a function that lives in the .rodata section. The section
flags are corrected using objcopy since there is no way with gcc to
declare section flags in an architecture-agnostic way.
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/misc/lkdtm_rodata.c')
-rw-r--r-- | drivers/misc/lkdtm_rodata.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/misc/lkdtm_rodata.c b/drivers/misc/lkdtm_rodata.c new file mode 100644 index 000000000000..4d0d851f02b9 --- /dev/null +++ b/drivers/misc/lkdtm_rodata.c @@ -0,0 +1,10 @@ +/* + * This includes functions that are meant to live entirely in .rodata + * (via objcopy tricks), to validate the non-executability of .rodata. + */ +#include <linux/kernel.h> + +void lkdtm_rodata_do_nothing(void) +{ + /* Does nothing. We just want an architecture agnostic "return". */ +} |