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>tirimbino
parent
426f3a53d4
commit
9a49a528dc
@ -0,0 +1,6 @@ |
||||
#ifndef __LKDTM_H |
||||
#define __LKDTM_H |
||||
|
||||
void lkdtm_rodata_do_nothing(void); |
||||
|
||||
#endif |
@ -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". */ |
||||
} |
Loading…
Reference in new issue