[PATCH] mm: Change count_mm_mlocked_page_nr return type

2019-05-12 Thread Weikang shi
From: swkhack In 64-bit machine,the value of "vma->vm_end - vma->vm_start" maybe negative in 32bit int and the "count >> PAGE_SHIFT"'s result will be wrong.So change the local variable and return value to unsigned long will fix the problem. Signed-off-by: swkhack --- mm/mlock.c | 4 ++-- 1 fil

[PATCH] lkdtm: fix potential use after free

2019-04-24 Thread Weikang shi
From: swkhack The function lkdtm_WRITE_AFTER_FREE calls kfree(base) to free the memory of base. However, following kfree(base), it write the memory which base point to via base[offset] = 0x0abcdef0. This may result in a use-after-free bug. This patch moves kfree(base) after the write. Signed-of

[PATCH] lkdtm: fix potential use after free

2019-04-24 Thread Weikang shi
From: swkhack The function lkdtm_READ_AFTER_FREE calls kfree(base) to free the memory of base. However, following kfree(base), it access the memory which base point to via base[offset]. This may result in a use-after-free bug. This patch moves kfree(base) after the dereference. Signed-off-by: sw

[PATCH] mm: Change count_mm_mlocked_page_nr return type

2019-04-22 Thread Weikang shi
From: swkhack In 64-bit machine,the value of "vma->vm_end - vma->vm_start" maybe negative in 32bit int and the "count >> PAGE_SHIFT"'s rusult will be wrong.So change the local variable and return value to unsigned long will fix the problem. Signed-off-by: swkhack --- mm/mlock.c | 4 ++-- 1 fil

[PATCH] time: fix a assignment error in ntp module

2019-04-22 Thread Weikang shi
From: swkhack It is meanless to check a 64bit(txc->constant) value is postive when the value has to be assigned to a 32 bit variable(*time_tai). So I make a temp type conversion before the compare. Signed-off-by: swkhack --- kernel/time/ntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] fs: Eliminate redundant assignments

2018-08-23 Thread Weikang Shi
after the assignments statement ,all return statement do not use ret variable,so delete the assignments. Signed-off-by: Weikang Shi --- fs/afs/dir.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 855bf2b..5a3770a 100644 --- a/fs/afs/dir.c +++ b/fs/afs

[PATCH] fs: fix local var type

2018-08-23 Thread Weikang Shi
In the seq_hex_dump function,the remaining variable is int, but it receive a type of size_t argument. So I change the type of remaining Signed-off-by: Weikang Shi --- fs/seq_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/seq_file.c b/fs/seq_file.c index 1dea7a8