We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a4b9a4 commit 5163e04Copy full SHA for 5163e04
kernel/trace/trace_kprobe.c
@@ -878,22 +878,14 @@ static const struct file_operations kprobe_profile_ops = {
878
static nokprobe_inline int
879
fetch_store_strlen(unsigned long addr)
880
{
881
- mm_segment_t old_fs;
882
int ret, len = 0;
883
u8 c;
884
885
- old_fs = get_fs();
886
- set_fs(KERNEL_DS);
887
- pagefault_disable();
888
-
889
do {
890
- ret = __copy_from_user_inatomic(&c, (u8 *)addr + len, 1);
+ ret = probe_mem_read(&c, (u8 *)addr + len, 1);
891
len++;
892
} while (c && ret == 0 && len < MAX_STRING_SIZE);
893
894
- pagefault_enable();
895
- set_fs(old_fs);
896
897
return (ret < 0) ? ret : len;
898
}
899
0 commit comments