public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.1 01/12] NFSv4: Fix memory leak in nfs4_set_security_label
@ 2024-06-23 13:45 Sasha Levin
  2024-06-23 13:45 ` [PATCH AUTOSEL 6.1 02/12] nfs: propagate readlink errors in nfs_symlink_filler Sasha Levin
  2024-06-23 13:45 ` [PATCH AUTOSEL 6.1 03/12] nfs: don't invalidate dentries on transient errors Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2024-06-23 13:45 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dmitry Mastykin, Trond Myklebust, Sasha Levin, trondmy, anna,
	linux-nfs

From: Dmitry Mastykin <mastichi@gmail.com>

[ Upstream commit aad11473f8f4be3df86461081ce35ec5b145ba68 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/nfs/nfs4proc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ec641a8f6604b..cc620fc7aaf7b 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6274,6 +6274,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.43.0


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

end of thread, other threads:[~2024-06-23 13:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-23 13:45 [PATCH AUTOSEL 6.1 01/12] NFSv4: Fix memory leak in nfs4_set_security_label Sasha Levin
2024-06-23 13:45 ` [PATCH AUTOSEL 6.1 02/12] nfs: propagate readlink errors in nfs_symlink_filler Sasha Levin
2024-06-23 13:45 ` [PATCH AUTOSEL 6.1 03/12] nfs: don't invalidate dentries on transient errors Sasha Levin

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