On 15/02/2023 14:35, Amit Daniel Kachhap wrote:
Additionally, a special situation in cmsghdr_from_user_compat_to_kern() is addressed. There the input
Looks like even tcp_zc_finalize_rx_tstamp() is like above cmsghdr_from_user_compat_to_kern(Hides user pointer and then creates kernel pointer from it).
This isn't really the same situation. In the zerocopy function, cmsg_dummy only ever holds a user pointer, and it was mistakenly being stored in msg_control instead of msg_control_user. cmsghdr_from_user_compat_to_kern() is special because on entry, msg_control_user is active (a user pointer is stored), while on exit msg_control is active (a kernel pointer is stored).
There is a separate issue with struct tcp_zerocopy_receive::msg_control being represented as unsigned long even though it always represents a user pointer, that's addressed in the next patch (and it is not something we're trying to upstream at this point).
struct msghdr holds a user pointer (msg_control_user), but a kernel pointer is stored in msg_control when returning. msg_control_is_user is now updated accordingly.
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com
This patch looks like a nice clean up candidate for mainline.
I think so too, that's the intention behind the way it's written :)
Kevin