From patchwork Tue Oct 27 13:51:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C66BC55179 for ; Tue, 27 Oct 2020 14:17:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3127022284 for ; Tue, 27 Oct 2020 14:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808252; bh=2xe2IxVXNEOe5tbVNVRFe3UO2+ZWr7Ggj1Le36gQ/9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mPtcXtTTBlm5xUU3If7mhm0dzWkhgNWx0piyJT1RXQCe4kv1xjXSIkk/8HY8G9Lfo WyIvpRTnTp7ryqgCivwxDHmAEaMusB9fBbStX4qRfmtHX5Gh/V30boaxowlrKWDpBV hYImBadJGKc9fwLeUv73GtlyPm7nmMkvLFImDgUY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2900912AbgJ0OR2 (ORCPT ); Tue, 27 Oct 2020 10:17:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:40540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2900908AbgJ0OR2 (ORCPT ); Tue, 27 Oct 2020 10:17:28 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63668206D4; Tue, 27 Oct 2020 14:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808248; bh=2xe2IxVXNEOe5tbVNVRFe3UO2+ZWr7Ggj1Le36gQ/9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RLJLM+jdOZSBs3fvrS2GkgEXVMxWTae052Kn+ymzKqwfcnQ0aR2fkPLA+0cVNKrtd tX+h8pHp9DDs6JUR9NIAimb//ascXrRBiK6wMQCzHxk9MbhJL16H8606U/Zb5Excdq 8gerU2LL7gQG3rq8IMEf4lmsFXPVij7UK8aKmccQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Neil Horman , Krzysztof Halasa , Xie He , Jakub Kicinski Subject: [PATCH 4.19 020/264] net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup Date: Tue, 27 Oct 2020 14:51:18 +0100 Message-Id: <20201027135431.609009179@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135430.632029009@linuxfoundation.org> References: <20201027135430.632029009@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Xie He [ Upstream commit 5fce1e43e2d5bf2f7e3224d7b99b1c65ab2c26e2 ] This driver calls ether_setup to set up the network device. The ether_setup function would add the IFF_TX_SKB_SHARING flag to the device. This flag indicates that it is safe to transmit shared skbs to the device. However, this is not true. This driver may pad the frame (in eth_tx) before transmission, so the skb may be modified. Fixes: 550fd08c2ceb ("net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared") Cc: Neil Horman Cc: Krzysztof Halasa Signed-off-by: Xie He Link: https://lore.kernel.org/r/20201020063420.187497-1-xie.he.0141@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/wan/hdlc_raw_eth.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/wan/hdlc_raw_eth.c +++ b/drivers/net/wan/hdlc_raw_eth.c @@ -102,6 +102,7 @@ static int raw_eth_ioctl(struct net_devi old_qlen = dev->tx_queue_len; ether_setup(dev); dev->tx_queue_len = old_qlen; + dev->priv_flags &= ~IFF_TX_SKB_SHARING; eth_hw_addr_random(dev); call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE, dev); netif_dormant_off(dev);