From patchwork Sun Oct 13 16:26:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Luczaj X-Patchwork-Id: 13833358 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 A573D2F42; Sun, 13 Oct 2024 16:27:19 +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=1728836843; cv=none; b=gNh22/1OeZzYfPK/9XQTkf4aKasWXvDExPLG7KhGn9PU7gUWRY15IntmxHa7Yo+GvDBriTu7PT48dm6hAjvh0DDosYd9O2bVymIHWLcR9pWgukp6q4xDvH1PG3SyMX3QKwoytHpwKv6YVco+wFYP4GEVuEwEC9+cdzOaMK9D70o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728836843; 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=Xw3xLb2+H18toFb57KTmmU3oG8DgeH3Xxeyp9g8ABdLimqgp0lWXou6b+9AW+LqYAq+mGy55+uJUzNKV4nULgB4Rrh2yZaJBn7UY9493lXHFQmVmzYBWGJ7EW390f4GXurPuHpqBXQgX7K0KtpwoX6RLUVMghE74tGyN2CCwhgs= 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=JTuiPL34; 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="JTuiPL34" 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 1t01R0-00Cycu-CN; Sun, 13 Oct 2024 18:27:10 +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=JTuiPL34z2zWnLWD4vcIWJ9nlp sz8V25aXSC1omfOy4Glv1XkSH+XXuNoZwav8Mfqd+6fkuZG6xilSOsUekQcEnMftoXPszNDGh3HgN J5+nthL4MM7ZvN1S5HA4PMnBSf1x7jcXiHG9uz0fOST33dwaOlPDn+6G3Mb8SNry27aal+hVHjuxM 6wcKnHuU2BhxIb4KDr70wsXP0cJ9k6UNlRhMJwT6zo2UrjOu8HDGt2nEsO8wCl20FvONkyvLN6c3A y7vm14K2h2cyzVoWMix99IgQUYYZpr47G6RClICiVoefNf/usZL8kFYlAMAbz4bJfYdwIlbzj/X3v ccqJmR7Q==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1t01Qz-0007ii-PK; Sun, 13 Oct 2024 18:27:10 +0200 Received: by submission02.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1t01Qg-00GV5b-3f; Sun, 13 Oct 2024 18:26:50 +0200 From: Michal Luczaj Date: Sun, 13 Oct 2024 18:26:39 +0200 Subject: [PATCH bpf v2 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: <20241013-vsock-fixes-for-redir-v2-1-d6577bbfe742@rbox.co> References: <20241013-vsock-fixes-for-redir-v2-0-d6577bbfe742@rbox.co> In-Reply-To: <20241013-vsock-fixes-for-redir-v2-0-d6577bbfe742@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 Sun Oct 13 16:26:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Luczaj X-Patchwork-Id: 13833362 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 47F0214883B for ; Sun, 13 Oct 2024 16:27:25 +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=1728836846; cv=none; b=DfEVvF7UyHzD7eXLm1eUKPlJL0H+mQDyg/Jornp0L6tePIsL4x1Qf8LkvH/QzKJqW2iWzRa0gUchXpcnOM9IDY+GjXFsBPDXjTefXMPkJoM0A3DgPqeOCSIRzXgMGjSSZLcW3OT0JCBnpB1eUDWxwoYPJm55KQDk0Xrnx3a6SCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728836846; c=relaxed/simple; bh=c8urhhkrh3im84WiUJdBLGvYIXdINOiccvuzrfKAq5c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ao9uJVwR4Nm6R/yXUtjdp688GbVxkp1GdzweP3x34VMw2MPQ9O6tFBc0OTyFRdg7/4A+L2vpLQ7HUii11SSIRtg8VR0W/tWiHgGKQ3wYcPs7SCZ18bzHCwKg7qPPEk8SUeZoG8FX8jnSgIghza0HdcCnCpoy00MjOEWAqHRno6U= 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=QuMww5de; 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="QuMww5de" 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 1t01R0-00Cycr-2p; Sun, 13 Oct 2024 18:27:10 +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=su6GWJCFM6wUFDXNdQn8Littg9ARRWP/+CEhpq66KDM=; b=QuMww5deJ0EyJiNlfwMgJq3T6u mF+6/lzDaje+9VgpdTNVnIpsKzfKpSYMn/ern8btp7/HQCh2qgpZnsPuFgKygjP2TS3zaNl66CmBf pC3m64MGyu22wmfABfn51JWpHt4m5/bDpoHfq0qmaas0RSoLH5rzOCn3SnFGsJTBwljWpeWtpLh2i rULpkJ2Bi6+IkIJafRaQRKMxfkvUT3cMsf0eD7kVQcVKlz1tjxa8SSZq+ca0hFo/qKSxLQJhMs/Iz YTXLnVlXj8sOYp7HFtqC0mrJ1UwUT/j1+jMhmecSavZVisAMOkwLZJ2G1IcFGp/GW1bRbxtUO+1Ml uqmVTJDA==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1t01Qy-0007ie-S9; Sun, 13 Oct 2024 18:27:08 +0200 Received: by submission02.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1t01Qg-00GV5b-MY; Sun, 13 Oct 2024 18:26:50 +0200 From: Michal Luczaj Date: Sun, 13 Oct 2024 18:26:40 +0200 Subject: [PATCH bpf v2 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: <20241013-vsock-fixes-for-redir-v2-2-d6577bbfe742@rbox.co> References: <20241013-vsock-fixes-for-redir-v2-0-d6577bbfe742@rbox.co> In-Reply-To: <20241013-vsock-fixes-for-redir-v2-0-d6577bbfe742@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(). While here, also inform the peer that we've freed up space and it has more credit. 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") Suggested-by: Stefano Garzarella Signed-off-by: Michal Luczaj Reviewed-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index 884ee128851e5ce8b01c78fcb95a408986f62936..2e5ad96825cc0988c9e1b3f8a8bfcff2ef00a2b2 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,16 @@ 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); + 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); - if (!skb) - return err; + virtio_transport_send_credit_update(vsk); return recv_actor(sk, skb); } From patchwork Sun Oct 13 16:26:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Luczaj X-Patchwork-Id: 13833359 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 D6BD5145B1F for ; Sun, 13 Oct 2024 16:27:22 +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=1728836844; cv=none; b=UulqbkDSc4yzpc6SYhfmiPPDcdY5uTftiM9aY/HEJDNtF/bh53KvJ6ZwLVevEwCUgBuYGnAin7SdfL3JyElr/RuX6SHOm/wH3V5Baac/8u03HZUcVl5ENnbxzSSS7w/oRfbLN+2v4nGJ+pGjJ0cVY8UVzmJhSt9iIO6hcZIJUGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728836844; c=relaxed/simple; bh=KhWoRD2H+BmWFgR1juH3zFWA2YBT95nUEwQS/ULNd4w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cGY3tHFmXTL5RrE44BP461kok3ZYWolgc0sNydUX86TB++7FEUIh2BJM7Q719X8QZIV2VPJS8YVHbvIGJuGo74vWQBGu9kCNKq0Do5JxZqZOk8H8FXfsJTe0NQvAtWe9HBadXcksHp6NwMJYMSbtGEgdNq3uX8mXpnsJSZ5Tymk= 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=oJXC59B8; 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="oJXC59B8" Received: from mailtransmit03.runbox ([10.9.9.163] 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 1t01R2-00CydA-Kw; Sun, 13 Oct 2024 18:27:12 +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=4ZHKODsTHKVTvolB7Hhh4+kBDfGSvykMXekv9gZvMxU=; b=oJXC59B87d0uZ/LSPGnVfqXu9z 8cEMtgRQkvAu9eT6Xwi8c5mWDj6usFWxz7tNNtFWC9O5IqlhCbtWnlSu4wO4Q5VeIfwes8PyxlTMu kH1PQdYzkO5MyeZeUP58awCjQqDE0q/9bh9EhcSsNscfFjWiRGBI8L9FUbFKr8DlMKlxBeFB0MZy8 yiIg56KbaBDW0lQpBORThDQjlJQtB3pmSKSbdOgMlCb52OLKTGkcplrSrbMVZMYRQ5LO1Yph2LV3A mmwx6EJHzuh2UN+SMncB/c4HjpRplc66MrNLJc1I3eZXWiEkADBwFqCUg4ZpdmC0mP9gku64Htp1G 65KR8K5Q==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1t01R2-0007HW-AV; Sun, 13 Oct 2024 18:27:12 +0200 Received: by submission02.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1t01Qh-00GV5b-9M; Sun, 13 Oct 2024 18:26:51 +0200 From: Michal Luczaj Date: Sun, 13 Oct 2024 18:26:41 +0200 Subject: [PATCH bpf v2 3/4] vsock: Update msg_count on read_skb() Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241013-vsock-fixes-for-redir-v2-3-d6577bbfe742@rbox.co> References: <20241013-vsock-fixes-for-redir-v2-0-d6577bbfe742@rbox.co> In-Reply-To: <20241013-vsock-fixes-for-redir-v2-0-d6577bbfe742@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") Reviewed-by: Stefano Garzarella Signed-off-by: Michal Luczaj --- 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 2e5ad96825cc0988c9e1b3f8a8bfcff2ef00a2b2..ccbd2bc0d2109aea4f19e79a0438f85893e1d89c 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 Sun Oct 13 16:26:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Luczaj X-Patchwork-Id: 13833360 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 19362145B0C for ; Sun, 13 Oct 2024 16:27:22 +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=1728836844; cv=none; b=lmjmwUi9XEqrD3+URtZZUTuqNQeOgPYKIuSGo685FasVsIYJPBG8GT9LuJr+Pnj07RAmIXTsbsTxuFjIoZEvUsF71R329a0W7boPfIJVPTCAGOoxpnNHRCDAv2yyzvD8VW+XKERaqggHK1yk/HEF2g+0U+S3epFlQIQ65hlOkMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728836844; c=relaxed/simple; bh=e3SrNTsK0dGD9xesl4OQqQipb7Tulhm6OyotiGyjymc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gop0ylNckG8NPTibkw+JKzIWdoed06No7X/mp4moisB0cbLdnz2s4uiRUKp0nay584gIBfZ/TCAl/oFr6ZWF9BRZQC24bAc3dJt5rsrz5dGdmv3zWoXuDsMUz8KPYWJ89p4OnjjoAtIrEx5Q8TKYlwnH+efJjJeJWA+4ZZlCHPU= 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=yhHE+Jqm; 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="yhHE+Jqm" 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 1t01R6-00CydY-QE; Sun, 13 Oct 2024 18:27:16 +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=yhHE+JqmMpgEhQ3KhAvJUPSfr6 2dc6qE/7Y6UX7ylRucZ1qHklE3xOJ6oqBYbL5LmB3tl2WHaQ6VLBCVq6FnzLdggz9gcon/eYsTjp2 y8o2xcnE5ulzQgGEGmVm5P5yck/06B5JXJg1+Sb/phghMZtXVCwfae+XJjEaPnRXlrngR3mupRZNF nwyCfy9obsTCKP2jS0Oy0xWD2aJNn8ACCNfksbUPeqgvVX3QIk0EUb8h6dVzvJog2q5rTxnFnEHoa C5cO8pR8vizF1D3waghnnSd22Hd7335AOI/g/yNniF/gMHCu7o7/aqTTb1+MsfEP8WnFZSdybHrWM wv3b8F8g==; Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1t01R1-0007iv-AC; Sun, 13 Oct 2024 18:27:11 +0200 Received: by submission02.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1t01Qh-00GV5b-Sn; Sun, 13 Oct 2024 18:26:51 +0200 From: Michal Luczaj Date: Sun, 13 Oct 2024 18:26:42 +0200 Subject: [PATCH bpf v2 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: <20241013-vsock-fixes-for-redir-v2-4-d6577bbfe742@rbox.co> References: <20241013-vsock-fixes-for-redir-v2-0-d6577bbfe742@rbox.co> In-Reply-To: <20241013-vsock-fixes-for-redir-v2-0-d6577bbfe742@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;