@@ -150,6 +150,11 @@ static int bpf_test_finish(const union bpf_attr *kattr,if(data_out){intlen=sinfo?copy_size-sinfo->xdp_frags_size:copy_size;+if(len<0){+err=-ENOSPC;+gotoout;+}+if(copy_to_user(data_out,data,len))gotoout;
From: Daniel Borkmann <daniel@iogearbox.net> Date: 2022-03-01 16:33:29
On 3/1/22 12:23 AM, Stanislav Fomichev wrote:
Syzkaller reports another issue:
WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230
check_copy_size include/linux/thread_info.h:230 [inline]
WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230
copy_to_user include/linux/uaccess.h:199 [inline]
WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230
bpf_test_finish.isra.0+0x4b2/0x680 net/bpf/test_run.c:171
This can happen when the userspace buffer is smaller than head+frags.
Return ENOSPC in this case.
Fixes: 7855e0db150a ("bpf: test_run: add xdp_shared_info pointer in bpf_test_finish signature")
Cc: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Stanislav Fomichev <redacted>
Do we have a Reported-by tag for syzkaller so it can match against its report?
Thanks,
Daniel
From: Stanislav Fomichev <hidden> Date: 2022-03-01 16:38:39
On Tue, Mar 1, 2022 at 8:33 AM Daniel Borkmann [off-list ref] wrote:
On 3/1/22 12:23 AM, Stanislav Fomichev wrote:
quoted
Syzkaller reports another issue:
WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230
check_copy_size include/linux/thread_info.h:230 [inline]
WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230
copy_to_user include/linux/uaccess.h:199 [inline]
WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230
bpf_test_finish.isra.0+0x4b2/0x680 net/bpf/test_run.c:171
This can happen when the userspace buffer is smaller than head+frags.
Return ENOSPC in this case.
Fixes: 7855e0db150a ("bpf: test_run: add xdp_shared_info pointer in bpf_test_finish signature")
Cc: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Stanislav Fomichev <redacted>
Do we have a Reported-by tag for syzkaller so it can match against its report?