net/9p/trans_fd.c: fix race by holding the lock
authorTomas Bortoli <tomasbortoli@gmail.com>
Mon, 23 Jul 2018 18:42:53 +0000 (20:42 +0200)
committerDominique Martinet <dominique.martinet@cea.fr>
Mon, 13 Aug 2018 00:34:58 +0000 (09:34 +0900)
commit9f476d7c540cb57556d3cc7e78704e6cd5100f5f
treed4892ba2088c3022a47fc7db4fe7b2ecea5ebe4a
parent430ac66eb4c5b5c4eb846b78ebf65747510b30f1
net/9p/trans_fd.c: fix race by holding the lock

It may be possible to run p9_fd_cancel() with a deleted req->req_list
and incur in a double del. To fix hold the client->lock while changing
the status, so the other threads will be synchronized.

Link: http://lkml.kernel.org/r/20180723184253.6682-1-tomasbortoli@gmail.com
Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+735d926e9d1317c3310c@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: David S. Miller <davem@davemloft.net>
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
net/9p/trans_fd.c