From patchwork Wed Oct 9 21:20:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Luczaj X-Patchwork-Id: 13829317 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [185.226.149.38]) (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 2B10017BB0C; Wed, 9 Oct 2024 22:08:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728511696; cv=none; b=VQ1UBH0ecUhrQPxgQgsxcYmpOPCwd4/etPjj2OPfNS+8wHUcMHqPl2lkE5LbYRcOLU4DTdQ+orRI3+wv0bVzt7yKFm1YZHpcjEsseBTGjM8sx70KSmOQBEv8ZkR/RZvTj++UF3ST74Y9/PFt8FsqqUKxWEfz9Ko/+ukjMiBl3as= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728511696; c=relaxed/simple; bh=ATz0ke/Gyqfq12BWInrt1+S0gvlwRss8NN0cvFIE+XI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GrbMN+0d1zdviwzo4kI0rbhmXArKs8q6/rj+s/DTGXJt1OJL9wkVoXVG9d9Xv9/YXCsm+P4DbB24nVyFDxlqCxJczK0xz8aZHYe+NWA6rXQoNGGDWMG91SDmqZxG2OL4qL06Pmsr30CIl9ca6sBwRsGYmU2hxz5oJYyVhHfcc7g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co; spf=pass smtp.mailfrom=rbox.co; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b=DeJCF/z3; arc=none smtp.client-ip=185.226.149.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rbox.co Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b="DeJCF/z3" Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1sye8a-001i4v-Ve; Wed, 09 Oct 2024 23:22:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rbox.co; s=selector1; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From; bh=L1Tce96RUTs2pMiFj61EXXUMJFuuEoy26u+9hdzmS0A=; b=DeJCF/z3xEPseATxpW3MpZ6w/+ B30z4dEt9p06OApaznhC+h4H1KDUbyYTCAimYW85u/bWbCV4bvTc1OBN2lOp0TbSy7B6RCfcbU0Ai e2bltKkPDws295rjOzrpTSsJ0QvgY28PJ/V5M0ASs5x+TKw6M3lYfVXFjldhaZnszrHTPjogse0Cp WNUcMOJk20LTuDI8ggmKpgnJgKDmrjV6OxxN4uiefOGgNpwKjSy3D4C8XqanaVb45CvZ2SXrpVPEp 92AqHn11r2WpU7KSY52dSrjG7q0DfGItgiOa4PdTETLCDzhBOhh4Z/PVI8tnCow6pzDgFPdpueu53 G4HcZweg==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1sye8a-0000IK-0r; Wed, 09 Oct 2024 23:22:28 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1sye8Q-00EL6w-OY; Wed, 09 Oct 2024 23:22:18 +0200 From: Michal Luczaj Date: Wed, 09 Oct 2024 23:20:50 +0200 Subject: [PATCH bpf 1/4] bpf, sockmap: SK_DROP on attempted redirects of unsupported af_vsock Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241009-vsock-fixes-for-redir-v1-1-e455416f6d78@rbox.co> References: <20241009-vsock-fixes-for-redir-v1-0-e455416f6d78@rbox.co> In-Reply-To: <20241009-vsock-fixes-for-redir-v1-0-e455416f6d78@rbox.co> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Fastabend , Jakub Sitnicki , "Michael S. Tsirkin" , Stefano Garzarella , Bobby Eshleman , Stefan Hajnoczi Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Michal Luczaj X-Mailer: b4 0.14.2 X-Patchwork-Delegate: bpf@iogearbox.net Don't mislead the callers of bpf_{sk,msg}_redirect_{map,hash}(): make sure to immediately and visibly fail the forwarding of unsupported af_vsock packets. Fixes: 634f1a7110b4 ("vsock: support sockmap") Signed-off-by: Michal Luczaj --- include/net/sock.h | 5 +++++ net/core/sock_map.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/include/net/sock.h b/include/net/sock.h index c58ca8dd561b7312ffc0836585c04d9fe917a124..c87295f3476db23934d4fcbeabc7851c61ad2bc4 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2715,6 +2715,11 @@ static inline bool sk_is_stream_unix(const struct sock *sk) return sk->sk_family == AF_UNIX && sk->sk_type == SOCK_STREAM; } +static inline bool sk_is_vsock(const struct sock *sk) +{ + return sk->sk_family == AF_VSOCK; +} + /** * sk_eat_skb - Release a skb if it is no longer needed * @sk: socket to eat this skb from diff --git a/net/core/sock_map.c b/net/core/sock_map.c index 242c91a6e3d3870ec6da6fa095d180a933d1d3d4..07d6aa4e39ef606aab33bd0d95711ecf156596b9 100644 --- a/net/core/sock_map.c +++ b/net/core/sock_map.c @@ -647,6 +647,8 @@ BPF_CALL_4(bpf_sk_redirect_map, struct sk_buff *, skb, sk = __sock_map_lookup_elem(map, key); if (unlikely(!sk || !sock_map_redirect_allowed(sk))) return SK_DROP; + if ((flags & BPF_F_INGRESS) && sk_is_vsock(sk)) + return SK_DROP; skb_bpf_set_redir(skb, sk, flags & BPF_F_INGRESS); return SK_PASS; @@ -675,6 +677,8 @@ BPF_CALL_4(bpf_msg_redirect_map, struct sk_msg *, msg, return SK_DROP; if (!(flags & BPF_F_INGRESS) && !sk_is_tcp(sk)) return SK_DROP; + if (sk_is_vsock(sk)) + return SK_DROP; msg->flags = flags; msg->sk_redir = sk; @@ -1249,6 +1253,8 @@ BPF_CALL_4(bpf_sk_redirect_hash, struct sk_buff *, skb, sk = __sock_hash_lookup_elem(map, key); if (unlikely(!sk || !sock_map_redirect_allowed(sk))) return SK_DROP; + if ((flags & BPF_F_INGRESS) && sk_is_vsock(sk)) + return SK_DROP; skb_bpf_set_redir(skb, sk, flags & BPF_F_INGRESS); return SK_PASS; @@ -1277,6 +1283,8 @@ BPF_CALL_4(bpf_msg_redirect_hash, struct sk_msg *, msg, return SK_DROP; if (!(flags & BPF_F_INGRESS) && !sk_is_tcp(sk)) return SK_DROP; + if (sk_is_vsock(sk)) + return SK_DROP; msg->flags = flags; msg->sk_redir = sk; From patchwork Wed Oct 9 21:20:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Luczaj X-Patchwork-Id: 13829278 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [185.226.149.37]) (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 77F601E3DDA; Wed, 9 Oct 2024 21:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.37 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728510261; cv=none; b=RE+027Sgaf/A3Czv+PCihZqM6IuMDKUMnOq4hGQJRGh1jN/5Pb4sn/DPUyQ9Dfb7460IXiDsK691BQ5LvWv9Ru5/UcCAwMhQBPB6vqE38eFmuN5rUaHUoanReixBIiK8I2XaxrJCyGp3p5rU9RSAquL7ziEeronhPpSTGP3BggI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728510261; c=relaxed/simple; bh=PosfPGgyDIM+i5UuEi8vug2xXbEiZxXUq1xAS9I9CUs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SocFDfZIYDmXBn/wgnKhyd14tyzXjKwFtKtzK7f8idjJ/mlxX9GN4r3OzgL3EsECgWF0odAryszWXPRdmOjiF9cmeptEvuoHUwvAGMNE4X5XSOJUFX85KZhDIGkt9NOZP7Lqs4XkMVYC/kFjjoXaBLkppUDAplAP/EaPqwgERGU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co; spf=pass smtp.mailfrom=rbox.co; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b=zyi2nk+k; arc=none smtp.client-ip=185.226.149.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rbox.co Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b="zyi2nk+k" Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1sye8d-001jJ1-4K; Wed, 09 Oct 2024 23:22:31 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rbox.co; s=selector1; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From; bh=Ug7QjyOWCGYi1g6HlAzPC/m0ijYnR0+zFZeDtU2E86U=; b=zyi2nk+kbk6zLs3NO7Yws8Gpzk +5+K3DlCwkOvL+MctOXn48whR+dcJiWYKq+7Kv+omM0jlPxT5en4f+md5MSEWP7VShMnFfCkzBoaR PDcBT7bL6makSufFE5jAcYy0GrF7aBw3BDoiAC6NnHNfmHKAeLrDR/FeqBcAOvTO0YpsPxDAK6AAn CbLauFsAL/b2RX6SjGGpbzYliAYjcppOS7MsSXmNq4NfaAvGLh/mc53A5dZ1ecIELjaxU7mBf0H/Q DK+iU1ggQJJLAZL/zBIXqdNm7AeuBIvVYW/fmtDiOuV6qsjmWaJIJ5atZrKvODdVKw8nhYVlo0coK FYhJ9BnQ==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1sye8c-0000IQ-RH; Wed, 09 Oct 2024 23:22:30 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1sye8R-00EL6w-Ck; Wed, 09 Oct 2024 23:22:19 +0200 From: Michal Luczaj Date: Wed, 09 Oct 2024 23:20:51 +0200 Subject: [PATCH bpf 2/4] vsock: Update rx_bytes on read_skb() Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241009-vsock-fixes-for-redir-v1-2-e455416f6d78@rbox.co> References: <20241009-vsock-fixes-for-redir-v1-0-e455416f6d78@rbox.co> In-Reply-To: <20241009-vsock-fixes-for-redir-v1-0-e455416f6d78@rbox.co> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Fastabend , Jakub Sitnicki , "Michael S. Tsirkin" , Stefano Garzarella , Bobby Eshleman , Stefan Hajnoczi Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Michal Luczaj X-Mailer: b4 0.14.2 X-Patchwork-Delegate: bpf@iogearbox.net Make sure virtio_transport_inc_rx_pkt() and virtio_transport_dec_rx_pkt() calls are balanced (i.e. virtio_vsock_sock::rx_bytes doesn't lie) after vsock_transport::read_skb(). Failing to update rx_bytes after packet is dequeued leads to a warning on SOCK_STREAM recv(): [ 233.396654] rx_queue is empty, but rx_bytes is non-zero [ 233.396702] WARNING: CPU: 11 PID: 40601 at net/vmw_vsock/virtio_transport_common.c:589 Fixes: 634f1a7110b4 ("vsock: support sockmap") Signed-off-by: Michal Luczaj --- net/vmw_vsock/virtio_transport_common.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index 884ee128851e5ce8b01c78fcb95a408986f62936..ed1c1bed5700e5988a233cea146cf9fac95426e0 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -1707,6 +1707,7 @@ int virtio_transport_read_skb(struct vsock_sock *vsk, skb_read_actor_t recv_acto { struct virtio_vsock_sock *vvs = vsk->trans; struct sock *sk = sk_vsock(vsk); + struct virtio_vsock_hdr *hdr; struct sk_buff *skb; int off = 0; int err; @@ -1716,10 +1717,14 @@ int virtio_transport_read_skb(struct vsock_sock *vsk, skb_read_actor_t recv_acto * works for types other than dgrams. */ skb = __skb_recv_datagram(sk, &vvs->rx_queue, MSG_DONTWAIT, &off, &err); - spin_unlock_bh(&vvs->rx_lock); - - if (!skb) + if (!skb) { + spin_unlock_bh(&vvs->rx_lock); return err; + } + + hdr = virtio_vsock_hdr(skb); + virtio_transport_dec_rx_pkt(vvs, le32_to_cpu(hdr->len)); + spin_unlock_bh(&vvs->rx_lock); return recv_actor(sk, skb); } From patchwork Wed Oct 9 21:20:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Luczaj X-Patchwork-Id: 13829306 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [185.226.149.38]) (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 489EB1E132D for ; Wed, 9 Oct 2024 21:57:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728511041; cv=none; b=KT1QV8dYfX4jku0lMUiNdCYU4/zbUJzs2FCTW2LgBqwhgu2E/XXUs+jtbMWGJjOQ+eI1/qYsA8/LIGWcdU/rJS5RkZC2Q/6k/IGr2pCjY+fv+Oq+tysF32eQ/83zTrSEHujHGggidJb+yynnFljsXvCiLW9+Xm6GShSzeExBjPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728511041; c=relaxed/simple; bh=fV85lYMYy13smen59u9frogrj+vjYHYqk6ZdBC4xwkA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C3Qyfl96jhPX/jMKZLSFZKP4kgwog5OtyUTeh2dRWiO16xliGg2qVn9yWM44qsNmr5wmwXDBeuP/mKiCQARWPuuRpwiSaSQfegexC4gAS3USw3Aejyrx+9dvpx33lQzp/lE5owiIzX+/Wv+dbU6wICQUVUsWz44rWWmU+NTeHtg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co; spf=pass smtp.mailfrom=rbox.co; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b=uaGe1FLR; arc=none smtp.client-ip=185.226.149.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rbox.co Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b="uaGe1FLR" Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1sye8f-001i7C-La; Wed, 09 Oct 2024 23:22:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rbox.co; s=selector1; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From; bh=2Wj1YSIDs+wnKVPgrDjOMjQqZD7UYDf8qr64czFHjYA=; b=uaGe1FLRdC9s7yduJTCeq7DtZM zUTiN0PxbrIwot2draUqt9xzf13sUCamXX/YEVgV73mAc+QCUoVRB3NDNwTlZMNgALY3CZyuuXm2l syFt26Pdz22q/WJLILYiQcL6lPiK22Xc+nVyyDFlLJZv9Nj7SaTOKVhGOtLwT8djfEbZNHVtcLFnL hoTbfcawZQCsMRoTnQ2+gYcJgx24HpBZ8XXwNz/ndlS0KM8Bl/V/bjyfqZQ/bOVXA5CS/7HMhkkpC Mw7aI0hosRytELfZ5rlL5fzczDMWYGONq0aSqQQr6g528IQqKpsDpsGSx8/EPmJcI44j1XEZT4OaT bVyrFYKg==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1sye8f-0004hI-1D; Wed, 09 Oct 2024 23:22:33 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1sye8S-00EL6w-05; Wed, 09 Oct 2024 23:22:20 +0200 From: Michal Luczaj Date: Wed, 09 Oct 2024 23:20:52 +0200 Subject: [PATCH bpf 3/4] vsock: Update msg_count on read_skb() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241009-vsock-fixes-for-redir-v1-3-e455416f6d78@rbox.co> References: <20241009-vsock-fixes-for-redir-v1-0-e455416f6d78@rbox.co> In-Reply-To: <20241009-vsock-fixes-for-redir-v1-0-e455416f6d78@rbox.co> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Fastabend , Jakub Sitnicki , "Michael S. Tsirkin" , Stefano Garzarella , Bobby Eshleman , Stefan Hajnoczi Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Michal Luczaj X-Mailer: b4 0.14.2 X-Patchwork-Delegate: bpf@iogearbox.net Dequeuing via vsock_transport::read_skb() left msg_count outdated, which then confused SOCK_SEQPACKET recv(). Decrease the counter. Fixes: 634f1a7110b4 ("vsock: support sockmap") Signed-off-by: Michal Luczaj Reviewed-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index ed1c1bed5700e5988a233cea146cf9fac95426e0..1d591b69ede3244a4f49aa44dc1f939d827dafc0 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -1723,6 +1723,9 @@ int virtio_transport_read_skb(struct vsock_sock *vsk, skb_read_actor_t recv_acto } hdr = virtio_vsock_hdr(skb); + if (le32_to_cpu(hdr->flags) & VIRTIO_VSOCK_SEQ_EOM) + vvs->msg_count--; + virtio_transport_dec_rx_pkt(vvs, le32_to_cpu(hdr->len)); spin_unlock_bh(&vvs->rx_lock); From patchwork Wed Oct 9 21:20:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Luczaj X-Patchwork-Id: 13829282 X-Patchwork-Delegate: bpf@iogearbox.net Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [185.226.149.38]) (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 E132710E4; Wed, 9 Oct 2024 21:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728510410; cv=none; b=Io6k1mzD3MXZx3HQpu5V0Lg0NgB4Jjlm+LAJa0yQcE5MYJP16jcRDJGuBkVyFZJOLE5RlYLZn1vnVYH2rlXwh8wPwFDVvB+SAdVEHIQRs4oNE+uuGNQa2/Hils7CUKmUk/zTD0A+VmK1fjhHUlkaEwOzFuuHubdyd3lGyaVZwxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728510410; c=relaxed/simple; bh=e3SrNTsK0dGD9xesl4OQqQipb7Tulhm6OyotiGyjymc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AD+Ye5FaKEQwsWNstJMxHFeA9yrRR+XyIjvOyXcm02CyayRnASj2lksCocLpNdPyg5WuCqmUushjbWuOR46KfaW3cNGlacJEckpfWPYFrCX7n7Ogb2iNzQFkeDojVd+o7dZeNVv8myq7yDrttWV924pxcReS2I67lM6t+4PP8L4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co; spf=pass smtp.mailfrom=rbox.co; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b=lx3Sij3P; arc=none smtp.client-ip=185.226.149.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rbox.co Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b="lx3Sij3P" Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1sye8e-001i73-AQ; Wed, 09 Oct 2024 23:22:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rbox.co; s=selector1; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From; bh=F+RJd+JIpP4NiuqPuwFGdxJw5I73YccdWoYTGb3P+Vo=; b=lx3Sij3PRHC9LVPPD2VBO1LF6W YScFaPpOmYXnga6tKXoPUsc3aWpaaDeRYB2mMJgsEgXUL03orAgB5geetyqDbDQ2zc2EI+ePU5Rwd sbJrBtP/QwxBp7lbLF/8bfwytr5T68ZiEluzLwdSmblSo9vqA7eazq+G+uORbIzvrU0x6zYxfN5g+ ZsPLMf2rgA8Yc/E+CnMiyle2e3EY/esZ+Ia7yl7lWpmNumaA2BponFJwYGY5RDBV/8TCYe32npQ+E b5ri6i4Miu8EtmLqzHZYkU9tMtzZQYMLWXWcth/vcLlNqR4v78JDhG4zI54YKNRrkj4fxmUs/VVAW M+ebBXhw==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1sye8d-0004h3-PV; Wed, 09 Oct 2024 23:22:32 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1sye8S-00EL6w-Il; Wed, 09 Oct 2024 23:22:20 +0200 From: Michal Luczaj Date: Wed, 09 Oct 2024 23:20:53 +0200 Subject: [PATCH bpf 4/4] bpf, vsock: Drop static vsock_bpf_prot initialization Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241009-vsock-fixes-for-redir-v1-4-e455416f6d78@rbox.co> References: <20241009-vsock-fixes-for-redir-v1-0-e455416f6d78@rbox.co> In-Reply-To: <20241009-vsock-fixes-for-redir-v1-0-e455416f6d78@rbox.co> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Fastabend , Jakub Sitnicki , "Michael S. Tsirkin" , Stefano Garzarella , Bobby Eshleman , Stefan Hajnoczi Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, Michal Luczaj X-Mailer: b4 0.14.2 X-Patchwork-Delegate: bpf@iogearbox.net vsock_bpf_prot is set up at runtime. Remove the superfluous init. No functional change intended. Fixes: 634f1a7110b4 ("vsock: support sockmap") Signed-off-by: Michal Luczaj --- net/vmw_vsock/vsock_bpf.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/net/vmw_vsock/vsock_bpf.c b/net/vmw_vsock/vsock_bpf.c index c42c5cc18f324108e044772e957c8d42c92ead8c..4aa6e74ec2957b28b9e9d8ce0b5f4d5c289a9276 100644 --- a/net/vmw_vsock/vsock_bpf.c +++ b/net/vmw_vsock/vsock_bpf.c @@ -114,14 +114,6 @@ static int vsock_bpf_recvmsg(struct sock *sk, struct msghdr *msg, return copied; } -/* Copy of original proto with updated sock_map methods */ -static struct proto vsock_bpf_prot = { - .close = sock_map_close, - .recvmsg = vsock_bpf_recvmsg, - .sock_is_readable = sk_msg_is_readable, - .unhash = sock_map_unhash, -}; - static void vsock_bpf_rebuild_protos(struct proto *prot, const struct proto *base) { *prot = *base;