-
Notifications
You must be signed in to change notification settings - Fork 128
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 #8155
Conversation
Upstream branch: c721d8f |
e5644e7
to
5d3ed6f
Compare
Upstream branch: c721d8f |
656ee0f
to
3270334
Compare
5d3ed6f
to
525b4ba
Compare
Upstream branch: c721d8f |
3270334
to
dbd4b19
Compare
525b4ba
to
c7dec6c
Compare
Upstream branch: 932fc2f |
dbd4b19
to
a2c2ee8
Compare
c7dec6c
to
cdbeaf5
Compare
Upstream branch: e2f0791 |
a2c2ee8
to
ad4820f
Compare
cdbeaf5
to
045dfdf
Compare
Upstream branch: dff8470 |
ad4820f
to
8ac212c
Compare
045dfdf
to
3839fd7
Compare
Upstream branch: dff8470 |
8ac212c
to
51e0a19
Compare
3839fd7
to
1547d62
Compare
Upstream branch: dd42e01 |
51e0a19
to
7de730f
Compare
1547d62
to
aafa91b
Compare
Upstream branch: e10500b |
Upstream branch: 58ecb3a |
b168a36
to
3c7f6d7
Compare
e2b857e
to
9a051e1
Compare
Upstream branch: 58ecb3a |
3c7f6d7
to
79a8a94
Compare
9a051e1
to
bef6461
Compare
Upstream branch: a7c2051 |
79a8a94
to
c0450c8
Compare
bef6461
to
04c6b5e
Compare
Upstream branch: a7c2051 |
c0450c8
to
671a3f0
Compare
04c6b5e
to
419af5f
Compare
Upstream branch: 8eef6ac |
671a3f0
to
15a4de3
Compare
419af5f
to
c0247f7
Compare
Upstream branch: c5d2bac |
15a4de3
to
aef5502
Compare
c0247f7
to
ce9b303
Compare
Upstream branch: c5d2bac |
aef5502
to
a23160f
Compare
ce9b303
to
ce2660e
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]>
a23160f
to
0769dbf
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