From: Xiaotian Feng <xtfeng@gmail.com>
To: wzt wzt <wzt.wzt@gmail.com>
Cc: linux-kernel@vger.kernel.org, zohar@us.ibm.com
Subject: Re: [PATCH] security/integrity/ima/ima_iint.c: Remove goto out int ima_inode_alloc()
Date: Mon, 8 Feb 2010 15:08:41 +0800 [thread overview]
Message-ID: <7b6bb4a51002072308p7a1bc346m6b2647c73283527@mail.gmail.com> (raw)
In-Reply-To: <628d1651002072257m154de288y38158afe55ca1d07@mail.gmail.com>
On Mon, Feb 8, 2010 at 2:57 PM, wzt wzt <wzt.wzt@gmail.com> wrote:
> Signed-off-by: wzt <zhitong.wangzt@alibaba-inc.com>
>
> diff --git a/security/integrity/ima/ima_iint.c
> b/security/integrity/ima/ima_iint.c
> index 0d83edc..4e2df22 100644
> --- a/security/integrity/ima/ima_iint.c
> +++ b/security/integrity/ima/ima_iint.c
> @@ -57,18 +57,17 @@ int ima_inode_alloc(struct inode *inode)
> return -ENOMEM;
>
> rc = radix_tree_preload(GFP_NOFS);
> - if (rc < 0)
> - goto out;
> + if (rc < 0) {
> + kmem_cache_free(iint_cache, iint);
> + radix_tree_preload_end();
> + return rc;
> + }
>
> spin_lock(&ima_iint_lock);
> rc = radix_tree_insert(&ima_iint_store, (unsigned long)inode, iint);
> spin_unlock(&ima_iint_lock);
> -out:
> - if (rc < 0)
> - kmem_cache_free(iint_cache, iint);
So if radix_tree_insert failed, the memory will be leaked.
This patch doesn't fix anything but introduces new bug....
>
> radix_tree_preload_end();
> -
> return rc;
> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
prev parent reply other threads:[~2010-02-08 7:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-08 6:57 wzt wzt
2010-02-08 7:08 ` Xiaotian Feng [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=7b6bb4a51002072308p7a1bc346m6b2647c73283527@mail.gmail.com \
--to=xtfeng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wzt.wzt@gmail.com \
--cc=zohar@us.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
all inboxes | Powered by JetHome®