Skip to content

Commit a6f8ee5

Browse files
arjunroykuba-moo
authored andcommitted
tcp: Specify cmsgbuf is user pointer for receive zerocopy.
A prior change (1f466e1) 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. Fixes: 7eeba17 ("tcp: Add receive timestamp support for receive zerocopy.") Signed-off-by: Arjun Roy <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent cbaf3f6 commit a6f8ee5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/tcp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,6 +2039,7 @@ static void tcp_zc_finalize_rx_tstamp(struct sock *sk,
20392039
(__kernel_size_t)zc->msg_controllen;
20402040
cmsg_dummy.msg_flags = in_compat_syscall()
20412041
? MSG_CMSG_COMPAT : 0;
2042+
cmsg_dummy.msg_control_is_user = true;
20422043
zc->msg_flags = 0;
20432044
if (zc->msg_control == msg_control_addr &&
20442045
zc->msg_controllen == cmsg_dummy.msg_controllen) {

0 commit comments

Comments
 (0)