From patchwork Tue Oct 27 13:46:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 307139 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=unavailable 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 08537C6379F for ; Tue, 27 Oct 2020 17:25:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B87F72076B for ; Tue, 27 Oct 2020 17:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603819550; bh=DXF48mq6FhP6yJuUDLkahPrjOE9J5yn6xuCS9tNPWvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yechRHT71NrKoxfKx6Z0jyay88As4ZrFNQkH5wXWfA9TLcd1NJG1GODTLpJ5OuOh7 aku5eHK1SrjTZjYlBXq2cQH7FTgiBSbYftPb4igNFtaiV/HVG0X/QER/UW18oohEJ8 KYEyABw90sVTvIcF4X0PwlS7RvGfat6ogBV7NLCY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751811AbgJ0Owz (ORCPT ); Tue, 27 Oct 2020 10:52:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:50062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1771826AbgJ0OuN (ORCPT ); Tue, 27 Oct 2020 10:50:13 -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 8CC34206E5; Tue, 27 Oct 2020 14:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810213; bh=DXF48mq6FhP6yJuUDLkahPrjOE9J5yn6xuCS9tNPWvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m5K9y/Wj1tvO1UM/oR6qw18DywaaXSda403NpCxbtY8EOnmXghiMq+4LTgGaDJkg3 xNoXLDp3nXx/wfmNBNfXa/r0iSWmKKnY8W9BA2X+24w7UdEiMnpPDKqy5Y5noyBGhi fQttll5wLZ1RVL2WWx27srsWkB0jquygrXK5e5yU= 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 5.8 043/633] net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup Date: Tue, 27 Oct 2020 14:46:26 +0100 Message-Id: <20201027135524.725341993@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 @@ -99,6 +99,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);