]> git.baikalelectronics.ru Git - kernel.git/commit
9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work
authorWang Hai <wanghai38@huawei.com>
Fri, 12 Jun 2020 09:08:33 +0000 (17:08 +0800)
committerDominique Martinet <asmadeus@codewreck.org>
Sun, 19 Jul 2020 12:58:47 +0000 (14:58 +0200)
commit105a3b0dea6e5397ae5c990455ea3fdc13729fd2
treec31cb1d3bcd23daf8d7e73df4616025b6be93ace
parentcf1ac3a1f57d4d6976de96bda184fa920c2e5041
9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work

p9_read_work and p9_fd_cancelled may be called concurrently.
In some cases, req->req_list may be deleted by both p9_read_work
and p9_fd_cancelled.

We can fix it by ignoring replies associated with a cancelled
request and ignoring cancelled request if message has been received
before lock.

Link: http://lkml.kernel.org/r/20200612090833.36149-1-wanghai38@huawei.com
Fixes: 51dac1860d13 ("9p: client: remove unused code and any reference to "cancelled" function")
Cc: <stable@vger.kernel.org> # v3.12+
Reported-by: syzbot+77a25acfa0382e06ab23@syzkaller.appspotmail.com
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
net/9p/trans_fd.c