linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roberto Sassu <roberto.sassu@huaweicloud.com>
To: Mimi Zohar <zohar@linux.ibm.com>,
	dmitry.kasatkin@gmail.com, paul@paul-moore.com,
	jmorris@namei.org, serge@hallyn.com
Cc: linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, isaac.jmatt@gmail.com,
	Roberto Sassu <roberto.sassu@huawei.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] ima: Fix memory leak in __ima_inode_hash()
Date: Thu, 03 Nov 2022 08:49:23 +0100	[thread overview]
Message-ID: <de51358cb9019a1834cb6ad0f0b7785a8b21d72c.camel@huaweicloud.com> (raw)
In-Reply-To: <ef7375db277ac6a9398ee31a27e95eed717c4832.camel@linux.ibm.com>

On Wed, 2022-11-02 at 18:04 -0400, Mimi Zohar wrote:
> Hi Roberto,
> 
> On Wed, 2022-11-02 at 17:30 +0100, Roberto Sassu wrote:
> > From: Roberto Sassu <roberto.sassu@huawei.com>
> 
> Any chance you could fix your mailer?

Hi Mimi

not sure how to fix this. I need to send from @huaweicloud.com because
some people didn't receive the patches from @huawei.com. But I still
prefer to have the original email in the patches.

Thanks

Roberto

> > Commit f3cc6b25dcc5 ("ima: always measure and audit files in
> > policy") lets
> > measurement or audit happen even if the file digest cannot be
> > calculated.
> > 
> > As a result, iint->ima_hash could have been allocated despite
> > ima_collect_measurement() returning an error.
> > 
> > Since ima_hash belongs to a temporary inode metadata structure,
> > declared
> > at the beginning of __ima_inode_hash(), just add a kfree() call if
> > ima_collect_measurement() returns an error different from -ENOMEM
> > (in that
> > case, ima_hash should not have been allocated).
> > 
> > Cc: stable@vger.kernel.org
> > Fixes: 280fe8367b0d ("ima: Always return a file measurement in
> > ima_file_hash()")
> > Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> 
> Thanks,
> 
> Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>


      reply	other threads:[~2022-11-03  7:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 16:30 [PATCH] ima: Fix memory leak in __ima_inode_hash() Roberto Sassu
2022-11-02 22:04 ` Mimi Zohar
2022-11-03  7:49   ` Roberto Sassu [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=de51358cb9019a1834cb6ad0f0b7785a8b21d72c.camel@huaweicloud.com \
    --to=roberto.sassu@huaweicloud.com \
    --cc=bpf@vger.kernel.org \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=isaac.jmatt@gmail.com \
    --cc=jmorris@namei.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=roberto.sassu@huawei.com \
    --cc=serge@hallyn.com \
    --cc=stable@vger.kernel.org \
    --cc=zohar@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).