Skip to content

Commit 8bb7c4f

Browse files
nhukckuba-moo
authored andcommitted
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. Reported-by: Dan Carpenter <[email protected]> Link: ClangBuiltLinux/linux#1703 Cc: [email protected] Signed-off-by: Nathan Huckleberry <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Acked-by: Eelco Chaudron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 73c99e2 commit 8bb7c4f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/openvswitch/vport-internal_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static void internal_dev_destroy(struct vport *vport)
190190
rtnl_unlock();
191191
}
192192

193-
static netdev_tx_t internal_dev_recv(struct sk_buff *skb)
193+
static int internal_dev_recv(struct sk_buff *skb)
194194
{
195195
struct net_device *netdev = skb->dev;
196196

net/openvswitch/vport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct vport_ops {
132132
int (*set_options)(struct vport *, struct nlattr *);
133133
int (*get_options)(const struct vport *, struct sk_buff *);
134134

135-
netdev_tx_t (*send) (struct sk_buff *skb);
135+
int (*send)(struct sk_buff *skb);
136136
struct module *owner;
137137
struct list_head list;
138138
};

0 commit comments

Comments
 (0)