All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Roberto Sassu <roberto.sassu@huaweicloud.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: Wed, 02 Nov 2022 18:04:55 -0400	[thread overview]
Message-ID: <ef7375db277ac6a9398ee31a27e95eed717c4832.camel@linux.ibm.com> (raw)
In-Reply-To: <20221102163006.1039343-1-roberto.sassu@huaweicloud.com>

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?

> 
> 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-02 22:05 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 [this message]
2022-11-03  7:49   ` Roberto Sassu

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=ef7375db277ac6a9398ee31a27e95eed717c4832.camel@linux.ibm.com \
    --to=zohar@linux.ibm.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=roberto.sassu@huaweicloud.com \
    --cc=serge@hallyn.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.