mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
lkdtm: Correct the size value for WRITE_KERN
Correct the value of size, WRITE_KERN will not work as expected if the do_overwritten is less than do_nothing. Change-Id: I2c69c62829cd55f280efd63763316b91691c0620 Signed-off-by: Lijuan Gao <lijuang@codeaurora.org>
This commit is contained in:
parent
f4a83a443c
commit
15db0b2d24
1 changed files with 6 additions and 1 deletions
|
|
@ -113,7 +113,12 @@ void lkdtm_WRITE_KERN(void)
|
|||
size_t size;
|
||||
volatile unsigned char *ptr;
|
||||
|
||||
size = (unsigned long)do_overwritten - (unsigned long)do_nothing;
|
||||
if ((unsigned long)do_overwritten < (unsigned long)do_nothing)
|
||||
size = (unsigned long)do_nothing -
|
||||
(unsigned long)do_overwritten;
|
||||
else
|
||||
size = (unsigned long)do_overwritten -
|
||||
(unsigned long)do_nothing;
|
||||
ptr = (unsigned char *)do_overwritten;
|
||||
|
||||
pr_info("attempting bad %zu byte write at %px\n", size, ptr);
|
||||
|
|
|
|||
Loading…
Reference in a new issue