From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.15 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796127692; b=gFnBLnur2mEzZzS5SuIuJtzTEWGJOfmzXbCjjkyvYL5uLq9YYjyxdXvnoQK+kzGRrqk8 XpWC2pOdC2EwaQHfSaAMC1/QAxSaR9Pid14CFsewTBsUDcgct02d+BAo6bPXgi5hOZeWt VK1HK+W0bNSvvPsYq7KDg0MoXgZxsUc+/xUhmAEKNyo0vSMYjHMns+CPEzIiCGWyqnceD 0bbOMKjcRnc7OVmoeiVJM1VMBtOwUKXuS1BirOEXHu9fjfDf9Qk9yFSGKn+cy83orXZjN gAGPcRjh62hvqrb2GNkbjrm8NLYbxIWI4t0+NtltxzR42iQKyzVSbliIR1RhlRhEGaA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796127692; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=UKTgFFbN44XaoA07Si3qJi1RhKieeuk/ExbXepR5sRM=; b=tN5Ab16BipNLb5Ouk7Mu5XyIhjo2MhfEgw7+sNEJ9+2LDaaQtQyDtZJjGynfR2A9YIeT KtfWvpd5T9EakNiKOb3BoDFOHyQGgIZkvVuEp9LR/dNJ63OE5SKxEG31u+Ycbt6xZ9Jc9 pDj+TitvRUs/jzEqUP1+ASlLUCzuS/p4vJiYmAPZjjnlCn71nka4t+PVcOT/pCn6ZwRF8 3YReKntNbAYuou29OVcsHV3JFlGCxwK1umVQuN5EtGV7yBKq1z7AjnLbjWtY/T4xBZGOm qtRPI2Dl0h6krv8ZP18X82K9kTeXk14co4COSax7z5PNxutsGbgAP6D8A1mfqgLbGfw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ujets2LK; arc=none smtp.remote-ip=95.215.58.15 Received: from mta1.migadu.com (out-15.mta1.migadu.com [95.215.58.15]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0108B606A31A for ; Tue, 1 Dec 2026 12:21:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0108B606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ujets2LK X-Envelope-To: bpf@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=Yg6SgYg4hSBtRwt1pFKr3BMQMXEEsT33yyEJnuOG8iw=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796127688; v=1; x=1796732488; b=ujets2LKtCg9pTE5lovtC5B/fIXxBtrBMVndeYd+kyGQO+yYBvluYzgkG+b4FqQpJ79WmBd7 vQ9t5oXh3mnyzHTdb1a5fN48TkVn1j4DVUlzTUp13oCNd9RibW5h1mORe1uG974lCWLD+xMtWgY d2OjglpkeEPUPx9tcnq7ulbg= X-Envelope-To: bpf@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 3227f461207969f5; Tue, 01 Dec 2026 12:21:28 +0000 X-Mizu-Trace-ID: 3227f461207969f5 X-Migadu-Flow: FLOW_OUT From: Jiayuan Chen To: bpf@vger.kernel.org Cc: Jiayuan Chen , John Fastabend , Jakub Sitnicki , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Kuniyuki Iwashima , Willem de Bruijn , Neal Cardwell , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Ihor Solodrai , Shuah Khan , Sechang Lim , Mattia Meleleo , Michal Luczaj , Zijian Zhang , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH bpf v2 00/10] fix misc sockmap issues Date: Tue, 1 Dec 2026 20:18:48 +0800 Message-ID: <20261201122055.269577-1-jiayuan.chen@linux.dev> X-Mailer: git-send-email 2.43.0 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series fixes misc issues in sockmap. Most of them are old. Patches 1-2 fix copied_seq when a strparser is attached and SK_PASS data is left unread, with a selftest. It was reported by Vega and comes from my earlier fix, commit 36b62df5683c ("bpf: Fix wrong copied_seq calculation"). Patches 3, 4 and 7 are old issues I ran into while reading the code: 03 strparser is initialized again while the old one is still alive, after the parser link is removed and added back 04 an ingress redirect queues an empty sk_msg 07 sk_psock_backlog() takes the refcnt of the wrong psock The rest (patches 5, 6 and 8-11) are the old issues that came up in the review of Alexei's sockmap series [1]. They are not from that series, so they were left for a follow-up. Patch 05 returns -EBUSY to a second concurrent sender, and patch 06 rejects disconnect with -EOPNOTSUPP like TLS does. Both change what user space sees, see the commit messages for why. [1] https://lore.kernel.org/bpf/20261102072112.4160195-1-alexei.starovoitov@gmail.com/ Jiayuan Chen (10): bpf, sockmap: Fix copied_seq updates with strparser selftests/bpf: Add test for unread SK_PASS data with strparser bpf, sockmap: Fix empty sk_msg queued by ingress redirect bpf, sockmap: Fix concurrent senders on one psock bpf, sockmap: Fix reconnect with a psock by rejecting connect bpf, sockmap: Fix psock refcnt taken in sk_psock_backlog() bpf, sockmap: Fix socket lock taken on a child before accept() bpf, sockmap: Fix apply_bytes when a redirect sends only a part selftests/bpf: Fix errno expected by the wait send mem test of test_sockmap selftests/bpf: Add test for apply_bytes when a redirect sends a part include/linux/skmsg.h | 1 + net/core/skmsg.c | 30 ++++- net/core/sock_map.c | 27 +++- net/ipv4/tcp_bpf.c | 92 ++++++++++--- .../selftests/bpf/prog_tests/sockmap_basic.c | 126 ++++++++++++++++++ .../selftests/bpf/prog_tests/sockmap_strp.c | 109 +++++++++++++++ .../bpf/progs/test_sockmap_msg_apply.c | 46 +++++++ tools/testing/selftests/bpf/test_sockmap.c | 3 +- 8 files changed, 407 insertions(+), 27 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_msg_apply.c -- 2.43.0