Skip to content

Commit

Permalink
9p: trans_fd/p9_conn_cancel: drop client lock earlier
Browse files Browse the repository at this point in the history
syzbot reported a double-lock here and we no longer need this
lock after requests have been moved off to local list:
just drop the lock earlier.

Link: https://lkml.kernel.org/r/20220904064028.1305220-1-asmadeus@codewreck.org
Reported-by: syzbot+50f7e8d06c3768dd97f3@syzkaller.appspotmail.com
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Tested-by: Schspa Shi <schspa@gmail.com>
  • Loading branch information
Dominique Martinet committed Oct 4, 2022
1 parent b90cb10 commit 52f1c45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/9p/trans_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,15 @@ static void p9_conn_cancel(struct p9_conn *m, int err)
list_move(&req->req_list, &cancel_list);
}

spin_unlock(&m->client->lock);

list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) {
p9_debug(P9_DEBUG_ERROR, "call back req %p\n", req);
list_del(&req->req_list);
if (!req->t_err)
req->t_err = err;
p9_client_cb(m->client, req, REQ_STATUS_ERROR);
}
spin_unlock(&m->client->lock);
}

static __poll_t
Expand Down

0 comments on commit 52f1c45

Please sign in to comment.