diff options
author | Tomas Bortoli <tomasbortoli@gmail.com> | 2018-07-20 12:27:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-09 21:07:55 +0300 |
commit | d90fb2996470afa3d416f7dbafc6482177e2a11e (patch) | |
tree | 4fa6cc436924f58db1aa086ff1423d55e1e7cfe5 /net/9p | |
parent | 7bba0ec33b0b17d1b1609f992825f5b162304738 (diff) | |
download | linux-d90fb2996470afa3d416f7dbafc6482177e2a11e.tar.xz |
net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
commit 430ac66eb4c5b5c4eb846b78ebf65747510b30f1 upstream.
The patch adds the flush in p9_mux_poll_stop() as it the function used by
p9_conn_destroy(), in turn called by p9_fd_close() to stop the async
polling associated with the data regarding the connection.
Link: http://lkml.kernel.org/r/20180720092730.27104-1-tomasbortoli@gmail.com
Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+39749ed7d9ef6dfb23f6@syzkaller.appspotmail.com
To: Eric Van Hensbergen <ericvh@gmail.com>
To: Ron Minnich <rminnich@sandia.gov>
To: Latchesar Ionkov <lucho@ionkov.net>
Cc: Yiwen Jiang <jiangyiwen@huwei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/trans_fd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 80d08f6664cb..e0de928c9827 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -185,6 +185,8 @@ static void p9_mux_poll_stop(struct p9_conn *m) spin_lock_irqsave(&p9_poll_lock, flags); list_del_init(&m->poll_pending_link); spin_unlock_irqrestore(&p9_poll_lock, flags); + + flush_work(&p9_poll_work); } /** |