From patchwork Wed Jun 12 09:19:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 804391 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0223416D9B8; Wed, 12 Jun 2024 09:19:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718183967; cv=none; b=s4+ZC3bjHaMzWEYLeSB4G65J0v6NjdPD5ClhN7K8LX91MHCzVbJqOQ6H98v8xAphne4Qi0evyS6JWk2GH3Qgh+a5F7trld8UKOoR75U4z1oN02QXWvULG4dXq7IhisclLeK5lXZAAbfpw82liRqqfsk3ck3/9K9g+AuyulVGxyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718183967; c=relaxed/simple; bh=ywnb+DhiBaWLlcskKAsMq45MMHp/bpKNsS6PRDDRLkQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PbILhqzkAAwKtVDHI9kYB/3OWHkr6xLI7nY1UeeTNSLc525nMmILGbqW9C7CLIC9EMufv09/3ZZNnf1qUccwrk+nTPGD0Xg8OPaovd3oVNDYwzGjtTC3yOhBG4K3xdNWk7wXKP+1NWdrAgYfaRwT2Ok7FuHd4pyqQT/OzgIajV8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EeKcN0Vk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EeKcN0Vk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8571BC3277B; Wed, 12 Jun 2024 09:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718183966; bh=ywnb+DhiBaWLlcskKAsMq45MMHp/bpKNsS6PRDDRLkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EeKcN0VktEkKOw3BeFTl8YbygzXOn/yBr1pAeqnPMxJCWLXgvYDF8pjZQeAzEElwA ODDFkqhv8gWsvzh8eZu10FqjszMdWmBUtMYoj8EuIHqDROApnhRB2qwO0tqdjFHSXm h/vI6+utghodFw85tV9vfY9gfz1r1jUQyu2s30aZdQIH5vA2hTUFh3LVdwencO+oPn EdgUFKlmI4OIHHxd2V5+qMV3YLBRIrRT6qGaUtfjH5SjvPPWgk1pv8Un8jvnIlSKyO +O4Iw9/tm6UWb+Iu6E4bsm4FC7TEXB/0sE9CeAJP/EWGSkpPR9z9CzMiCr8BPEs8CZ 2S2mlzawJgQ9w== From: Geliang Tang To: Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Boris Pismenny , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jakub Sitnicki Cc: Geliang Tang , bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next v7 1/2] tls: receive msg again for sk_redirect Date: Wed, 12 Jun 2024 17:19:03 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang tls_sw doesn't work for sk_redirect in nonblock mode, sk_msg_recvmsg() returns 0 in that case in tls_sw_recvmsg(). This patch fixes this by using "continue" to receive msg again instead of ending it if strp isn't ready and rx_list is empty. Signed-off-by: Geliang Tang --- net/tls/tls_sw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index 305a412785f5..ae8bbe7dc8ec 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -2017,6 +2017,9 @@ int tls_sw_recvmsg(struct sock *sk, len -= chunk; continue; } + if (!chunk && !tls_strp_msg_ready(ctx) && + skb_queue_empty_lockless(&ctx->rx_list)) + continue; } goto recv_end; }