Re: [PATCH net v2] tcp: reject devmem tx with fastopen and repair
From: Pavel Begunkov
Date: Sat Oct 24 2026 - 10:51:15 EST
On 10/21/26 18:15, Mina Almasry wrote:
On Wed, Oct 21, 2026 at 8:17 AM Pavel Begunkov <asml.silence@xxxxxxxxx> wrote:...>>> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 87ef6d5cbfeb..2792923f0748 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1169,14 +1169,18 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
zc = MSG_SPLICE_PAGES;
}
- if (!sockc_err && sockc.dmabuf_id && (zc != MSG_ZEROCOPY || !binding)) {
- err = -EINVAL;
+ if (sockc.dmabuf_id && (zc != MSG_ZEROCOPY || !binding)) {
I wonder why it does sockc_err checks like that for devmem, e.g. instead of
failing earlier. Maybe Mina remembers?
IIRC, Paolo caught an issue where we were subtely changing behavior.
Like if someone passes in a bad sockc flags, it's usually ignored, but
if we process the sockc_err before we need it for devmem we change
behavior for existing users that were passing bad sockc but not using
devmem.
Got the idea, thanks. Sounds like this chunk can potentially change
it in the same way, though I'd need to look up that thread with
Paolo to be sure.
--
Pavel Begunkov