mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
misc: lkdtm: Add volatile to intentional NULL pointer reference
Add a volatile qualifier where a NULL pointer is deliberately dereferenced to trigger a panic. Without the volatile qualifier clang will issue the following warning: "indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]" and replace the pointer reference with a __builtin_trap() (which generates a ud2 instruction on x86_64). Signed-off-by: Michael Davidson <[email protected]> Signed-off-by: Matthias Kaehlcke <[email protected]> Acked-by: Kees Cook <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
073a457d9e
commit
9e18308a5d
1 changed files with 1 additions and 1 deletions
|
|
@ -69,7 +69,7 @@ void lkdtm_WARNING(void)
|
|||
|
||||
void lkdtm_EXCEPTION(void)
|
||||
{
|
||||
*((int *) 0) = 0;
|
||||
*((volatile int *) 0) = 0;
|
||||
}
|
||||
|
||||
void lkdtm_LOOP(void)
|
||||
|
|
|
|||
Loading…
Reference in a new issue