Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] NFSv4: Fix memory leak in nfs4_set_security_label
@ 2024-05-22  7:45 Dmitry Mastykin
  2024-05-22 12:25 ` Trond Myklebust
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Mastykin @ 2024-05-22  7:45 UTC (permalink / raw)
  To: trond.myklebust, anna, linux-nfs, linux-kernel; +Cc: Dmitry Mastykin

We leak nfs_fattr and nfs4_label every time we set a security xattr.

Signed-off-by: Dmitry Mastykin <mastichi@gmail.com>
---
 fs/nfs/nfs4proc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ea390db94b62..d400093a2fff 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -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 */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-22 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-22  7:45 [PATCH] NFSv4: Fix memory leak in nfs4_set_security_label Dmitry Mastykin
2024-05-22 12:25 ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox