[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20171203.101623.172697821779462247.davem@davemloft.net>
Date: Sun, 03 Dec 2017 10:16:23 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: gvaradar@...co.com
Cc: netdev@...r.kernel.org, benve@...co.com
Subject: Re: [PATCH net-next] enic: add sw timestamp support
From: Govindarajulu Varadarajan <gvaradar@...co.com>
Date: Fri, 1 Dec 2017 10:21:40 -0800
> Add ethtool ops to advertise sw timestamping.
> Call skb_tx_timestamp() just before ringing the wq doorbell.
>
> Signed-off-by: Govindarajulu Varadarajan <gvaradar@...co.com>
...
> diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
> index e130fb757e7b..d98676e43e03 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_main.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_main.c
> @@ -856,6 +856,7 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
>
> if (vnic_wq_desc_avail(wq) < MAX_SKB_FRAGS + ENIC_DESC_MAX_SPLITS)
> netif_tx_stop_queue(txq);
> + skb_tx_timestamp(skb);
> if (!skb->xmit_more || netif_xmit_stopped(txq))
> vnic_wq_doorbell(wq);
>
Applied, but if you even make this queue processing code lockless you will
have a use-after-free here as you're placing the SKB into the TX queue
before accessing the 'skb' via skb_tx_timestamp() and it thus could be
freed by TX completion beforehand.
Powered by blists - more mailing lists