* [PATCH net] net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup
@ 2020-10-20 6:34 Xie He
2020-10-22 1:01 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Xie He @ 2020-10-20 6:34 UTC (permalink / raw)
To: Jakub Kicinski, David S. Miller, netdev, linux-kernel,
Neil Horman, Krzysztof Halasa
Cc: Xie He
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.
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
---
drivers/net/wan/hdlc_raw_eth.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wan/hdlc_raw_eth.c b/drivers/net/wan/hdlc_raw_eth.c
index 08e0a46501de..c70a518b8b47 100644
--- 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_device *dev, struct ifreq *ifr)
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);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup
2020-10-20 6:34 [PATCH net] net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup Xie He
@ 2020-10-22 1:01 ` Jakub Kicinski
2020-10-22 1:20 ` Xie He
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2020-10-22 1:01 UTC (permalink / raw)
To: Xie He
Cc: David S. Miller, netdev, linux-kernel, Neil Horman, Krzysztof Halasa
On Mon, 19 Oct 2020 23:34:20 -0700 Xie He wrote:
> 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.
>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Krzysztof Halasa <khc@pm.waw.pl>
> Signed-off-by: Xie He <xie.he.0141@gmail.com>
Applied, thank you.
In the future please try to provide a Fixes: tag.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup
2020-10-22 1:01 ` Jakub Kicinski
@ 2020-10-22 1:20 ` Xie He
0 siblings, 0 replies; 3+ messages in thread
From: Xie He @ 2020-10-22 1:20 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David S. Miller, Linux Kernel Network Developers, LKML,
Neil Horman, Krzysztof Halasa
On Wed, Oct 21, 2020 at 6:02 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> Applied, thank you.
>
> In the future please try to provide a Fixes: tag.
OK. Thanks! I'll remember this in the future!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-22 1:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 6:34 [PATCH net] net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup Xie He
2020-10-22 1:01 ` Jakub Kicinski
2020-10-22 1:20 ` Xie He
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).