Skip to content

Commit c4edc71

Browse files
committed
The nofault function is only prioritized in higher versions
1 parent ef435c4 commit c4edc71

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/patch/common/utils.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ int __must_check compat_copy_to_user(void __user *to, const void *from, int n)
8686
cplen = compat_bits_copy_to_user(to, from, n);
8787
} else if (kfunc(trace_seq_to_user)) {
8888
cplen = trace_seq_copy_to_user(to, from, n);
89+
} else if(kfunc(xt_data_to_user)) {
90+
cplen = compat_xt_data_copy_to_user(to, from, n);
91+
if (!cplen) cplen = n;
8992
} else {
9093
logke("no compat_copy_to_user\n");
9194
// copy_arg_to_user,
@@ -113,6 +116,8 @@ long compat_strncpy_from_user(char *dest, const char __user *src, long count)
113116
}
114117
return rc;
115118
}
119+
kfunc_call(strncpy_from_user_nofault, dest, src, count);
120+
kfunc_call(strncpy_from_unsafe_user, dest, src, count);
116121

117122
return 0;
118123
}

0 commit comments

Comments
 (0)