net: devmem: return EMSGSIZE on type mismatch
Subsystems (2)
PATCH v2 1/1 net: devmem: return EMSGSIZE on type mismatch
When a devmem payload mixes with a standard page payload, return -EMSGSIZE instead of -EFAULT. This enables tcp_sendmsg to seamlessly fall back to creating a new segment instead of failing the socket send.
---
v2: Sent to net-next instead of net (Jakub). Otherwise no changes.
v1: https://lore.kernel.org/r/[email protected]
--- net/core/datagram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/datagram.c +2 -2
@@ -638,7 +638,7 @@ int zerocopy_fill_skb_from_iter(struct sk_buff *skb,int frag =skb_shinfo (skb)->nr_frags;if (!skb_frags_readable (skb)) -return -EFAULT ; +return -EMSGSIZE ;while (length &&iov_iter_count (from)) {struct page *head, *last_head =NULL ;
@@ -713,7 +713,7 @@ zerocopy_fill_skb_from_devmem(struct sk_buff *skb, struct iov_iter *from,struct net_iov *niov;if (i &&skb_frags_readable (skb)) -return -EFAULT ; +return -EMSGSIZE ;/* Devmem filling works by taking an IOVEC from the user where the * iov_addrs are interpreted as an offset in bytes into the dma-buf to
base-commit: 001b5d347d8ba39b2dccaefcc57967b18caec8fe
Signature · 1 line
2.55.0.679.g6767b8d81c-goog
Quoted 11 lines · Mina Almasry
When a devmem payload mixes with a standard page payload, return
-EMSGSIZEinstead of-EFAULT. This enablestcp_sendmsgto seamlessly fall back to creating a new segment instead of failing the socket send.Fixes bd61848900bff ("net: devmem: Implement TX path")Cc Pavel Begunkov <[email protected]>Cc Stanislav Fomichev <[email protected]>Cc Bobby Eshleman <[email protected]>Signed-off-by Mina Almasry <[email protected]>Reviewed-by Pavel Begunkov <[email protected]>Reviewed-by Bobby Eshleman <[email protected]>
(matches my original suggestion on
https://lore.kernel.org/netdev/[email protected]/)
Jakub Kicinski
maintainerQuoted 5 lines · On Mon, 10 Aug 2026 20:11:48 +0000 Mina Almasry wrote:
When a devmem payload mixes with a standard page payload, return
-EMSGSIZEinstead of-EFAULT. This enablestcp_sendmsgto seamlessly fall back to creating a new segment instead of failing the socket send.Fixes bd61848900bff ("net: devmem: Implement TX path")
Please drop the Fixes tag and repost this _after_ the devmem fixes you're sending are in net-next.
Signature · 1 line
pw-bot: defer