Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup

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 <nhorman@tuxdriver.com>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Link: https://lore.kernel.org/r/20201020063420.187497-1-xie.he.0141@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Xie He and committed by
Jakub Kicinski
5fce1e43 01c4ceae

+1
+1
drivers/net/wan/hdlc_raw_eth.c
··· 99 99 old_qlen = dev->tx_queue_len; 100 100 ether_setup(dev); 101 101 dev->tx_queue_len = old_qlen; 102 + dev->priv_flags &= ~IFF_TX_SKB_SHARING; 102 103 eth_hw_addr_random(dev); 103 104 call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE, dev); 104 105 netif_dormant_off(dev);