Re: [PATCH] net: gainfar: fix race between issuing and completingTx

From: David Miller
Date: Mon Dec 09 2013 - 20:29:30 EST


From: Nikita Yushchenko <nyushchenko@xxxxxxxxxxxxx>
Date: Fri, 6 Dec 2013 16:35:59 +0400

> gfar_poll() checked Tx queue status without locking, thus allowing
> gfar_start_xmit() to alter it in parallel, which caused hang on every
> other nfsroot boot with RT enabled.
>
> This patch raises locking from gfar_clean_tx_ring() up to gfar_poll().
> With this change applied, hangs are no longer reproduced.
>
> Signed-off-by: Nikita Yushchenko <nyushchenko@xxxxxxxxxxxxx>

This is not sufficient.

You've left a huge comment in gfar_start_xmit() which explains that
the current locking is correct.

Whoever wrote that comment thought there were no problems with the
current arrangement.

If you want to change it, you have to adjust this comment, and also
explain exactly what races without your proposed change.

If you are going to take this lock, you might want to consider using
netif_tx_lock() since that is held across the entirety of any
netdev_ops->ndo_start_xmit() invocation.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/