9p/net: fix missing error check in p9_check_errors
authorDominique Martinet <asmadeus@codewreck.org>
Tue, 2 Nov 2021 10:47:47 +0000 (19:47 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:29 +0000 (14:04 +0100)
commit 27eb4c3144f7a5ebef3c9a261d80cb3e1fa784dc upstream.

Link: https://lkml.kernel.org/r/99338965-d36c-886e-cd0e-1d8fff2b4746@gmail.com
Reported-by: syzbot+06472778c97ed94af66d@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/9p/client.c

index eb42bbb72f523e2f1931d772206176d58c8c245e..bf6ed00d7c37da5accdb677b455ae2bb4867f167 100644 (file)
@@ -538,6 +538,8 @@ static int p9_check_errors(struct p9_client *c, struct p9_req_t *req)
                kfree(ename);
        } else {
                err = p9pdu_readf(&req->rc, c->proto_version, "d", &ecode);
+               if (err)
+                       goto out_err;
                err = -ecode;
 
                p9_debug(P9_DEBUG_9P, "<<< RLERROR (%d)\n", -ecode);