]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
NFSD fixing possible null pointer derefering in copy offload
authorOlga Kornievskaia <olga.kornievskaia@gmail.com>
Wed, 4 Dec 2019 20:13:54 +0000 (15:13 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 06:00:53 +0000 (01:00 -0500)
BugLink: https://bugs.launchpad.net/bugs/1862227
commit 18f428d4e2f7eff162d80b2b21689496c4e82afd upstream.

Static checker revealed possible error path leading to possible
NULL pointer dereferencing.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: e0639dc5805a: ("NFSD introduce async copy feature")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/nfsd/nfs4proc.c

index c187d892e656db5c4054c6d629a454e5a969de91..bff38e0ff0cf9ce1a053c63f101e37f0d347c85a 100644 (file)
@@ -1303,7 +1303,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 out:
        return status;
 out_err:
-       cleanup_async_copy(async_copy);
+       if (async_copy)
+               cleanup_async_copy(async_copy);
        goto out;
 }