Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4046266rwb; Sun, 9 Oct 2022 16:45:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5h0e43+FVN9VMk/KW1V2vmrr2kxIPkyx+2MuZxDauJq53MKIrboSbt/kQ7BrAmZ03tE0z7 X-Received: by 2002:a17:902:e5c9:b0:178:41d1:ef3d with SMTP id u9-20020a170902e5c900b0017841d1ef3dmr16018590plf.151.1665359125872; Sun, 09 Oct 2022 16:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665359125; cv=none; d=google.com; s=arc-20160816; b=H4hXu7pa2bI3CQtojdqDCG5juvX5gdlrKVtURdYcOSIzNCec/RWuiixDjMwWbzkR01 S5untnEbLrodqUEY7oPFShvCrEYeu2tHdXoFK7qD4Z7h4BHNPhqxV510TvIui1COW3AI mzdT0JX3yTLzfLOQepX6IwWqP3nPLzUYPPvKVw4RxwmdqS5buBoOz/Qy8iCcITUcxNTV GtBCLrpEj8PVXlQD7h6ev32Tp3vSms+DfGmbgp24mKbhLqtPx6krvtO598UCr9V0MMaU 3YXRnpPBo+kiHwFghoFHod7nKdhjbirPUP9BvuvSZdCh/VPJ7kKVCg64KdMS0tvfSzF0 29hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KwczdPzbX3k2nkf4uiwrHEhAM5qIgaMK4CbkWaT49mk=; b=VHu0aL5yvlZeI6GANQYv3d3IQ2/w/0Ddf7CXSUpgOmWzhwgi28DvouEM8usMSQgKB8 j1nl4AOebwq+S4rvVyx9JDH9ANAhazHsWQxerBWdh6VZqbSdA2i1gFpj4aWpkm61AN8r YEy2pCb3/Xg0Ntny7h0gIBjILl1NoDhJNxkPrP4cth6s4zqNwyngi8EA0QLbOOFihwu4 Gag6rVNZMNvJaXUJl30zP8BN8vSTnWQUKRhapMdKPYZdHPukCA9TFEfrNDMtCGGNUAmU 8LYwVsscSxkCwSn+SwGO0AHgY+czuk8R4niorI0vYavDl4rnXFzUHOAq0bhE4vxdiIEd tbqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oj1qPalC; 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 u17-20020a634711000000b0042ad0333df1si9866917pga.479.2022.10.09.16.45.14; Sun, 09 Oct 2022 16:45:25 -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=oj1qPalC; 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 S231531AbiJIWSW (ORCPT + 99 others); Sun, 9 Oct 2022 18:18:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231395AbiJIWR7 (ORCPT ); Sun, 9 Oct 2022 18:17:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25F582DAAF; Sun, 9 Oct 2022 15:15:34 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 93F8460CBB; Sun, 9 Oct 2022 22:12:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FEA2C433D6; Sun, 9 Oct 2022 22:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665353521; bh=ogt3V7+LBk8Gdt6iLASjve7CAKDWMDuO9ZpCqoRCGro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oj1qPalC9Pl5Nsn4dklEPFqTYHRbUFIgq1YZ99Hr921zq5xImRJfuzWeJcpAjcEmw M+XLQst9j8/NpXRnPOSDBeb5aNAyYvnykMD9+qdQvUYFbd0pSRz8cDcX0X4djy7+c3 k46nFxrfE27UmYIovoImo72JPl3ogugYQ1oTBesl2BRaIiAFhbYLHcRW5eLFMlZOEi 16q/XZousI4fvpTy7Fd/g6bqPTexMNufMn2nVMmYFS8/QuLrqrvST3y2YaJQgk+htf yISRCNihP+UrcDhzAdzYRy0irMA+A0mHIJ8r4Qt/B5B37YSx6d2HpfqRNglDem46rR L3xkzGL2TeNzg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Huckleberry , Dan Carpenter , llvm@lists.linux.dev, Nathan Chancellor , Jakub Kicinski , Sasha Levin , davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, ndesaulniers@google.com, leon@kernel.org, mw@semihalf.com, shayagr@amazon.com, wsa+renesas@sang-engineering.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 49/77] net: korina: Fix return type of korina_send_packet Date: Sun, 9 Oct 2022 18:07:26 -0400 Message-Id: <20221009220754.1214186-49-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009220754.1214186-1-sashal@kernel.org> References: <20221009220754.1214186-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit 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 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 From: Nathan Huckleberry [ Upstream commit 106c67ce46f3c82dd276e983668a91d6ed631173 ] The ndo_start_xmit field in net_device_ops is expected to be of type netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. The return type of korina_send_packet should be changed from int to netdev_tx_t. 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 Link: https://lore.kernel.org/r/20220912214344.928925-1-nhuck@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/korina.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c index df9a8eefa007..eec6a9ec528b 100644 --- a/drivers/net/ethernet/korina.c +++ b/drivers/net/ethernet/korina.c @@ -416,7 +416,8 @@ static void korina_abort_rx(struct net_device *dev) } /* transmit packet */ -static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) +static netdev_tx_t korina_send_packet(struct sk_buff *skb, + struct net_device *dev) { struct korina_private *lp = netdev_priv(dev); u32 chain_prev, chain_next; -- 2.35.1