]> git.baikalelectronics.ru Git - kernel.git/commit
uaccess: Add non-pagefault user-space write function
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 1 Nov 2019 23:17:56 +0000 (00:17 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 2 Nov 2019 19:39:12 +0000 (12:39 -0700)
commita293fca1da3547158f7f228a189ad66caad357e3
tree0e36ebafa09168d30407e3b5fb06905647f91262
parent288793229f62c774281adb35b7eb1fb825d83e54
uaccess: Add non-pagefault user-space write function

Commit 1d833f1884ca ("uaccess: Add non-pagefault user-space read functions")
missed to add probe write function, therefore factor out a probe_write_common()
helper with most logic of probe_kernel_write() except setting KERNEL_DS, and
add a new probe_user_write() helper so it can be used from BPF side.

Again, on some archs, the user address space and kernel address space can
co-exist and be overlapping, so in such case, setting KERNEL_DS would mean
that the given address is treated as being in kernel address space.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/bpf/9df2542e68141bfa3addde631441ee45503856a8.1572649915.git.daniel@iogearbox.net
include/linux/uaccess.h
mm/maccess.c