Re: [PATCH bpf v4 2/2] selftest/bpf: Test bpf_probe_read_user_str() strips trailing bytes after NUL

2020-11-05 Thread Andrii Nakryiko
On Thu, Nov 5, 2020 at 4:06 PM Daniel Xu wrote: > > Previously, bpf_probe_read_user_str() could potentially overcopy the > trailing bytes after the NUL due to how do_strncpy_from_user() does the > copy in long-sized strides. The issue has been fixed in the previous > commit. > > This commit adds

Re: [PATCH bpf v4 2/2] selftest/bpf: Test bpf_probe_read_user_str() strips trailing bytes after NUL

2020-11-05 Thread Song Liu
> On Nov 5, 2020, at 4:06 PM, Daniel Xu wrote: > > Previously, bpf_probe_read_user_str() could potentially overcopy the > trailing bytes after the NUL due to how do_strncpy_from_user() does the > copy in long-sized strides. The issue has been fixed in the previous > commit. > > This commit

[PATCH bpf v4 2/2] selftest/bpf: Test bpf_probe_read_user_str() strips trailing bytes after NUL

2020-11-05 Thread Daniel Xu
Previously, bpf_probe_read_user_str() could potentially overcopy the trailing bytes after the NUL due to how do_strncpy_from_user() does the copy in long-sized strides. The issue has been fixed in the previous commit. This commit adds a selftest that ensures we don't regress