Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1138488ybz; Fri, 1 May 2020 15:28:59 -0700 (PDT) X-Google-Smtp-Source: APiQypKIn24TCxKL1puw4xo+NKd5BlDnuIDEfgEc0XjvZwo1xpGQyiV13NjuJd53CVg3181eX1FH X-Received: by 2002:aa7:cc92:: with SMTP id p18mr5472305edt.166.1588372138907; Fri, 01 May 2020 15:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588372138; cv=none; d=google.com; s=arc-20160816; b=fK+3FGbsjVE1tPX2vA+fne+GJlv2K2CtMJbchB8OguPmQlR0gxKLdY0civaatTBWhB 3JFeP3ki5/5jcvFGyBg4G0snMrwv2rKj2tdPya8EsFL1nHTJ6NU3MP9owbd6W7rGvJIR p0ySwSbh9oXPLRv9M6fHoZ2azi7gCdMXDNfBYL65DSPxazT+svFISKqYj5ARtvsn9NTE xw4qjvWoQBfAdQZ/W6fwxoZH7idXEJ3/Kk58k+wgp2AP2D1rSASu9sW6P7/q0lSLt23I 7J/3IGXJPlMMhsO6InGkEEoLkLRIjREma8vS/qEdLaLYuOZnTKrz1eSKKJFuCuOCMsuV Z8wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=Z2c7wjs/AawL/B4tB/+Dq6jvUjNIqr24W83CLUMZuf4=; b=diWjzIn9L1/Y8E9h+7y7u4yWrcvmibfw3Ewc6SLGZH156xzoxY6cS+25wkInIye3BM sYpyaLJBfWAcj2VqC8I6G08IrAvBvaNQR0y2csyx34Y6aCazc0BMvuOsmuqB/uBGysbw OGIqwyQhBd7NAA9JYPXzKm9Vhn6K6GizTlKwUugUlK+szWZ4q5XgA68ZWV8LxyPxNWqm 29aENWl+FD6uWkixu7h4KX6RKQAW0S2lxLeGCREnCx2fLE6EhuKLGnhdQFxVStdbANCk EV8kCtc6tDtzBDd/dLHbPOsHPV9jXc8BC1CVd7wRF8xAt3GRWYe2+EwptZifFdSav/6N uNFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si2429026eja.420.2020.05.01.15.28.35; Fri, 01 May 2020 15:28:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbgEAWZO (ORCPT + 99 others); Fri, 1 May 2020 18:25:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbgEAWZO (ORCPT ); Fri, 1 May 2020 18:25:14 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ED8DC061A0C; Fri, 1 May 2020 15:25:14 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 2D7D214F4664B; Fri, 1 May 2020 15:25:13 -0700 (PDT) Date: Fri, 01 May 2020 15:25:12 -0700 (PDT) Message-Id: <20200501.152512.965649225646550457.davem@davemloft.net> To: natechancellor@gmail.com Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, samitolvanen@google.com Subject: Re: [PATCH v2] hv_netvsc: Fix netvsc_start_xmit's return type From: David Miller In-Reply-To: <20200428175455.2109973-1-natechancellor@gmail.com> References: <20200428100828.aslw3pn5nhwtlsnt@liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net> <20200428175455.2109973-1-natechancellor@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 01 May 2020 15:25:13 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor Date: Tue, 28 Apr 2020 10:54:56 -0700 > netvsc_start_xmit is used as a callback function for the ndo_start_xmit > function pointer. ndo_start_xmit's return type is netdev_tx_t but > netvsc_start_xmit's return type is int. > > This causes a failure with Control Flow Integrity (CFI), which requires > function pointer prototypes and callback function definitions to match > exactly. When CFI is in enforcing, the kernel panics. When booting a > CFI kernel with WSL 2, the VM is immediately terminated because of this. > > The splat when CONFIG_CFI_PERMISSIVE is used: ... > Avoid this by using the right return type for netvsc_start_xmit. > > Fixes: fceaf24a943d8 ("Staging: hv: add the Hyper-V virtual network driver") > Link: https://github.com/ClangBuiltLinux/linux/issues/1009 > Signed-off-by: Nathan Chancellor Applied.