Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "anna@kernel.org" <anna@kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"mastichi@gmail.com" <mastichi@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NFSv4: Fix memory leak in nfs4_set_security_label
Date: Wed, 22 May 2024 12:25:05 +0000	[thread overview]
Message-ID: <04bcde52ddd657ef9d9380b6e810671c0e763fb9.camel@hammerspace.com> (raw)
In-Reply-To: <20240522074524.23046-1-mastichi@gmail.com>

On Wed, 2024-05-22 at 10:45 +0300, Dmitry Mastykin wrote:
> [You don't often get email from mastichi@gmail.com. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> 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
> 

Thanks! For future reference, please note the section on indenting in
the file Documentation/process/coding-style.rst as your patch above was
whitespace-broken and so didn't apply cleanly.
Since this was just a 1-liner, I've fixed it up for now, so no need to
resubmit.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



      reply	other threads:[~2024-05-22 12:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04bcde52ddd657ef9d9380b6e810671c0e763fb9.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mastichi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox