]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
NFSv4: Fix memory leak in nfs4_set_security_label
authorDmitry Mastykin <mastichi@gmail.com>
Wed, 22 May 2024 07:45:24 +0000 (10:45 +0300)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 22 May 2024 15:27:04 +0000 (11:27 -0400)
We leak nfs_fattr and nfs4_label every time we set a security xattr.

Signed-off-by: Dmitry Mastykin <mastichi@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs4proc.c

index c93c12063b3af207f61f7d7572481d4fc439b0aa..94c07875aa3f42c4543c6409a881739bfcaf7dfb 100644 (file)
@@ -6268,6 +6268,7 @@ nfs4_set_security_label(struct inode *inode, const void *buf, size_t buflen)
        if (status == 0)
                nfs_setsecurity(inode, fattr);
 
+       nfs_free_fattr(fattr);
        return status;
 }
 #endif /* CONFIG_NFS_V4_SECURITY_LABEL */