summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2019-09-18 10:21:17 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 13:13:15 +0200
commitee8c5c7a6f9ab76de6620896ac9b02a636a32cbe (patch)
treed645d1e95767ef865879d40b63963d97b20b17c8 /net
parent6ee46a2b68fcb29d00b40aa667c6911d488dab07 (diff)
downloadlinux-stable-ee8c5c7a6f9ab76de6620896ac9b02a636a32cbe.tar.gz
linux-stable-ee8c5c7a6f9ab76de6620896ac9b02a636a32cbe.tar.bz2
linux-stable-ee8c5c7a6f9ab76de6620896ac9b02a636a32cbe.zip
net: qrtr: Stop rx_worker before freeing node
[ Upstream commit 73f0c11d11329a0d6d205d4312b6e5d2512af7c5 ] As the endpoint is unregistered there might still be work pending to handle incoming messages, which will result in a use after free scenario. The plan is to remove the rx_worker, but until then (and for stable@) ensure that the work is stopped before the node is freed. Fixes: bdabad3e363d ("net: Add Qualcomm IPC router") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/qrtr/qrtr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
index 6c8b0f6d28f9..88f98f27ad88 100644
--- a/net/qrtr/qrtr.c
+++ b/net/qrtr/qrtr.c
@@ -150,6 +150,7 @@ static void __qrtr_node_release(struct kref *kref)
list_del(&node->item);
mutex_unlock(&qrtr_node_lock);
+ cancel_work_sync(&node->work);
skb_queue_purge(&node->rx_queue);
kfree(node);
}