mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08: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
89086d9cfb
commit
8aee7c9bba
@ -109,7 +109,12 @@ void lkdtm_WRITE_KERN(void)
|
||||
size_t size;
|
||||
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…
x
Reference in New Issue
Block a user