]> Gentwo Git Trees - linux/.git/commit
net: devmem: expose tcp_recvmsg_locked errors
authorStanislav Fomichev <sdf@fomichev.me>
Wed, 10 Sep 2025 16:24:29 +0000 (09:24 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Sep 2025 01:59:57 +0000 (18:59 -0700)
commit18282100d7040614b553f1cad737cb689c04e2b9
treef964f4c28fd538b34715bbe7f2340f592fe6985f
parenta055d3b2ce29f22f9562a75933518ddd3eb38766
net: devmem: expose tcp_recvmsg_locked errors

tcp_recvmsg_dmabuf can export the following errors:
- EFAULT when linear copy fails
- ETOOSMALL when cmsg put fails
- ENODEV if one of the frags is readable
- ENOMEM on xarray failures

But they are all ignored and replaced by EFAULT in the caller
(tcp_recvmsg_locked). Expose real error to the userspace to
add more transparency on what specifically fails.

In non-devmem case (skb_copy_datagram_msg) doing `if (!copied)
copied=-EFAULT` is ok because skb_copy_datagram_msg can return only EFAULT.

Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250910162429.4127997-1-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp.c