openvswitch: Change the return type for vport_ops.send function hook to int
Subsystems (3)
PATCH 1/1 openvswitch: Change the return type for vport_ops.send function hook to int
All usages of the vport_ops struct have the .send field set to dev_queue_xmit or internal_dev_recv. Since most usages are set to dev_queue_xmit, the function hook should match the signature of dev_queue_xmit.
The only call to vport_ops->send() is in net/openvswitch/vport.c and it throws away the return value.
This mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition.
--- net/openvswitch/vport-internal_dev.c | 2 +- net/openvswitch/vport.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/openvswitch/vport-internal_dev.c +1 -1
@@ -190,7 +190,7 @@ static void internal_dev_destroy(struct vport *vport)rtnl_unlock (); } -static netdev_tx_t internal_dev_recv (struct sk_buff *skb) +static int internal_dev_recv (struct sk_buff *skb) {struct net_device *netdev = skb->dev;
net/openvswitch/vport.h +1 -1
@@ -132,7 +132,7 @@ struct vport_ops {int (*set_options)(struct vport *,struct nlattr *);int (*get_options)(const struct vport *,struct sk_buff *); -netdev_tx_t (*send) (struct sk_buff *skb); +int (*send)(struct sk_buff *skb);struct module *owner;struct list_head list; };
Signature · 1 line
2.37.2.789.g6183377224-goog
Quoted 8 lines · Nathan Huckleberry
All usages of the
vport_opsstruct have the .send field set todev_queue_xmitorinternal_dev_recv. Since most usages are set todev_queue_xmit, the function hook should match the signature ofdev_queue_xmit.The only call to
vport_ops->send()is innet/openvswitch/vport.cand it throws away the return value.
Quoted 7 lines
This mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition.
Quoted 34 lines
--- net/openvswitch/vport-internal_dev.c | 2 +- net/openvswitch/vport.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)net/openvswitch/vport-internal_dev.c +1
-1@@ -190,7 +190,7 @@ static void internal_dev_destroy(struct vport *vport)rtnl_unlock (); } -static netdev_tx_t internal_dev_recv (struct sk_buff *skb) +static int internal_dev_recv (struct sk_buff *skb) {struct net_device *netdev = skb->dev;net/openvswitch/vport.h +1
-1@@ -132,7 +132,7 @@ struct vport_ops {int (*set_options)(struct vport *,struct nlattr *);int (*get_options)(const struct vport *,struct sk_buff *); -netdev_tx_t (*send) (struct sk_buff *skb); +int (*send)(struct sk_buff *skb);struct module *owner;struct list_head list; };Signature · 1 line
2.37.2.789.g6183377224-goog
Quoted 8 lines · Nathan Huckleberry
All usages of the
vport_opsstruct have the .send field set todev_queue_xmitorinternal_dev_recv. Since most usages are set todev_queue_xmit, the function hook should match the signature ofdev_queue_xmit.The only call to
vport_ops->send()is innet/openvswitch/vport.cand it throws away the return value.
Quoted 7 lines
This mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition.
The changes look good to me.
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Tue, 13 Sep 2022 16:07:38 -0700 you wrote:
All usages of the
vport_opsstruct have the .send field set todev_queue_xmitorinternal_dev_recv. Since most usages are set todev_queue_xmit, the function hook should match the signature ofdev_queue_xmit.The only call to
vport_ops->send()is innet/openvswitch/vport.cand it throws away the return value.[...]
Here is the summary with links:
- openvswitch: Change the return type for vport_ops.send function hook to int
https://git.kernel.org/netdev/net-next/c/8bb7c4f8c927
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html