Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7254484rwn; Tue, 13 Sep 2022 17:07:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR7bNuDCaCMQ7OIrwKDz1LvpMROwWS2LttGEdYr5Rn05ycLIevidmlDX8RaVqTWN40NZIGdI X-Received: by 2002:a17:906:594f:b0:770:866c:b77c with SMTP id g15-20020a170906594f00b00770866cb77cmr23285054ejr.508.1663114068802; Tue, 13 Sep 2022 17:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663114068; cv=none; d=google.com; s=arc-20160816; b=Rx5a5iQBhsj6oGfGsAiUFe5p+btTkOr5elP4d8aRRDPl1CeEPkQN96cTaaK/wbwr94 g2zubiyQp50UauhRbVsXcznNjy/8zg8B+eNKhGBUcGBhHREzcdrzzsqlBV8uC0aYSeOa DMm3LU5KnERx0BstPBq0be8JMUJI3FcXO31jHkx8gLroeOf7Y51G9+2g+JlVoh0RG9n0 a59ZBQNYd8WTH9Zx8UaaErtgBFXTKCcaURGFXtuvLSOmwhg7/VAVNFtTV+yVK75b3w5Z BRQ/2+eOhEClduyV1la/HjbE2Xs8MQy4gZeYGmHNUaAlvcsTyThvOGhth+cv66Ifbyqa olNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nB+Oic7CImfFBsM2f1UWVONzr4wlqEQvzkYoVPmLGfs=; b=awBrsnGBSSr9TbQskvGEIIzJ0caBBEmNvT1lOfds0HxcjX3vXUh5gCva2OKCleV4Aa +O9Z0UTVfRkRc+uvVqWW0a/uLglaa81Cg02PpJeq8diSuq16KpZe4+zjAXjmjMPDkWrx +Fnqb1UxyYizM8koZQxnC6MIIEwwWNhRyp5ojr+yDycfOuXLL9wgVBo6AWPLPGQrFUhF De4mWqu5dU49HlJ2uBUbAnQ7TLPRpU0cYampPLzCnx/hkMLLhmhKQJHQHwNe9k7FJxaD G0PDXY906RkI6B5uZSq1+Weha7zuXI63J4gCK1we0Xgk2mzdF9IyBRiT6qj8Xgmka3eP suxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=En+foSMd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o9-20020a170906974900b0073d045866b3si2961120ejy.225.2022.09.13.17.07.20; Tue, 13 Sep 2022 17:07:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=En+foSMd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbiIMX0O (ORCPT + 99 others); Tue, 13 Sep 2022 19:26:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiIMX0M (ORCPT ); Tue, 13 Sep 2022 19:26:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4907171701; Tue, 13 Sep 2022 16:26:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F2D9BB8117D; Tue, 13 Sep 2022 23:26:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA731C433D6; Tue, 13 Sep 2022 23:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663111568; bh=MKctTCCNB0zUHFjYAFLnoWEYFaMOJC3oZ8vlBp9GnrQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=En+foSMdKI8Cm8iTxy3UXjB0XEFCrepqECzxWueLigjoRHXBzHkbaVNaKVMpRJTYF gYiLEZb4sVQLj0BkH3s9jiXTtX/QZjTVnZnABCaW8/4OubH+THJrxKF1Gd9WUnOCMS Y/sMQ8XW18aKmN52aVxdeoVh2igiNs0bZM5ixvYd5GCP/eUNbwVl2e/hsNTV+uOjYo u24C4q72ArBYHA+blb6JhpKCZvb8rDjdZxmCEQuRm6wUXn6JlbqA6pVswoxoC4mj1V 7JJS+nXBHr125rUu874rnRQHdVIh+lTZgyNx+17Z4kpDfohOrEol6lj34kfqG4kVDt 49X9IX4ziNShg== Date: Tue, 13 Sep 2022 16:26:06 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Pravin B Shelar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nick Desaulniers , Tom Rix , netdev@vger.kernel.org, dev@openvswitch.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] openvswitch: Change the return type for vport_ops.send function hook to int Message-ID: References: <20220913230739.228313-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220913230739.228313-1-nhuck@google.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 13, 2022 at 04:07:38PM -0700, Nathan Huckleberry wrote: > 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 > Link: https://github.com/ClangBuiltLinux/linux/issues/1703 > Cc: llvm@lists.linux.dev > Signed-off-by: Nathan Huckleberry Reviewed-by: Nathan Chancellor > --- > net/openvswitch/vport-internal_dev.c | 2 +- > net/openvswitch/vport.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c > index 35f42c9821c2..74c88a6baa43 100644 > --- a/net/openvswitch/vport-internal_dev.c > +++ b/net/openvswitch/vport-internal_dev.c > @@ -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; > > diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h > index 7d276f60c000..6ff45e8a0868 100644 > --- a/net/openvswitch/vport.h > +++ b/net/openvswitch/vport.h > @@ -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; > }; > -- > 2.37.2.789.g6183377224-goog >