wil6210: fix race conditions between TX send and completion
authorMaya Erez <qca_merez@qca.qualcomm.com>
Mon, 16 May 2016 19:23:30 +0000 (22:23 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Sat, 28 May 2016 08:19:09 +0000 (11:19 +0300)
commiteb26cff148f5449972121e46e403f549d71f6f49
tree25ce9dfaf3b9e0a2c537b1c0597c2d57e5a71464
parente94610cc1c8f2cc1154c941cbc2d91723f85b60c
wil6210: fix race conditions between TX send and completion

There are 2 possible race conditions, both are solved by addition of
memory barrier:
1. wil_tx_complete reads the swhead to determine if the vring is
empty. In case the swhead was updated before the descriptor update
was performed in __wil_tx_vring/__wil_tx_vring_tso, the completion
loop will not end and as the DU bit may still be set from a previous
run, this skb can be handled as completed before it was sent, which
will lead to double free of the same SKB.
2. __wil_tx_vring/__wil_tx_vring_tso calculate the number of available
descriptors according to the swtail. In case the swtail is updated
before memset of ctx to zero is completed, we can handle this
descriptor while later on ctx is zeroed.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/txrx.c
This page took 0.024938 seconds and 5 git commands to generate.