-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NPE discovered by running bpf kselftest #4729
Fix NPE discovered by running bpf kselftest #4729
Conversation
Upstream branch: c721d8f |
64752e5
to
281625f
Compare
Upstream branch: c721d8f |
29bd0ea
to
664e9fb
Compare
281625f
to
ecfb2c8
Compare
Upstream branch: c721d8f |
664e9fb
to
42410fc
Compare
ecfb2c8
to
a560614
Compare
Upstream branch: 932fc2f |
42410fc
to
b97b385
Compare
a560614
to
2566d40
Compare
Upstream branch: e2f0791 |
b97b385
to
ccfbe57
Compare
2566d40
to
5442d69
Compare
Upstream branch: dff8470 |
ccfbe57
to
1541e0b
Compare
5442d69
to
e7cfe1a
Compare
Upstream branch: dff8470 |
1541e0b
to
bcb6160
Compare
e7cfe1a
to
2dde120
Compare
Upstream branch: dd42e01 |
bcb6160
to
b652d18
Compare
2dde120
to
d21a8b5
Compare
Upstream branch: e10500b |
b652d18
to
29e4c41
Compare
d21a8b5
to
36cdeea
Compare
c8ee7f4
to
85ccea4
Compare
1380fbe
to
a77151b
Compare
Upstream branch: a7c2051 |
85ccea4
to
e33b8e5
Compare
a77151b
to
3d3dfde
Compare
Upstream branch: a7c2051 |
e33b8e5
to
dd83268
Compare
3d3dfde
to
0dc7ea2
Compare
Upstream branch: 8eef6ac |
dd83268
to
c2d618a
Compare
0dc7ea2
to
a786630
Compare
Upstream branch: c5d2bac |
c2d618a
to
9025a8c
Compare
a786630
to
47415e2
Compare
Upstream branch: c5d2bac |
9025a8c
to
e6dee86
Compare
47415e2
to
a16555e
Compare
Upstream branch: c5d2bac |
Previously sk_msg_memcopy_from_iter returns the copied bytes from the last copy_from_iter{,_nocache} call upon success. This commit changes it to return the total number of copied bytes on success. Signed-off-by: Levi Zim <[email protected]>
bpf kselftest sockhash::test_txmsg_cork_hangs in test_sockmap.c triggers a kernel NULL pointer dereference: BUG: kernel NULL pointer dereference, address: 0000000000000008 ? __die_body+0x6e/0xb0 ? __die+0x8b/0xa0 ? page_fault_oops+0x358/0x3c0 ? local_clock+0x19/0x30 ? lock_release+0x11b/0x440 ? kernelmode_fixup_or_oops+0x54/0x60 ? __bad_area_nosemaphore+0x4f/0x210 ? mmap_read_unlock+0x13/0x30 ? bad_area_nosemaphore+0x16/0x20 ? do_user_addr_fault+0x6fd/0x740 ? prb_read_valid+0x1d/0x30 ? exc_page_fault+0x55/0xd0 ? asm_exc_page_fault+0x2b/0x30 ? splice_to_socket+0x52e/0x630 ? shmem_file_splice_read+0x2b1/0x310 direct_splice_actor+0x47/0x70 splice_direct_to_actor+0x133/0x300 ? do_splice_direct+0x90/0x90 do_splice_direct+0x64/0x90 ? __ia32_sys_tee+0x30/0x30 do_sendfile+0x214/0x300 __se_sys_sendfile64+0x8e/0xb0 __x64_sys_sendfile64+0x25/0x30 x64_sys_call+0xb82/0x2840 do_syscall_64+0x75/0x110 entry_SYSCALL_64_after_hwframe+0x4b/0x53 This is caused by tcp_bpf_sendmsg() returning a larger value(12289) than size (8192), which causes the while loop in splice_to_socket() to release an uninitialized pipe buf. The underlying cause is that this code assumes sk_msg_memcopy_from_iter() will copy all bytes upon success but it actually might only copy part of it. This commit changes it to use the real copied bytes. Signed-off-by: Levi Zim <[email protected]>
e6dee86
to
72f6add
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=913470 irrelevant now. Closing PR. |
Pull request for series with
subject: Fix NPE discovered by running bpf kselftest
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=913470