diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2019-09-18 20:21:17 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-05 13:30:13 +0300 |
commit | 68b042d38c69688a8b8684837f743520cf451a9a (patch) | |
tree | 1976c9a53caa64f4f771ab2c9680965886ebef06 | |
parent | 9d8ea820ac9438163306aeb1c112e34417f1970b (diff) | |
download | linux-68b042d38c69688a8b8684837f743520cf451a9a.tar.xz |
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>
-rw-r--r-- | net/qrtr/qrtr.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 7b670a9a375e..ee930b3011cc 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -126,6 +126,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); } |