--- zzzz-none-000/linux-4.4.271/drivers/misc/lkdtm.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/drivers/misc/lkdtm.c 2023-04-19 10:22:29.000000000 +0000 @@ -330,9 +330,10 @@ static noinline void corrupt_stack(void) { /* Use default char array length that triggers stack protection. */ - char data[8]; - + volatile char data[8]; memset((void *)data, 0, 64); + /* print data so that compiler wouldn't optimize the code */ + pr_info("print data[0]:%c\n", data[0]); } static void execute_location(void *dst)