tcp: Specify cmsgbuf is user pointer for receive zerocopy.
Subsystems (3)
PATCH v3 1/1 tcp: Specify cmsgbuf is user pointer for receive zerocopy.
From: Arjun Roy <[email protected]>
A prior change (1f466e1f15cf) introduces separate handling for ->msg_control depending on whether the pointer is a kernel or user pointer. However, while tcp receive zerocopy is using this field, it is not properly annotating that the buffer in this case is a user pointer. This can cause faults when the improper mechanism is used within put_cmsg().
This patch simply annotates tcp receive zerocopy's use as explicitly being a user pointer.
---
Changelog since v1:
- Updated "Fixes" tag and commit message to properly account for which commit introduced buggy behaviour.
net/ipv4/tcp.c | 1 + 1 file changed, 1 insertion(+)
Changelog since v2:
- Updated CC list. Added review-by annotation.
net/ipv4/tcp.c +1 -0
@@ -2039,6 +2039,7 @@ static void tcp_zc_finalize_rx_tstamp(struct sock *sk, (__kernel_size_t )zc->msg_controllen; cmsg_dummy.msg_flags =in_compat_syscall () ?MSG_CMSG_COMPAT :0 ; + cmsg_dummy.msg_control_is_user = true; zc->msg_flags =0 ;if (zc->msg_control == msg_control_addr && zc->msg_controllen == cmsg_dummy.msg_controllen) {
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
This patch was applied to netdev/net.git (refs/heads/master):
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
Quoted 10 lines · On Thu, 6 May 2021 15:35:30 -0700 you wrote:
From: Arjun Roy <[email protected]>
A prior change (
1f466e1f15cf) introduces separate handling for ->msg_control depending on whether the pointer is a kernel or user pointer. However, while tcp receive zerocopy is using this field, it is not properly annotating that the buffer in this case is a user pointer. This can cause faults when the improper mechanism is used withinput_cmsg().[...]
Here is the summary with links:
- [net,v3] tcp: Specify cmsgbuf is user pointer for receive zerocopy.
https://git.kernel.org/netdev/net/c/a6f8ee58a8e3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html